From 717c7fb82f3675417da3b3d00b70abc633bf85e5 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 20 Jul 2013 08:29:33 -0600 Subject: [PATCH] add catalog, source, and Mac OS X instructions to basic README Also, include "stamp.txt" and "collects.tgz" at a build site. original commit: aecf0e60b5b7938a53c165e2c4cf5ddbef552f2d --- pkgs/distro-build/assemble-site.rkt | 7 ++- pkgs/distro-build/doc.txt | 33 +++++++++++-- pkgs/distro-build/drive-clients.rkt | 16 +++++-- pkgs/distro-build/readme.rkt | 72 ++++++++++++++++++++++------- 4 files changed, 103 insertions(+), 25 deletions(-) diff --git a/pkgs/distro-build/assemble-site.rkt b/pkgs/distro-build/assemble-site.rkt index f7978bd..45b197e 100644 --- a/pkgs/distro-build/assemble-site.rkt +++ b/pkgs/distro-build/assemble-site.rkt @@ -33,7 +33,10 @@ (printf "Assembling site as ~a\n" dest-dir) (define (copy dir [build-dir build-dir]) - (make-directory* dest-dir) + (make-directory* (let-values ([(base name dir?) (split-path dir)]) + (if (path? base) + (build-path dest-dir base) + dest-dir))) (printf "Copying ~a\n" (build-path build-dir dir)) (copy-directory/files (build-path build-dir dir) (build-path dest-dir dir) @@ -104,6 +107,8 @@ (define pdf-doc-path (build-path build-dir pdf-doc-dir)) (when (directory-exists? pdf-doc-path) (copy pdf-doc-dir)) +(copy "stamp.txt") +(copy (build-path "origin" "collects.tgz")) (make-download-page (build-path build-dir installers-dir diff --git a/pkgs/distro-build/doc.txt b/pkgs/distro-build/doc.txt index 5badd9d..580dacb 100644 --- a/pkgs/distro-build/doc.txt +++ b/pkgs/distro-build/doc.txt @@ -163,7 +163,7 @@ Site-configuration keywords (where means no spaces, etc.): #:readme --- the content of a "README" file to include in installers, or a function that takes a hash table for a configuration and returns a string; the default is the - `make-readme' function from `distro-build/readme' + `make-readme' function from `distro-build/readme' (see below) #:max-vm --- max number of VMs allowed to run with this machine, counting the machine; defaults to 1 @@ -172,7 +172,8 @@ Site-configuration keywords (where means no spaces, etc.): in the Virtual Box GUI); if provided, the virtual machine is started and stopped on the server as needed - #:platform --- 'windows or 'unix, defaults to 'unix + #:platform --- 'windows, 'macosx, or 'unix; defaults to + `(system-type)' #:configure '( ...) --- arguments to `configure' @@ -203,9 +204,11 @@ Site-configuration keywords (where means no spaces, etc.): installers; the default is determined by the `RELEASE_MODE' makefile variable - #:source? --- if true, then create a source archive (with - pre-build packages), instead of a platform-specific installer; the - default is #f + #:source? --- if true, then create a kernel-source archive + (with pre-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 #f #:site-dest --- destination for completed build, used by the `site' and `snapshot-site' makefile targets; the default is @@ -278,6 +281,26 @@ to `racket/base': Returns a string to identify the current build, normally a combination of the date and a git commit hash. +READMEs +------- + +The `distro-build/readme' library provides functions for constructing +a README file's content. Each function takes a hash table mapping +configuration keywords to values. + + (make-readme config) -> string + config : hash? + Produces basic "README" content, using information about the + distribution and the Racket license. The content is constructed + using `config' keywords such as `#:name', `#:platform', + `#:dist-name', and `#:dist-catalogs', and sometimes `current-stamp'. + + (make-macosx-notes config) -> string + config : hash? + Produces "README" content to tell Mac OS X users how to install a + distirbution folder. This function is used by `make-readme' when + `#:platform' in `config' is 'macosx. + Examples -------- diff --git a/pkgs/distro-build/drive-clients.rkt b/pkgs/distro-build/drive-clients.rkt index e36da4c..ea2ea26 100644 --- a/pkgs/distro-build/drive-clients.rkt +++ b/pkgs/distro-build/drive-clients.rkt @@ -81,6 +81,14 @@ (path->string d) d)) +(define (add-defaults c . l) + (let loop ([c c] [l l]) + (cond + [(null? l) c] + [else (loop (hash-set c (car l) + (hash-ref c (car l) (lambda () (cadr l)))) + (cddr l))]))) + ;; ---------------------------------------- ;; Managing VirtualBox machines @@ -319,7 +327,9 @@ (define readme-txt (let ([rdme (get-opt c '#:readme make-readme)]) (if (string? rdme) rdme - (rdme c)))) + (rdme (add-defaults c + '#:release? default-release? + '#:pkgs (string-split default-pkgs)))))) (make-directory* (build-path "build" "readmes")) (define readme (make-temporary-file "README-~a" @@ -337,8 +347,8 @@ (display-time) (begin0 - ((case (or (get-opt c '#:platform) 'unix) - [(unix) unix-build] + ((case (or (get-opt c '#:platform) (system-type)) + [(unix macosx) unix-build] [else windows-build]) c host port user server repo clean? pull? readme) diff --git a/pkgs/distro-build/readme.rkt b/pkgs/distro-build/readme.rkt index a5b2bfe..9917e38 100644 --- a/pkgs/distro-build/readme.rkt +++ b/pkgs/distro-build/readme.rkt @@ -1,19 +1,52 @@ #lang at-exp racket/base -(require racket/format) +(require racket/format + net/url + (only-in "config.rkt" current-stamp)) -(provide make-readme) +(provide make-readme + make-source-notes + make-macosx-notes) + +(define (maybe-stamp config) + (if (hash-ref config '#:release? #f) + "" + @~a{ (@(current-stamp))})) (define (make-readme config) @~a{ The Racket Programming Language =============================== - This is Racket... + This is the + @|(hash-ref config '#:name "Racket")| + distribution for version @(version)@(maybe-stamp config).@; - More Information - ---------------- + @(if (hash-ref config '#:source? #f) + (string-append "\n" (make-source-notes config) "\n") + "")@; + @(if (and (not (hash-ref config '#:source? #f)) + (eq? (hash-ref config '#:platform (system-type)) 'macosx)) + (string-append "\n" (make-macosx-notes config) "\n") + "")@; + @(let* ([catalogs (filter + (lambda (s) (not (equal? s ""))) + (or (hash-ref config '#:dist-catalogs #f) + (let ([v (hash-ref config '#:dist-base-url #f)]) + (and v + (list (url->string + (combine-url/relative (string->url v) "catalog/"))))) + null))] + [s (if (= 1 (length catalogs)) "" "s")] + [is (if (= 1 (length catalogs)) "is" "are")]) + (if (null? catalogs) + "" + @~a{@"\n"The distribution has been configured so that when you install or + update packages, the package catalog@|s| at@; + @(apply ~a (for/list ([catalog (in-list catalogs)]) + @~a{@"\n" @|catalog|})) + @|is| consulted, first.@"\n"}))@; - Visit us at + Visit http://racket-lang.org/ for more Racket resources. @@ -32,14 +65,21 @@ that you must release the source code for the modified software. See share/COPYING_LESSER.txt for more information.}) -(define macosx-notes - @~a{Install by dragging the enclosing Racket folder to your Applications folder - --- or wherever you like. You can move the Racket folder at any time, but do not - move applications or other files within the folder. If you want to use the - Racket command-line programs, then (optionally) add the path of the "bin" - subdirectory to your PATH environment variable.}) +(define (make-source-notes config) -(define drracket-more-info - @~a{For Racket documentation, use DrRacket's `Help' menu, run the `Racket - Documentation' application (Windows or Mac OS X), or run `raco docs' - from a command line.}) + @~a{This distribution provides source for the Racket run-time system; + for build and installation instructions, see "racket/src/README". + 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.}) + +(define (make-macosx-notes config) + @~a{Install by dragging the enclosing + @|(hash-ref config '#:dist-name "Racket")| v@(version) + folder to your Applications folder --- or wherever you like. You can + move the folder at any time, but do not move applications or other + files within the folder. If you want to use the Racket command-line + programs, then (optionally) add the path of the "bin" subdirectory to + your PATH environment variable.})