9.3 API for Installation

► |  | raco: Racket Command-Line Tools

1 | raco make: Compiling Source to Bytecode
2 | raco link: Library Collection Links
3 | raco exe: Creating Stand-Alone Executables
4 | raco distribute: Sharing Stand-Alone Executables
5 | raco pack: Packing Library Collections
6 | raco unpack: Unpacking Library Collections
7 | raco planet: Automatic Package Distribution
8 | raco pkg: Package Management
9 | raco setup: Installation Management
10 | raco decompile: Decompiling Bytecode
11 | raco demod: Demodularizing Programs
12 | raco ctool: Working with C Code
13 | raco test: Run tests
14 | raco docs: Documentation Search
15 | raco expand: Macro Expansion
16 | raco scribble: Building Documentation
17 | Adding a raco Command

▼ | 9 | raco setup: Installation Management

9.1 | Running raco setup
9.2 | "info.rkt" File Format
9.3 | API for Installation
9.4 | API for Installing ".plt" Archives
9.5 | API for Finding Installation Directories
9.6 | API for Reading "info.rkt" Files
9.7 | API for Relative Paths
9.8 | API for Cross-References for Installed Manuals

► | 9.3 | API for Installation

9.3.1 | raco setup Unit
9.3.2 | Options Unit
9.3.3 | Options Signature

On this page:

setup
9.3.1`` raco setup Unit
setup@
9.3.2`` Options Unit
setup: option@
9.3.3`` Options Signature
setup-option^
setup-program-name
verbose
make-verbose
compiler-verbose
clean
compile-mode
make-zo
make-info-domain
make-launchers
make-docs
make-user
make-planet
avoid-main-installation
call-install
call-post-install
pause-on-errors
parallel-workers
force-unpacks
specific-collections
specific-planet-dirs
archives
archive-implies-reindex
current-target-directory-getter
current-target-plt-directory-getter

top ← prev up next →

#### 9.3`` API for Installation

(require setup/setup)

