access "native-pkgs" as a git submodule

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.
This commit is contained in:
Matthew Flatt 2013-07-26 15:23:23 -06:00
parent c091ac4e8d
commit 593daa0dc6
4 changed files with 30 additions and 29 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "native-pkgs"]
path = native-pkgs
url = https://github.com/plt/libs.git

View File

@ -18,14 +18,17 @@ The "pkgs" directory contains the packages that are included in a
Racket distribution, plus some additional packages (such as tests). Racket distribution, plus some additional packages (such as tests).
On Unix and Mac OS X, you can build Racket plus the included packages 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 with `make in-place' (or just `make'). On Windows, you can use `nmake
"racket" subdirectory. For now, you need to have `git' installed for win32-in-place', as long as you're using Microsoft Visual Studio 9.0
downloading native-library packages. If you want more control over the (2008). The resulting build is in the "racket" subdirectory. If you
process, see below. want more control over the process, see below.
On Windows, you must first clone "git://github.com/plt/libs.git" On Mac OS X and Windows, you'll need native-library packages in the
as "build/native-pkgs". Then, you can use `nmake win32-in-place', "native-pkgs" directory. In the git repostory, "native-pkgs" is a git
as long as you're using Microsoft Visual Studio 9.0 (2008). 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 To install a subset of the packages in "pkgs", supply `PKGS' value to
`make'. For example, `make'. For example,
@ -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. which means that a `raco setup' is needed after installing links.
Native-library packages provide (on Mac OS X and Windows) pre-built Native-library packages provide (on Mac OS X and Windows) pre-built
native libraries, such as Cairo. Currently, the libraries must be native libraries, such as Cairo. They are available through a git
downloaded from GitHub. On a non-Windows platform, the submodule "native-pkgs", so use `git submodule init' and `git
`native-from-git' makefile target clones/updates the native-library submodule update' as needed.
repository from GitHub; otherwise, clone
git://github.com/plt/libs.git
as
build/native-pkgs
By default, the `PKGS' value is remembered by `pkg-links', but a By default, the `PKGS' value is remembered by `pkg-links', but a
previously remembered value is not used. Supply `LINK_MODE=--restore' previously remembered value is not used. Supply `LINK_MODE=--restore'
@ -160,10 +156,8 @@ looks like to install individual packages as if provided by a server
(i.e., not through development-mode links). (i.e., not through development-mode links).
Use `make local-catalog' to create a package catalog that provides Use `make local-catalog' to create a package catalog that provides
mappings for all of the packages in "pkgs" as well as packages mappings for all of the packages in "pkgs" as well as packages for
pre-built native libraries downloaded from GitHub. (On Unix, use the pre-built native libraries.
`local-source-catalog' makefile target to skip native libraries, since
none are needed.)
To install a package, try To install a package, try
@ -374,10 +368,9 @@ In more detail:
The `SRC_CATALOG' variable determines the catalog that is used to The `SRC_CATALOG' variable determines the catalog that is used to
get package sources and native-library packages, but a value of get package sources and native-library packages, but a value of
"local" triggers a bootstrap mode where native libraries are "local" triggers a bootstrap mode where packages are represented
downloaded directly from GitHub and all other packages are by directories in the makefile's directory. For now, "local" is
represented by directories in the makefile's directory. For now, the default.
"local" is the default.
The server provides README files from the "build/readmes" The server provides README files from the "build/readmes"
directory. If "README.txt" does not exist when the sever is directory. If "README.txt" does not exist when the sever is

View File

@ -202,12 +202,13 @@ BUNDLE_CONFIG = bundle/racket/etc/config.rktd
# ------------------------------------------------------------ # ------------------------------------------------------------
# Linking all packages (development mode; not an installer build) # 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: pkg-links:
$(PLAIN_RACKET) $(LINK_ALL) $(LINK_MODE) $(PKGS) $(REQUIRED_PKGS) $(PLAIN_RACKET) $(LINK_ALL) $(LINK_MODE) $(PKGS) $(REQUIRED_PKGS)
win32-pkg-links: 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)" $(MAKE) pkg-links PLAIN_RACKET="$(WIN32_PLAIN_RACKET)" LINK_MODE="$(LINK_MODE)" PKGS="$(PKGS)"
# ------------------------------------------------------------ # ------------------------------------------------------------
@ -250,9 +251,12 @@ local-catalog:
# Get pre-built native libraries from the repo: # Get pre-built native libraries from the repo:
native-from-git: native-from-git:
mkdir -p build if [ ! -d native-pkgs/racket-win32-i386 ]; then $(MAKE) complain-no-submodule ; fi
if [ ! -d build/native-pkgs ]; then cd build; git clone git://github.com/plt/libs.git native-pkgs ; fi complain-no-submodule:
cd build/native-pkgs; if [ -d ".git" ]; then git pull ; fi : 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: # Create packages and a catalog for all native libraries:
native-catalog: native-catalog:

1
native-pkgs Submodule

@ -0,0 +1 @@
Subproject commit f8c8984ebe8a442d474558dced0eb824cbb24772