Skip to content

Commit

Permalink
access "native-pkgs" as a git submodule
Browse files Browse the repository at this point in the history
This looks like a good use case for submodules, because the
native-library packages change infrequently, and no one cares
about the history of changes relative to the rest of the
project (except to be able to get a set of packages that is
consistent with the rest of the repository).

The change avoids the problem that `make' on Mac OS X would
try a `git update', which is no good if you happen to be
offline (and have your "buidl.native-pkgs" repo pull from the
obvious place).

Finally, it's easier for Windows users, since `git submodule init'
and `git submodule update' is easier to use and remember than
`git clone <some-repository-URL>'. The makefile more helpfully
complains if "native-pkgs" doesn't seem to have been initialized
as a submodule.
  • Loading branch information
mflatt committed Jul 27, 2013
1 parent c091ac4 commit 593daa0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "native-pkgs"]
path = native-pkgs
url = https://github.com/plt/libs.git
45 changes: 19 additions & 26 deletions INSTALL.txt
Expand Up @@ -18,14 +18,17 @@ The "pkgs" directory contains the packages that are included in a
Racket distribution, plus some additional packages (such as tests).

On Unix and Mac OS X, you can build Racket plus the included packages
with `make in-place' (or just `make'). The resulting build is in the
"racket" subdirectory. For now, you need to have `git' installed for
downloading native-library packages. If you want more control over the
process, see below.

On Windows, you must first clone "git://github.com/plt/libs.git"
as "build/native-pkgs". Then, you can use `nmake win32-in-place',
as long as you're using Microsoft Visual Studio 9.0 (2008).
with `make in-place' (or just `make'). On Windows, you can use `nmake
win32-in-place', as long as you're using Microsoft Visual Studio 9.0
(2008). The resulting build is in the "racket" subdirectory. If you
want more control over the process, see below.

On Mac OS X and Windows, you'll need native-library packages in the
"native-pkgs" directory. In the git repostory, "native-pkgs" is a git
submodule, so you'll need
git submodule init
git submodule update
to get it set up.

To install a subset of the packages in "pkgs", supply `PKGS' value to
`make'. For example,
Expand Down Expand Up @@ -123,16 +126,9 @@ scope. Packages are linked with the `--no-setup' flag (effectively),
which means that a `raco setup' is needed after installing links.

Native-library packages provide (on Mac OS X and Windows) pre-built
native libraries, such as Cairo. Currently, the libraries must be
downloaded from GitHub. On a non-Windows platform, the
`native-from-git' makefile target clones/updates the native-library
repository from GitHub; otherwise, clone

git://github.com/plt/libs.git

as

build/native-pkgs
native libraries, such as Cairo. They are available through a git
submodule "native-pkgs", so use `git submodule init' and `git
submodule update' as needed.

By default, the `PKGS' value is remembered by `pkg-links', but a
previously remembered value is not used. Supply `LINK_MODE=--restore'
Expand Down Expand Up @@ -160,10 +156,8 @@ looks like to install individual packages as if provided by a server
(i.e., not through development-mode links).

Use `make local-catalog' to create a package catalog that provides
mappings for all of the packages in "pkgs" as well as packages
pre-built native libraries downloaded from GitHub. (On Unix, use the
`local-source-catalog' makefile target to skip native libraries, since
none are needed.)
mappings for all of the packages in "pkgs" as well as packages for
pre-built native libraries.

To install a package, try

Expand Down Expand Up @@ -374,10 +368,9 @@ In more detail:

The `SRC_CATALOG' variable determines the catalog that is used to
get package sources and native-library packages, but a value of
"local" triggers a bootstrap mode where native libraries are
downloaded directly from GitHub and all other packages are
represented by directories in the makefile's directory. For now,
"local" is the default.
"local" triggers a bootstrap mode where packages are represented
by directories in the makefile's directory. For now, "local" is
the default.

The server provides README files from the "build/readmes"
directory. If "README.txt" does not exist when the sever is
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Expand Up @@ -202,12 +202,13 @@ BUNDLE_CONFIG = bundle/racket/etc/config.rktd
# ------------------------------------------------------------
# Linking all packages (development mode; not an installer build)

LINK_ALL = -U -G build/config racket/src/link-all.rkt ++dir pkgs ++dir build/native-pkgs
LINK_ALL = -U -G build/config racket/src/link-all.rkt ++dir pkgs ++dir native-pkgs

pkg-links:
$(PLAIN_RACKET) $(LINK_ALL) $(LINK_MODE) $(PKGS) $(REQUIRED_PKGS)

win32-pkg-links:
IF NOT EXIST native-pkgs\racket-win32-i386 $(MAKE) complain-no-submodule
$(MAKE) pkg-links PLAIN_RACKET="$(WIN32_PLAIN_RACKET)" LINK_MODE="$(LINK_MODE)" PKGS="$(PKGS)"

# ------------------------------------------------------------
Expand Down Expand Up @@ -250,9 +251,12 @@ local-catalog:

# Get pre-built native libraries from the repo:
native-from-git:
mkdir -p build
if [ ! -d build/native-pkgs ]; then cd build; git clone git://github.com/plt/libs.git native-pkgs ; fi
cd build/native-pkgs; if [ -d ".git" ]; then git pull ; fi
if [ ! -d native-pkgs/racket-win32-i386 ]; then $(MAKE) complain-no-submodule ; fi
complain-no-submodule:
: Native packages are not in the expected subdirectory. Probably,
: you need to use 'git submodule init' and 'git submodule update' to get
: the submodule for native packages.
exit 1

# Create packages and a catalog for all native libraries:
native-catalog:
Expand Down
1 change: 1 addition & 0 deletions native-pkgs
Submodule native-pkgs added at f8c898

0 comments on commit 593daa0

Please sign in to comment.