distro-build: change `#:source?' config to mean source packages, too
Use `#:source-runtime?' to make only the run-time system have source form, while packages are pre-built.
This commit is contained in:
parent
c1ca89d674
commit
82c4e56631
16
Makefile
16
Makefile
|
@ -118,9 +118,14 @@ SERVER = localhost
|
||||||
# snapshot installers):
|
# snapshot installers):
|
||||||
RELEASE_MODE =
|
RELEASE_MODE =
|
||||||
|
|
||||||
# Set to "--source" to create a source "installer":
|
# Set to "--source" to create an archive (instead of an "installer"
|
||||||
|
# proper) on a client that has the run-time system in source form:
|
||||||
SOURCE_MODE =
|
SOURCE_MODE =
|
||||||
|
|
||||||
|
# Set to "--source --no-setup" to include packages in an installer
|
||||||
|
# (or archive) only in source form:
|
||||||
|
PKG_SOURCE_MODE =
|
||||||
|
|
||||||
# Human-readable name (spaces allowed), installation name base, and
|
# Human-readable name (spaces allowed), installation name base, and
|
||||||
# Unix installation directory name for the generated installers:
|
# Unix installation directory name for the generated installers:
|
||||||
DIST_NAME = Racket
|
DIST_NAME = Racket
|
||||||
|
@ -332,6 +337,7 @@ client:
|
||||||
|
|
||||||
COPY_ARGS = SERVER=$(SERVER) PKGS="$(PKGS)" \
|
COPY_ARGS = SERVER=$(SERVER) PKGS="$(PKGS)" \
|
||||||
RELEASE_MODE=$(RELEASE_MODE) SOURCE_MODE=$(SOURCE_MODE) \
|
RELEASE_MODE=$(RELEASE_MODE) SOURCE_MODE=$(SOURCE_MODE) \
|
||||||
|
PKG_SOURCE_MODE=$(PKG_SOURCE_MODE) \
|
||||||
DIST_NAME="$(DIST_NAME)" DIST_BASE=$(DIST_BASE) \
|
DIST_NAME="$(DIST_NAME)" DIST_BASE=$(DIST_BASE) \
|
||||||
DIST_DIR=$(DIST_DIR) DIST_SUFFIX=$(DIST_SUFFIX) \
|
DIST_DIR=$(DIST_DIR) DIST_SUFFIX=$(DIST_SUFFIX) \
|
||||||
DIST_DESC="$(DIST_DESC)" README="$(README)" \
|
DIST_DESC="$(DIST_DESC)" README="$(README)" \
|
||||||
|
@ -359,8 +365,8 @@ bundle-from-server:
|
||||||
mkdir -p bundle/racket
|
mkdir -p bundle/racket
|
||||||
$(RACKET) -l setup/unixstyle-install bundle racket bundle/racket
|
$(RACKET) -l setup/unixstyle-install bundle racket bundle/racket
|
||||||
$(RACKET) -l distro-build/unpack-collects http://$(SERVER):9440/
|
$(RACKET) -l distro-build/unpack-collects http://$(SERVER):9440/
|
||||||
bundle/racket/bin/raco pkg install $(REMOTE_INST_AUTO) $(PKGS) $(REQUIRED_PKGS)
|
bundle/racket/bin/raco pkg install $(REMOTE_INST_AUTO) $(PKG_SOURCE_MODE) $(PKGS) $(REQUIRED_PKGS)
|
||||||
$(RACKET) -l setup/unixstyle-install post-adjust$(SOURCE_MODE) racket bundle/racket
|
$(RACKET) -l setup/unixstyle-install post-adjust "$(SOURCE_MODE)" "$(PKG_SOURCE_MODE)" racket bundle/racket
|
||||||
|
|
||||||
bundle-config:
|
bundle-config:
|
||||||
$(RACKET) -l distro-build/set-config $(BUNDLE_CONFIG) "" "" "$(DOC_SEARCH)" $(DIST_CATALOGS_q)
|
$(RACKET) -l distro-build/set-config $(BUNDLE_CONFIG) "" "" "$(DOC_SEARCH)" $(DIST_CATALOGS_q)
|
||||||
|
@ -386,8 +392,8 @@ win32-bundle:
|
||||||
win32-bundle-from-server:
|
win32-bundle-from-server:
|
||||||
$(MAKE) win32-bundle $(COPY_ARGS)
|
$(MAKE) win32-bundle $(COPY_ARGS)
|
||||||
$(WIN32_RACKET) -l distro-build/unpack-collects http://$(SERVER):9440/
|
$(WIN32_RACKET) -l distro-build/unpack-collects http://$(SERVER):9440/
|
||||||
bundle\racket\raco pkg install $(REMOTE_INST_AUTO) $(REQUIRED_PKGS)
|
bundle\racket\raco pkg install $(REMOTE_INST_AUTO) $(PKG_SOURCE_MODE) $(REQUIRED_PKGS)
|
||||||
bundle\racket\raco pkg install $(REMOTE_INST_AUTO) $(PKGS)
|
bundle\racket\raco pkg install $(REMOTE_INST_AUTO) $(PKG_SOURCE_MODE) $(PKGS)
|
||||||
|
|
||||||
win32-installer-from-bundle:
|
win32-installer-from-bundle:
|
||||||
$(WIN32_RACKET) -l- distro-build/installer $(DIST_ARGS_q)
|
$(WIN32_RACKET) -l- distro-build/installer $(DIST_ARGS_q)
|
||||||
|
|
|
@ -138,6 +138,8 @@
|
||||||
[(#:pull?) (boolean? val)]
|
[(#:pull?) (boolean? val)]
|
||||||
[(#:release?) (boolean? val)]
|
[(#:release?) (boolean? val)]
|
||||||
[(#:source?) (boolean? val)]
|
[(#:source?) (boolean? val)]
|
||||||
|
[(#:source-runtime?) (boolean? val)]
|
||||||
|
[(#:source-pkgs?) (boolean? val)]
|
||||||
[(#:site-dest) (path-string? val)]
|
[(#:site-dest) (path-string? val)]
|
||||||
[(#:pdf-doc?) (boolean? val)]
|
[(#:pdf-doc?) (boolean? val)]
|
||||||
[(#:max-snapshots) (real? val)]
|
[(#:max-snapshots) (real? val)]
|
||||||
|
|
|
@ -204,11 +204,20 @@ Site-configuration keywords (where <string*> means no spaces, etc.):
|
||||||
installers; the default is determined by the `RELEASE_MODE'
|
installers; the default is determined by the `RELEASE_MODE'
|
||||||
makefile variable
|
makefile variable
|
||||||
|
|
||||||
#:source? <boolean> --- if true, then create a kernel-source archive
|
#:source? <boolean> --- determines the default value for
|
||||||
(with pre-built packages), instead of a platform-specific
|
`#:source-runtime' and `#:source-pkgs'
|
||||||
installer; a #t value works best when used with a Unix client
|
|
||||||
machine, since Unix clients typically have no native-library
|
#:source-runtime? <boolean> --- if true, then create an archive that
|
||||||
packages; the default is #f
|
contains the run-time system in source form (possibly with built
|
||||||
|
packages), instead of a platform-specific installer; a #t value
|
||||||
|
works best when used with a Unix client machine, since Unix
|
||||||
|
clients typically have no native-library packages; the default is
|
||||||
|
the value of `#:source?'
|
||||||
|
|
||||||
|
#:source-pkgs? --- if true, then packages are included in the
|
||||||
|
installer/archive only in source form; a true value works best
|
||||||
|
when the `#:source-runtime?' value is also #t; the default is the
|
||||||
|
value of `#:source?'
|
||||||
|
|
||||||
#:site-dest <path-string> --- destination for completed build, used
|
#:site-dest <path-string> --- destination for completed build, used
|
||||||
by the `site' and `snapshot-site' makefile targets; the default is
|
by the `site' and `snapshot-site' makefile targets; the default is
|
||||||
|
|
|
@ -250,6 +250,8 @@
|
||||||
(define dist-catalogs (choose-catalogs c '("")))
|
(define dist-catalogs (choose-catalogs c '("")))
|
||||||
(define release? (get-opt c '#:release? default-release?))
|
(define release? (get-opt c '#:release? default-release?))
|
||||||
(define source? (get-opt c '#:source? #f))
|
(define source? (get-opt c '#:source? #f))
|
||||||
|
(define source-pkgs? (get-opt c '#:source-pkgs? source?))
|
||||||
|
(define source-runtime? (get-opt c '#:source-runtime? source?))
|
||||||
(~a " SERVER=" server
|
(~a " SERVER=" server
|
||||||
" PKGS=" (q pkgs)
|
" PKGS=" (q pkgs)
|
||||||
" DOC_SEARCH=" (q doc-search)
|
" DOC_SEARCH=" (q doc-search)
|
||||||
|
@ -260,7 +262,10 @@
|
||||||
" DIST_SUFFIX=" (q dist-suffix)
|
" DIST_SUFFIX=" (q dist-suffix)
|
||||||
" DIST_CATALOGS_q=" (qq dist-catalogs kind)
|
" DIST_CATALOGS_q=" (qq dist-catalogs kind)
|
||||||
" RELEASE_MODE=" (if release? "--release" (q ""))
|
" RELEASE_MODE=" (if release? "--release" (q ""))
|
||||||
" SOURCE_MODE=" (if source? "--source" (q ""))
|
" SOURCE_MODE=" (if source-runtime? "--source" (q ""))
|
||||||
|
" PKG_SOURCE_MODE=" (if source-pkgs?
|
||||||
|
(q "--source --no-setup")
|
||||||
|
(q ""))
|
||||||
" README=" (q (file-name-from-path readme))))
|
" README=" (q (file-name-from-path readme))))
|
||||||
|
|
||||||
(define (unix-build c host port user server repo clean? pull? readme)
|
(define (unix-build c host port user server repo clean? pull? readme)
|
||||||
|
|
|
@ -21,10 +21,13 @@
|
||||||
@|(hash-ref config '#:name "Racket")|
|
@|(hash-ref config '#:name "Racket")|
|
||||||
distribution for version @(version)@(maybe-stamp config).@;
|
distribution for version @(version)@(maybe-stamp config).@;
|
||||||
|
|
||||||
@(if (hash-ref config '#:source? #f)
|
@(if (let ([src? (hash-ref config '#:source? #f)])
|
||||||
|
(or (hash-ref config '#:source-runtime? src?)
|
||||||
|
(hash-ref config '#:source-pkgs? src?)))
|
||||||
(string-append "\n" (make-source-notes config) "\n")
|
(string-append "\n" (make-source-notes config) "\n")
|
||||||
"")@;
|
"")@;
|
||||||
@(if (and (not (hash-ref config '#:source? #f))
|
@(if (and (not (hash-ref config '#:source-runtime?
|
||||||
|
(hash-ref config '#:source? #f)))
|
||||||
(eq? (hash-ref config '#:platform (system-type)) 'macosx))
|
(eq? (hash-ref config '#:platform (system-type)) 'macosx))
|
||||||
(string-append "\n" (make-macosx-notes config) "\n")
|
(string-append "\n" (make-macosx-notes config) "\n")
|
||||||
"")@;
|
"")@;
|
||||||
|
@ -66,14 +69,28 @@
|
||||||
share/COPYING_LESSER.txt for more information.})
|
share/COPYING_LESSER.txt for more information.})
|
||||||
|
|
||||||
(define (make-source-notes config)
|
(define (make-source-notes config)
|
||||||
|
(define src? (hash-ref config '#:source? #f))
|
||||||
@~a{This distribution provides source for the Racket run-time system;
|
(define rt-src
|
||||||
for build and installation instructions, see "racket/src/README".
|
@~a{This distribution provides source for the Racket run-time system;
|
||||||
Besides the run-time system's source, the distribution provides
|
for build and installation instructions, see "racket/src/README".})
|
||||||
pre-built versions of the core Racket bytecode, as well as pre-built
|
(define pkg-src
|
||||||
versions of included packages and documentation --- which makes it
|
@~a{(The distribution also includes the core Racket collections and any
|
||||||
suitable for quick installation on a Unix platform for which
|
installed packages in source form.)})
|
||||||
executable binaries are not already provided.})
|
(define pkg-built
|
||||||
|
@~a{Besides the run-time system's source, the distribution provides
|
||||||
|
pre-built versions of the core Racket bytecode, as well as pre-built
|
||||||
|
versions of included packages and documentation --- which makes it
|
||||||
|
suitable for quick installation on a Unix platform for which
|
||||||
|
executable binaries are not already provided.})
|
||||||
|
(cond
|
||||||
|
[(and (hash-ref config '#:source-runtime? src?)
|
||||||
|
(not (hash-ref config '#:source-pkgs? src?)))
|
||||||
|
(~a rt-src "\n" pkg-built)]
|
||||||
|
[(and (hash-ref config '#:source-runtime? src?)
|
||||||
|
(hash-ref config '#:source-pkgs? src?))
|
||||||
|
(~a rt-src "\n" pkg-src)]
|
||||||
|
[else
|
||||||
|
@~a{The distribution includes any pre-installed packages in source form.}]))
|
||||||
|
|
||||||
(define (make-macosx-notes config)
|
(define (make-macosx-notes config)
|
||||||
@~a{Install by dragging the enclosing
|
@~a{Install by dragging the enclosing
|
||||||
|
|
|
@ -12,8 +12,9 @@
|
||||||
;; (interactive, undo-on-error, create-uninstaller)
|
;; (interactive, undo-on-error, create-uninstaller)
|
||||||
;; - `copy': similar to `move', but copies instead of moving
|
;; - `copy': similar to `move', but copies instead of moving
|
||||||
;; - `bundle': like `copy', but no uninstall script
|
;; - `bundle': like `copy', but no uninstall script
|
||||||
;; - `post-adjust': adjust an existing bundle after package installs
|
;; - `post-adjust': adjust an existing bundle after package installs;
|
||||||
;; - `post-adjust--source': (really two dashes), like `post-adjust', but for source
|
;; two extra arguments determine whether to strip build
|
||||||
|
;; artifacts
|
||||||
;; - `make-install-copytree': copies some toplevel directories, skips ".*"
|
;; - `make-install-copytree': copies some toplevel directories, skips ".*"
|
||||||
;; subdirs, and rewrites "config.rkt", but no uninstaller
|
;; subdirs, and rewrites "config.rkt", but no uninstaller
|
||||||
;; (used by `make install') (requires an additional `origtree' argument)
|
;; (used by `make install') (requires an additional `origtree' argument)
|
||||||
|
@ -35,6 +36,9 @@
|
||||||
(begin0 (car args) (set! args (cdr args))))
|
(begin0 (car args) (set! args (cdr args))))
|
||||||
|
|
||||||
(define op (string->symbol (get-arg)))
|
(define op (string->symbol (get-arg)))
|
||||||
|
(define adjust-mode
|
||||||
|
(and (eq? op 'post-adjust)
|
||||||
|
(list (get-arg) (get-arg))))
|
||||||
(define rktdir (get-arg))
|
(define rktdir (get-arg))
|
||||||
(define base-destdir (and (pair? args)
|
(define base-destdir (and (pair? args)
|
||||||
(null? (cdr args))
|
(null? (cdr args))
|
||||||
|
@ -119,6 +123,16 @@
|
||||||
(delete-directory path)]
|
(delete-directory path)]
|
||||||
[else #t])) ; shouldn't happen
|
[else #t])) ; shouldn't happen
|
||||||
|
|
||||||
|
;; removes "compiled" subdirectories recursively
|
||||||
|
(define (rm-compiled path)
|
||||||
|
(define (loop path)
|
||||||
|
(cond [(equal? path "compiled") (rm path)]
|
||||||
|
[(directory-exists? path)
|
||||||
|
(parameterize ([current-directory path]) (for-each loop (ls)))]
|
||||||
|
[else (void)]))
|
||||||
|
(parameterize ([current-directory path])
|
||||||
|
(for-each loop (ls))))
|
||||||
|
|
||||||
;; used for filtering files when copying (and moving toplevels)
|
;; used for filtering files when copying (and moving toplevels)
|
||||||
(define skip-filter (lambda (p) #f))
|
(define skip-filter (lambda (p) #f))
|
||||||
|
|
||||||
|
@ -469,20 +483,24 @@
|
||||||
(fix-executables bindir librktdir)
|
(fix-executables bindir librktdir)
|
||||||
(unless origtree? (write-config configdir)))
|
(unless origtree? (write-config configdir)))
|
||||||
|
|
||||||
(define (post-adjust-source)
|
(define (post-adjust)
|
||||||
(define do-tree (move/copy-tree #f))
|
(when (regexp-match? #rx"--source" (car adjust-mode))
|
||||||
(current-directory rktdir)
|
(define do-tree (move/copy-tree #f))
|
||||||
;; Copy source into place:
|
(current-directory rktdir)
|
||||||
(set! skip-filter ; skip src/build
|
;; Copy source into place:
|
||||||
(lambda (p) (regexp-match? #rx"^build$" p)))
|
(set! skip-filter ; skip src/build
|
||||||
(do-tree "src" (build-path base-destdir "src"))
|
(lambda (p) (regexp-match? #rx"^build$" p)))
|
||||||
;; Remove directories that get re-created:
|
(do-tree "src" (build-path base-destdir "src"))
|
||||||
(define (remove! dst*) (rm (dir: dst*)))
|
;; Remove directories that get re-created:
|
||||||
(remove! 'bin)
|
(define (remove! dst*) (rm (dir: dst*)))
|
||||||
(remove! 'lib)
|
(remove! 'bin)
|
||||||
(remove! 'man)
|
(remove! 'lib)
|
||||||
(remove! 'config) ; may be recreated by a later bundle step
|
(remove! 'man)
|
||||||
(remove! 'includerkt))
|
(remove! 'config) ; may be recreated by a later bundle step
|
||||||
|
(remove! 'includerkt)
|
||||||
|
(when (regexp-match? #rx"--source" (cadr adjust-mode))
|
||||||
|
;; strip "compiled" directories back out of "collects"
|
||||||
|
(rm-compiled (dir: 'collects)))))
|
||||||
|
|
||||||
;; --------------------------------------------------------------------------
|
;; --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -491,8 +509,7 @@
|
||||||
[(move) (move/copy-distribution #t #f)]
|
[(move) (move/copy-distribution #t #f)]
|
||||||
[(copy) (move/copy-distribution #f #f)]
|
[(copy) (move/copy-distribution #f #f)]
|
||||||
[(bundle) (move/copy-distribution #f #t)]
|
[(bundle) (move/copy-distribution #f #t)]
|
||||||
[(post-adjust) (void)]
|
[(post-adjust) (post-adjust)]
|
||||||
[(post-adjust--source) (post-adjust-source)]
|
|
||||||
[(make-install-copytree) (make-install-copytree)]
|
[(make-install-copytree) (make-install-copytree)]
|
||||||
[(make-install-destdir-fix) (make-install-destdir-fix)]
|
[(make-install-destdir-fix) (make-install-destdir-fix)]
|
||||||
[else (error (format "unknown operation: ~e" op))]))
|
[else (error (format "unknown operation: ~e" op))]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user