diff --git a/collects/scribblings/raco/setup.scrbl b/collects/scribblings/raco/setup.scrbl index 50625cd94a..b6bf5410f4 100644 --- a/collects/scribblings/raco/setup.scrbl +++ b/collects/scribblings/raco/setup.scrbl @@ -411,6 +411,55 @@ Optional @filepath{info.rkt} fields trigger additional actions by @section[#:tag "setup-plt-plt"]{API for Installation} +@defmodule[setup/setup] + +@defproc[(setup [#:file file (or/c #f path-string?) #f] + [#:collections collections (or/c #f (listof (listof path-string?))) #f] + [#:planet-specs planet-specs (or/c #f + (listof (list/c string? + string? + exact-nonnegative-integer? + exact-nonnegative-integer?))) + #f] + [#:make-user? make-user? any/c #t] + [#:make-docs? make-docs? any/c #t] + [#:clean? clean? any/c #f] + [#:jobs jobs exact-nonnegative-integer? #f] + [#:get-target-dir get-target-dir (or/c #f (-> path-string?)) #f]) + void?]{ +Runs @exec{raco setup} with various options: + +@itemlist[ + + @item{@racket[file] --- if not @racket[#f], installs @racket[file] as + a @filepath{.plt} archive.} + + @item{@racket[collections] --- if not @racket[#f], constrains setup to + the named collections, along with @racket[planet-specs], if any} + + @item{@racket[planet-spec] --- if not @racket[#f], constrains setup to + the named @|PLaneT| packages, along with @racket[collections], if any} + + @item{@racket[make-docs?] --- if @racket[#f], disables any + documentation-specific setup actions} + + @item{@racket[make-user?] --- if @racket[#f], disables any + user-specific setup actions} + + @item{@racket[clean?] --- if true, enables cleaning mode instead of setup mode} + + @item{@racket[jobs] --- if not @racket[#f], determines the maximum number of parallel + tasks used for setup} + + @item{@racket[get-target-dir] --- if not @racket[#f], treated as a + value for @sigelem[setup-option^ current-target-directory-getter]} + +]} + +@subsection{@exec{raco setup} Unit} + +@defmodule[setup/setup-unit] + The @racketmodname[setup/setup-unit] library provides @exec{raco setup} in unit form. The associated @racket[setup/option-sig] and @racket[setup/option-unit] libraries provides the interface for @@ -434,10 +483,6 @@ initialized between them, e.g.: _...) ] -@subsection{@exec{raco setup} Unit} - -@defmodule[setup/setup-unit] - @defthing[setup@ unit?]{ Imports @@ -573,7 +618,7 @@ form.} documentation is built, then suitable documentation start pages, search pages, and master index pages are re-built. @defaults[@racket[#t]]} -@defparam[current-target-directory-getter thunk (-> . path-string?)]{ +@defparam[current-target-directory-getter thunk (-> path-string?)]{ A thunk that returns the target directory for unpacking a relative @filepath{.plt} archive; when unpacking an archive, either this or the procedure in @racket[current-target-plt-directory-getter] will diff --git a/collects/setup/plt-single-installer.rkt b/collects/setup/plt-single-installer.rkt index 780820de48..3b8a3184b7 100644 --- a/collects/setup/plt-single-installer.rkt +++ b/collects/setup/plt-single-installer.rkt @@ -1,17 +1,6 @@ #lang racket/base (require racket/unit - - ;; All the rest are to get the imports for setup@: - "option-sig.rkt" - "setup-unit.rkt" - "option-unit.rkt" - launcher/launcher-sig - launcher/launcher-unit - dynext/dynext-sig - dynext/dynext-unit - compiler/sig - compiler/option-unit - compiler/compiler-unit) + "setup.rkt") (provide run-single-installer install-planet-package clean-planet-package reindex-user-documentation) @@ -46,50 +35,11 @@ (define thd (thread (lambda () - (define-unit set-options@ - (import setup-option^ compiler^) - (export) - ;; >>>>>>>>>>>>>> <<<<<<<<<<<<<<< - ;; Here's where we tell setup the archive file: - (unless (or clean? (not file)) - (archives (list file)) - (when planet-spec - (archive-implies-reindex #f))) - - ;; Here's where we make get a directory: - (current-target-directory-getter - get-target-dir) - - (when planet-spec - (specific-planet-dirs (list planet-spec))) - - (when collections - (specific-collections collections)) - - (when clean? - (clean #t) - (make-zo #f) - (make-launchers #f) - (make-info-domain #t) - (call-install #f) - (make-docs #f)) - - (setup-program-name "raco setup") - - (parallel-workers 1)) - (invoke-unit - (compound-unit/infer - (import) - (export) - (link launcher@ - dynext:compile@ - dynext:link@ - dynext:file@ - compiler:option@ - compiler@ - setup:option@ - set-options@ - setup@)))))) + (setup #:jobs 1 + #:file file + #:get-target-dir get-target-dir + #:planet-spec (and planet-spec (list planet-spec)) + #:collections collections)))) (dynamic-wind void (lambda () diff --git a/collects/setup/setup.rkt b/collects/setup/setup.rkt new file mode 100644 index 0000000000..1d1f5c585b --- /dev/null +++ b/collects/setup/setup.rkt @@ -0,0 +1,76 @@ +#lang racket/base +(require racket/unit + + ;; All the rest are to get the imports for setup@: + "option-sig.rkt" + "setup-unit.rkt" + "option-unit.rkt" + launcher/launcher-sig + launcher/launcher-unit + dynext/dynext-sig + dynext/dynext-unit + compiler/sig + compiler/option-unit + compiler/compiler-unit) + +(provide setup) + +(define (setup #:file [file #f] + #:get-target-dir [get-target-dir #f] + #:planet-specs [planet-specs #f] + #:collections [collections #f] + #:make-docs? [make-docs? #t] + #:make-user? [make-user? #t] + #:clean? [clean? #f] + #:jobs [parallel #f]) + (define-unit set-options@ + (import setup-option^ compiler^) + (export) + ;; >>>>>>>>>>>>>> <<<<<<<<<<<<<<< + ;; Here's where we tell setup the archive file: + (unless (or clean? (not file)) + (archives (list file)) + (when planet-specs + (archive-implies-reindex #f))) + + ;; Here's where we make get a directory: + (current-target-directory-getter + get-target-dir) + + (when planet-specs + (specific-planet-dirs planet-specs)) + + (when collections + (specific-collections collections)) + + (unless make-user? + (make-user #f)) + + (unless make-docs? + (make-docs #f)) + + (when clean? + (clean #t) + (make-zo #f) + (make-launchers #f) + (make-info-domain #t) + (call-install #f) + (make-docs #f)) + + (setup-program-name "raco setup") + + (when parallel + (parallel-workers parallel))) + (invoke-unit + (compound-unit/infer + (import) + (export) + (link launcher@ + dynext:compile@ + dynext:link@ + dynext:file@ + compiler:option@ + compiler@ + setup:option@ + set-options@ + setup@))))