> > procedure
> > (setup | [ | #:file file |  |  |  |
> > |  | #:collections collections |  |  |  |
> > |  | #:planet-specs planet-specs |  |  |  |
> > |  | #:make-user? make-user? |  |  |  |
> > |  | #:make-docs? make-docs? |  |  |  |
> > |  | #:clean? clean? |  |  |  |
> > |  | #:jobs jobs |  |  |  |
> > |  | #:get-target-dir get-target-dir]) |  | → |  | void?
> file : (or/c #f path-string?) = #f
> collections : (or/c #f (listof (listof path-string?))) = #f
> | planet-specs |  | : |  |
> (or/c #f
> (listof (list/c string?
> string?
> exact-nonnegative-integer?
> exact-nonnegative-integer?)))
> |  |  | = |  | #f
> make-user? : any/c = #t
> make-docs? : any/c = #t
> clean? : any/c = #f
> jobs : exact-nonnegative-integer? = #f
> get-target-dir : (or/c #f (-> path-string?)) = #f

Runs raco setup with various options:

- file — if not #f, installs file as a ".plt" archive.

- collections — if not #f, constrains setup to the named collections, along with planet-specs, if any

- planet-spec — if not #f, constrains setup to the named PLaneT packages, along with collections, if any

- make-docs? — if #f, disables any documentation-specific setup actions

- make-user? — if #f, disables any user-specific setup actions

- clean? — if true, enables cleaning mode instead of setup mode

- jobs — if not #f, determines the maximum number of parallel tasks used for setup

- get-target-dir — if not #f, treated as a value for current-target-directory-getter

##### 9.3.1`` raco setup Unit

(require setup/setup-unit)

The setup/setup-unit library provides raco setup in unit form. The associated setup/option-sig and setup/option-unit libraries provides the interface for setting options for the run of raco setup.

For example, to unpack a single ".plt" archive "x.plt", set the archives parameter to (list "x.plt") and leave specific-collections as null.

Link the options and setup units so that your option-setting code is initialized between them, e.g.:

> (compound-unit
> ...
> (link ...
> [((OPTIONS : setup-option^)) setup:option@]
> [() my-init-options@ OPTIONS]
> [() setup@ OPTIONS ...])
> ...)

> value setup@ : unit?

Imports

- setup-option^

- compiler^

- compiler:option^

- launcher^

- dynext:file^

and exports nothing. Invoking setup@ starts the setup process.

##### 9.3.2`` Options Unit

(require setup/option-unit)

> value setup:option@ : unit?

Imports nothing and exports setup-option^.

##### 9.3.3`` Options Signature

(require setup/option-sig)

> signature setup-option^ : signature

Provides parameters used to control raco setup in unit form.

> > parameter (setup-program-name) → string?
> > (setup-program-name name) → void?
> > name : string?

> The prefix used when printing status messages. The default is "raco setup".

> > parameter (verbose) → boolean?
> > (verbose on?) → void?
> > on? : any/c

> If on, prints message from make to stderr. The default is #f.

> > parameter (make-verbose) → boolean?
> > (make-verbose on?) → void?
> > on? : any/c

> If on, verbose make. The default is #f.

> > parameter (compiler-verbose) → boolean?
> > (compiler-verbose on?) → void?
> > on? : any/c

> If on, verbose compiler. The default is #f.

> > parameter (clean) → boolean?
> > (clean on?) → void?
> > on? : any/c

> If on, delete ".zo" and ".so"/".dll"/".dylib" files in the specified collections. The default is #f.

> > parameter (compile-mode) → (or/c path? false/c)
> > (compile-mode path) → void?
> > path : (or/c path? false/c)

> If a path is given, use a ".zo" compiler other than plain compile, and build to (build-path "compiled" (compile-mode)). The default is #f.

> > parameter (make-zo) → boolean?
> > (make-zo on?) → void?
> > on? : any/c

> If on, compile ".zo". The default is #t.

> > parameter (make-info-domain) → boolean?
> > (make-info-domain on?) → void?
> > on? : any/c

> If on, update "info-domain/compiled/cache.rkt" for each collection path. The default is #t.

> > parameter (make-launchers) → boolean?
> > (make-launchers on?) → void?
> > on? : any/c

> If on, make collection "info.rkt"-specified launchers. The default is #t.

> > parameter (make-docs) → boolean?
> > (make-docs on?) → void?
> > on? : any/c

> If on, build documentation. The default is #t.

> > parameter (make-user) → boolean?
> > (make-user on?) → void?
> > on? : any/c

> If on, build the user-specific collection tree. The default is #t.

> > parameter (make-planet) → boolean?
> > (make-planet on?) → void?
> > on? : any/c

> If on, build the planet cache. The default is #t.

> > parameter (avoid-main-installation) → boolean?
> > (avoid-main-installation on?) → void?
> > on? : any/c

> If on, avoid building bytecode in the main installation tree when building other bytecode (e.g., in a user-specific collection). The default is #f.

> > parameter (call-install) → boolean?
> > (call-install on?) → void?
> > on? : any/c

> If on, call collection "info.rkt"-specified setup code. The default is #t.

> > parameter (call-post-install) → boolean?
> > (call-post-install on?) → void?
> > on? : any/c

> If on, call collection "info.rkt"-specified post-install code. The default is #t.

> > parameter (pause-on-errors) → boolean?
> > (pause-on-errors on?) → void?
> > on? : any/c

> If on, in the event of an error, prints a summary error and waits for stdin input before terminating. The default is #f.

> > parameter (parallel-workers) → exact-nonnegative-integer?
> > (parallel-workers num) → void?
> > num : exact-nonnegative-integer?

> Determines the number of places to use for compiling bytecode and for building the documentation. The default is (min (processor-count) 8).

> > parameter (force-unpacks) → boolean?
> > (force-unpacks on?) → void?
> > on? : any/c

> If on, ignore version and already-installed errors when unpacking a ".plt" archive. The default is #f.

> > parameter (specific-collections) → (listof (listof path-string?))
> > (specific-collections colls) → void?
> > colls : (listof (listof path-string?))

> A list of collections to set up; the empty list means set-up all collections if the archives list and specific-planet-dirs is also '(). The default is '().

> > parameter (specific-planet-dirs)
> > | → |  |
> > (listof (list/c string?
> > string?
> > exact-nonnegative-integer?
> > exact-nonnegative-integer?))
> > (specific-planet-dirs dir) → void?
> > | dir |  | : |  |
> > (listof (list/c string?
> > string?
> > exact-nonnegative-integer?
> > exact-nonnegative-integer?))

> A list of planet package version specs to set up; the empty list means to set-up all planet collections if the archives list and specific-collections is also '(). The default is '().

> > parameter (archives) → (listof path-string?)
> > (archives arch) → void?
> > arch : (listof path-string?)

> A list of ".plt" archives to unpack; any collections specified by the archives are set-up in addition to the collections listed in specific-collections. The default is null.

> > parameter (archive-implies-reindex) → boolean?
> > (archive-implies-reindex on?) → void?
> > on? : any/c

> If on, when archives has a non-empty list of packages, if any documentation is built, then suitable documentation start pages, search pages, and master index pages are re-built. The default is #t.

> > parameter (current-target-directory-getter) → (-> path-string?)
> > (current-target-directory-getter thunk) → void?
> > thunk : (-> path-string?)

> A thunk that returns the target directory for unpacking a relative ".plt" archive; when unpacking an archive, either this or the procedure in current-target-plt-directory-getter will be called. The default is current-directory.

> > parameter (current-target-plt-directory-getter)
> > | → |  |
> > (path-string?
> > path-string?
> > (listof path-string?) . -> . path-string?)
> > (current-target-plt-directory-getter proc) → void?
> > | proc |  | : |  |
> > (path-string?
> > path-string?
> > (listof path-string?) . -> . path-string?)

> A procedure that takes a preferred path, a path to the parent of the main "collects" directory, and a list of path choices; it returns a path for a "plt-relative" install; when unpacking an archive, either this or the procedure in current-target-directory-getter will be called, and in the former case, this procedure may be called multiple times. The default is (lambda (preferred main-parent-dir choices) preferred).

top ← prev up next →