make: fix Unix-style build
This commit is contained in:
parent
0b461f98bd
commit
c6d2548e22
71
INSTALL.txt
71
INSTALL.txt
|
@ -20,9 +20,6 @@ distributions will work in the
|
||||||
way that you probably expect.
|
way that you probably expect.
|
||||||
|
|
||||||
|
|
||||||
>>>> SORRY! Some of the information in this file is out of date.
|
|
||||||
>>>> Build modes and information here are being updated.
|
|
||||||
|
|
||||||
If you stick with this repository, then you have several options:
|
If you stick with this repository, then you have several options:
|
||||||
|
|
||||||
* In-place build --- the default, creates a build in the "racket"
|
* In-place build --- the default, creates a build in the "racket"
|
||||||
|
@ -182,60 +179,42 @@ Installing Packages
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
After you've built and installed minimal Racket, you could install
|
After you've built and installed minimal Racket, you could install
|
||||||
packages via the package-catalog server --- ignoring the content of
|
packages via the package-catalog server, completely ignoring the
|
||||||
"pkgs" and "native-pkgs".
|
content of "pkgs".
|
||||||
|
|
||||||
If you want to install packages manually out of the "pkgs" and
|
If you want to install packages manually out of the "pkgs", the
|
||||||
"native-pkgs" directories, the `local-catalog' target creates a
|
`local-catalog' target creates a catalog as "racket/local/catalog" that
|
||||||
catalog as "build/local/catalog" that points to the sources in "pkgs"
|
merges the currently configured catalog's content with pointers to the
|
||||||
and "native-pkgs". A Unix-style build works that way: it builds and
|
packages in "pkgs". A Unix-style build works that way: it builds and
|
||||||
installs minimal Racket, and then it installs packags out of a catalog
|
installs minimal Racket, and then it installs packags out of a catalog
|
||||||
that is created by `make local-catalog'.
|
that is created by `make local-catalog'.
|
||||||
|
|
||||||
Linking Packages for In-place Development Mode
|
Linking Packages for In-place Development Mode
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
|
|
||||||
Using the "main-distribution" package corresponds to a build that is
|
With an in-place build, you can edit packages within "pkgs" directly
|
||||||
like the main Racket distribution. Furthermore, if you install all of
|
or update those packages with `git pull' plus `raco setup', since the
|
||||||
those packages with `raco pkg install -i --link ...', then you can
|
packages are installed with the equivalent of `raco pkg install -i
|
||||||
edit libraries or update via `git pull' plus `raco setup' (as opposed
|
--static-link ...'.
|
||||||
to updating or reinstalling packages). That's how the in-place build
|
|
||||||
works.
|
|
||||||
|
|
||||||
The `pkg-links' target of the makefile links (or re-links) packages
|
Instead of actually using `raco pkg install --static-link ...`, the
|
||||||
from "pkgs" and "native-pkgs" into the "racket" build. By default,
|
`pkgs-catalog' makefile target creates a catalog that points to the
|
||||||
`pkg-links' starts with the "main-distribution" and "plt-services"
|
packages in "pkgs", and the catalog indicates that the packages are to
|
||||||
packages and links all of their dependencies, which includes all of
|
be installed as links. The `pkgs-catalog' target further configures
|
||||||
the packages in "pkgs". Specify a subset of the packages with
|
the new catalog as the first one to check when installing
|
||||||
`PKGS="...."' as an argument to `make pkg-links'. Make the `pkg-links'
|
packages. The configuration adjustment is made only if no
|
||||||
target whenever the set of dependencies can change.
|
configuration file "racket/etc/config.rktd" exists already.
|
||||||
|
|
||||||
Packages are linked in a database (at "racket/lib/devel-pkgs") that is
|
All other packages (as specified by `PKGS') are installed via the
|
||||||
added to the installation's search paths. As a result, the links
|
default package catalog. They are installed in installation scope, but
|
||||||
affect only the build in the "racket" directory, and they are not
|
the content of "racket/share/pkgs" is not meant to be edited. To
|
||||||
mixed with any links that you specifically install in installation
|
reinstall a package in a mode suitable for editing and manipulation
|
||||||
scope. Packages are linked with the `--no-setup' flag (effectively),
|
with Git tools, use
|
||||||
which means that a `raco setup' is needed after installing links.
|
|
||||||
|
|
||||||
Native-library packages provide (on Mac OS X and Windows) pre-built
|
raco pkg update --clone extra-pkgs/<pkg-name>
|
||||||
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
|
The "extra-pkgs" directory name is a convention that is supported by a
|
||||||
previously remembered value is not used. Supply `LINK_MODE=--restore'
|
".gitignore" entry.
|
||||||
as an argument to to `make' to use the previously remembered `PKGS'
|
|
||||||
value, if any. The `again' (or `win32-again') makefile target is the
|
|
||||||
same as `in-place' (or `win32-in-place'), but with
|
|
||||||
`LINK_MODE=--restore'. To suppress remembering a `PKGS' value, supply
|
|
||||||
`LINK_MODE='; the `PKGS' value is saved by default because
|
|
||||||
`LINK_MODE=--save' is the default.
|
|
||||||
|
|
||||||
The `pkg-links' makefile target installs links to a specific
|
|
||||||
"devel-pkgs" directory and also sets the default package scope for the
|
|
||||||
build to "installation" mode. Both of those configuration adjustments
|
|
||||||
are made only if no configuration file "racket/etc/config.rktd" exists
|
|
||||||
already.
|
|
||||||
|
|
||||||
|
|
||||||
The Whole Enchilada: Building Installers
|
The Whole Enchilada: Building Installers
|
||||||
|
|
18
Makefile
18
Makefile
|
@ -69,7 +69,8 @@ win32-in-place:
|
||||||
PREFIX =
|
PREFIX =
|
||||||
|
|
||||||
CONFIG_PREFIX_ARGS = --prefix="$(PREFIX)" --enable-macprefix
|
CONFIG_PREFIX_ARGS = --prefix="$(PREFIX)" --enable-macprefix
|
||||||
UNIX_RACO_ARGS = $(JOB_OPTIONS) --catalog build/local/catalog --auto -i
|
UNIX_CATALOG = build/local/catalog
|
||||||
|
UNIX_RACO_ARGS = $(JOB_OPTIONS) --catalog $(UNIX_CATALOG) --auto -i
|
||||||
UNIX_BASE_ARGS = SELF_FLAGS_qq="" SKIP_DESTDIR_FIX="skip"
|
UNIX_BASE_ARGS = SELF_FLAGS_qq="" SKIP_DESTDIR_FIX="skip"
|
||||||
|
|
||||||
unix-style:
|
unix-style:
|
||||||
|
@ -83,10 +84,9 @@ cpus-unix-style:
|
||||||
plain-unix-style:
|
plain-unix-style:
|
||||||
if [ "$(PREFIX)" = "" ] ; then $(MAKE) error-need-prefix ; fi
|
if [ "$(PREFIX)" = "" ] ; then $(MAKE) error-need-prefix ; fi
|
||||||
$(MAKE) base CONFIGURE_ARGS_qq='$(CONFIGURE_ARGS_qq) $(CONFIG_PREFIX_ARGS)' $(UNIX_BASE_ARGS)
|
$(MAKE) base CONFIGURE_ARGS_qq='$(CONFIGURE_ARGS_qq) $(CONFIG_PREFIX_ARGS)' $(UNIX_BASE_ARGS)
|
||||||
$(MAKE) local-source-catalog
|
$(MAKE) local-catalog
|
||||||
"$(DESTDIR)$(PREFIX)/bin/raco" pkg install $(UNIX_RACO_ARGS) $(REQUIRED_PKGS) $(PKGS)
|
"$(DESTDIR)$(PREFIX)/bin/raco" pkg install $(UNIX_RACO_ARGS) $(REQUIRED_PKGS) $(PKGS)
|
||||||
cd racket/src/build; $(MAKE) fix-paths
|
cd racket/src/build; $(MAKE) fix-paths
|
||||||
"$(DESTDIR)$(PREFIX)/bin/raco" pkg install $(JOB_OPTIONS) -i --dep search-auto $(INSTALL_PKGS)
|
|
||||||
|
|
||||||
error-need-prefix:
|
error-need-prefix:
|
||||||
: ================================================================
|
: ================================================================
|
||||||
|
@ -94,6 +94,12 @@ error-need-prefix:
|
||||||
: ================================================================
|
: ================================================================
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
LOC_CATALOG = build/local/pkgs-catalog
|
||||||
|
|
||||||
|
local-catalog:
|
||||||
|
"$(DESTDIR)$(PREFIX)/bin/racket" racket/src/pkgs-catalog.rkt $(LOC_CATALOG) pkgs
|
||||||
|
"$(DESTDIR)$(PREFIX)/bin/raco" pkg catalog-copy --force --from-config $(LOC_CATALOG) $(UNIX_CATALOG)
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Base build
|
# Base build
|
||||||
|
|
||||||
|
@ -279,10 +285,12 @@ WIN32_BUNDLE_RACO = bundle\racket\racket $(BUNDLE_RACO_FLAGS)
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Linking all packages (development mode; not an installer build)
|
# Linking all packages (development mode; not an installer build)
|
||||||
|
|
||||||
PKGS_CATALOG = -U -G build/config racket/src/pkgs-catalog.rkt pkgs
|
PKGS_CATALOG = -U -G build/config racket/src/pkgs-catalog.rkt --link
|
||||||
|
PKGS_CONFIG = -U -G build/config racket/src/pkgs-config.rkt
|
||||||
|
|
||||||
pkgs-catalog:
|
pkgs-catalog:
|
||||||
$(PLAIN_RACKET) $(PKGS_CATALOG)
|
$(PLAIN_RACKET) $(PKGS_CATALOG) racket/share/pkgs-catalog pkgs
|
||||||
|
$(PLAIN_RACKET) $(PKGS_CONFIG)
|
||||||
|
|
||||||
win32-pkgs-catalog:
|
win32-pkgs-catalog:
|
||||||
$(MAKE) pkgs-catalog PLAIN_RACKET="$(WIN32_PLAIN_RACKET)"
|
$(MAKE) pkgs-catalog PLAIN_RACKET="$(WIN32_PLAIN_RACKET)"
|
||||||
|
|
|
@ -1,49 +1,28 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require racket/cmdline
|
(require racket/cmdline
|
||||||
racket/file
|
racket/file
|
||||||
racket/list
|
|
||||||
racket/format
|
racket/format
|
||||||
racket/string
|
racket/string
|
||||||
racket/set
|
|
||||||
racket/path
|
racket/path
|
||||||
setup/getinfo
|
setup/getinfo
|
||||||
pkg/lib
|
pkg/lib)
|
||||||
pkg/path)
|
|
||||||
|
|
||||||
;; Find packages in a directory tree ("info.rkt" indicates a package),
|
;; Find packages in a directory tree ("info.rkt" indicates a package),
|
||||||
;; create a catalog that points to those packages to be installed as
|
;; create a catalog that points to those packages --- to be installed as
|
||||||
;; links, and adjust the configuration to consult that catalog first.
|
;; links if `--link` is specified.
|
||||||
|
|
||||||
;; Used by the top-level Makefile in the main Racket repository.
|
;; Used by the top-level Makefile in the main Racket repository.
|
||||||
|
|
||||||
(define config-dir-path (build-path "racket" "etc"))
|
(define link? #f)
|
||||||
(define config-file-path (build-path config-dir-path "config.rktd"))
|
|
||||||
(define catalog-relative-path (build-path 'up "share" "pkgs-catalog"))
|
|
||||||
(define catalog-relative-path-str (path->string catalog-relative-path))
|
|
||||||
(define catalog-path (build-path config-dir-path catalog-relative-path))
|
|
||||||
|
|
||||||
(define dirs
|
(define-values (catalog-path dirs)
|
||||||
(command-line
|
(command-line
|
||||||
|
#:once-each
|
||||||
|
["--link" "Install packages as links"
|
||||||
|
(set! link? #t)]
|
||||||
#:args
|
#:args
|
||||||
dir
|
(catalog-path . dir)
|
||||||
dir))
|
(values catalog-path dir)))
|
||||||
|
|
||||||
(when (file-exists? config-file-path)
|
|
||||||
(call-with-input-file*
|
|
||||||
config-file-path
|
|
||||||
(lambda (i)
|
|
||||||
(define r (read i))
|
|
||||||
(define l (hash-ref r 'catalogs #f))
|
|
||||||
(unless (and (list? l)
|
|
||||||
((length l) . >= . 1)
|
|
||||||
(equal? (car l) catalog-relative-path-str))
|
|
||||||
(error 'pkgs-catalog
|
|
||||||
(~a "config file exists, but does not have a definition of `catalogs' that starts as expected\n"
|
|
||||||
" config file: ~a\n"
|
|
||||||
" expected initial element: ~s\n"
|
|
||||||
" possible solution: delete the config file")
|
|
||||||
config-file-path
|
|
||||||
catalog-relative-path-str)))))
|
|
||||||
|
|
||||||
;; found: maps each available package name to a directory
|
;; found: maps each available package name to a directory
|
||||||
(define found (make-hash))
|
(define found (make-hash))
|
||||||
|
@ -114,7 +93,9 @@
|
||||||
(path->complete-path catalog-path))
|
(path->complete-path catalog-path))
|
||||||
(simple-form-path
|
(simple-form-path
|
||||||
(path->complete-path dir))))
|
(path->complete-path dir))))
|
||||||
"?type=static-link"))
|
(if link?
|
||||||
|
"?type=static-link"
|
||||||
|
"")))
|
||||||
(author . ,(string-join (for/list ([r authors])
|
(author . ,(string-join (for/list ([r authors])
|
||||||
(if (symbol? r)
|
(if (symbol? r)
|
||||||
(format "~a@racket-lang.org" r)
|
(format "~a@racket-lang.org" r)
|
||||||
|
@ -156,17 +137,3 @@
|
||||||
|
|
||||||
(unless (and (null? missing-authors) (null? missing-desc))
|
(unless (and (null? missing-authors) (null? missing-desc))
|
||||||
(error 'link-all "not all packages have description and authors."))
|
(error 'link-all "not all packages have description and authors."))
|
||||||
|
|
||||||
(unless (file-exists? config-file-path)
|
|
||||||
(printf "Writing ~a\n" config-file-path)
|
|
||||||
(call-with-output-file*
|
|
||||||
config-file-path
|
|
||||||
(lambda (o)
|
|
||||||
(write (hash 'catalogs
|
|
||||||
(list catalog-relative-path-str #f)
|
|
||||||
'installation-name
|
|
||||||
"development"
|
|
||||||
'default-scope
|
|
||||||
"installation")
|
|
||||||
o)
|
|
||||||
(newline o))))
|
|
||||||
|
|
51
racket/src/pkgs-config.rkt
Normal file
51
racket/src/pkgs-config.rkt
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
#lang racket/base
|
||||||
|
(require racket/cmdline
|
||||||
|
racket/format
|
||||||
|
racket/path)
|
||||||
|
|
||||||
|
;; Adjust the configuration to consult a catalog that is
|
||||||
|
;; expected to map some packages to directory links.
|
||||||
|
|
||||||
|
;; Used by the top-level Makefile in the main Racket repository.
|
||||||
|
|
||||||
|
(define config-dir-path (build-path "racket" "etc"))
|
||||||
|
(define config-file-path (build-path config-dir-path "config.rktd"))
|
||||||
|
|
||||||
|
(define catalog-relative-path (build-path 'up "share" "pkgs-catalog"))
|
||||||
|
(define catalog-relative-path-str (path->string catalog-relative-path))
|
||||||
|
|
||||||
|
(command-line
|
||||||
|
#:args
|
||||||
|
()
|
||||||
|
(void))
|
||||||
|
|
||||||
|
(when (file-exists? config-file-path)
|
||||||
|
(call-with-input-file*
|
||||||
|
config-file-path
|
||||||
|
(lambda (i)
|
||||||
|
(define r (read i))
|
||||||
|
(define l (hash-ref r 'catalogs #f))
|
||||||
|
(unless (and (list? l)
|
||||||
|
((length l) . >= . 1)
|
||||||
|
(equal? (car l) catalog-relative-path-str))
|
||||||
|
(error 'pkgs-catalog
|
||||||
|
(~a "config file exists, but does not have a definition of `catalogs' that starts as expected\n"
|
||||||
|
" config file: ~a\n"
|
||||||
|
" expected initial element: ~s\n"
|
||||||
|
" possible solution: delete the config file")
|
||||||
|
config-file-path
|
||||||
|
catalog-relative-path-str)))))
|
||||||
|
|
||||||
|
(unless (file-exists? config-file-path)
|
||||||
|
(printf "Writing ~a\n" config-file-path)
|
||||||
|
(call-with-output-file*
|
||||||
|
config-file-path
|
||||||
|
(lambda (o)
|
||||||
|
(write (hash 'catalogs
|
||||||
|
(list catalog-relative-path-str #f)
|
||||||
|
'installation-name
|
||||||
|
"development"
|
||||||
|
'default-scope
|
||||||
|
"installation")
|
||||||
|
o)
|
||||||
|
(newline o))))
|
Loading…
Reference in New Issue
Block a user