distro-build: add "versionless" option

Versionless mode avoids putting a version number in an installer's
name or in installation paths.

original commit: 133d7a3c41208171a3858a62cc4aa419bdb2ff41
This commit is contained in:
Matthew Flatt 2014-06-23 17:15:20 +01:00
parent a5e0d18a99
commit 8d89a97df6
6 changed files with 41 additions and 13 deletions

View File

@ -257,10 +257,15 @@ Site-configuration keywords (where <string*> means no spaces, etc.):
the value of `#:source?'
#:source-pkgs? <boolean> --- if true, then packages are included in
th installer/archive only in source form; a true value works best
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?'
#:versionless? <boolean> --- if true, avoids including the Racket
version number in an installer's name or in the installation path;
the default is determined by the `VERSIONLESS_MODE' makefile
variable
#:mac-pkg? <boolean> --- if true, creates a ".pkg" for Mac OS X (in
single-file format) instead of a ".dmg"; the default is #f

View File

@ -45,7 +45,7 @@
makensis
#:extension-registers [extregs null]
#:start-menus [startmenus null]
#:release [release? #t]
#:versionless [versionless? #t]
#:simple? [simple? #f]
#:auto-launch [auto-launch #f])
(define distdir (regexp-replace* #rx" " distname "-"))
@ -77,8 +77,8 @@
;; Full name for the package, and a short name for installer texts
!define RKTHumanName "@|distname| v@|version| (@|winplatform|)"
!define RKTShortName "@|distname|"
!define RKTStartName "@|distname|@(if release? "" @~a{ v@|version|})"
!define RKTDirName "@|distdir|@(if release? "" @~a{-@|version|})"
!define RKTStartName "@|distname|@(if versionless? "" @~a{ v@|version|})"
!define RKTDirName "@|distdir|@(if versionless? "" @~a{-@|version|})"
!define RKTRegName "@|distdir|-@|winplatform|-@|version|"
!define RKTProgFiles "$PROGRAMFILES@(if (equal? winplatform "x86_64") "64" "")"
@(if simple? @~a{!define SimpleInstaller} "")
@ -406,7 +406,7 @@ SectionEnd
(parameterize ([current-directory "bundle"])
(system* makensis "/V3" "installer.nsi")))
(define (installer-exe human-name base-name release? dist-suffix readme)
(define (installer-exe human-name base-name versionless? dist-suffix readme)
(define makensis (or (find-executable-path "makensis.exe")
(try-exe "c:\\Program Files\\NSIS\\makensis.exe")
(try-exe "c:\\Program Files (x86)\\NSIS\\makensis.exe")
@ -426,7 +426,7 @@ SectionEnd
(version)
platform
makensis
#:release release?
#:versionless versionless?
#:extension-registers (get-extreg "bundle/racket")
#:start-menus (get-startmenu "bundle/racket")
#:auto-launch (get-auto-launch "bundle/racket"))

View File

@ -15,6 +15,7 @@
(define release? #f)
(define source? #f)
(define versionless? #f)
(define mac-pkg? #f)
(define upload-to #f)
(define upload-desc "")
@ -27,6 +28,8 @@
(set! release? #t)]
[("--source") "Create a source installer"
(set! source? #t)]
[("--versionless") "Avoid version number in names and paths"
(set! versionless? #t)]
[("--mac-pkg") "Create a \".pkg\" installer on Mac OS X"
(set! mac-pkg? #t)]
[("--upload") url "Upload installer"
@ -41,8 +44,11 @@
(human-name base-name dir-name dist-suffix sign-identity)
(values human-name
(format "~a v~a" human-name (version))
(format "~a-~a" base-name (version))
(if (and release? (not source?))
(if versionless?
base-name
(format "~a-~a" base-name (version)))
(if (or (and release? (not source?))
versionless?)
dir-name
(format "~a-~a" dir-name (version)))
(if (string=? dist-suffix "")
@ -67,10 +73,16 @@
(case (system-type)
[(unix) (installer-sh human-name base-name dir-name release? dist-suffix readme)]
[(macosx) (if mac-pkg?
(installer-pkg (if release? short-human-name human-name)
(installer-pkg (if (or release? versionless?)
short-human-name
human-name)
base-name dist-suffix readme sign-identity)
(installer-dmg human-name base-name dist-suffix readme sign-identity))]
[(windows) (installer-exe short-human-name base-name release? dist-suffix readme)])))
(installer-dmg (if versionless?
short-human-name
human-name)
base-name dist-suffix readme sign-identity))]
[(windows) (installer-exe short-human-name base-name (or release? versionless?)
dist-suffix readme)])))
(call-with-output-file*
(build-path "bundle" "installer.txt")

View File

@ -145,6 +145,7 @@
[(#:source?) (boolean? val)]
[(#:source-runtime?) (boolean? val)]
[(#:source-pkgs?) (boolean? val)]
[(#:versionless?) (boolean? val)]
[(#:mac-pkg?) (boolean? val)]
[(#:site-dest) (path-string? val)]
[(#:site-help) (hash? val)]

View File

@ -25,6 +25,7 @@
(define default-release? #f)
(define default-source? #f)
(define default-versionless? #f)
(define default-clean? #f)
(define dry-run #f)
@ -40,6 +41,8 @@
(set! default-release? #t)]
[("--source") "Create source installers"
(set! default-source? #t)]
[("--versionless") "Avoid version number in names and paths"
(set! default-versionless? #t)]
[("--clean") "Erase client directories before building"
(set! default-clean? #t)]
[("--dry-run") mode
@ -239,6 +242,7 @@
(define sign-identity (get-opt c '#:sign-identity ""))
(define release? (get-opt c '#:release? default-release?))
(define source? (get-opt c '#:source? default-source?))
(define versionless? (get-opt c '#:versionless? default-versionless?))
(define source-pkgs? (get-opt c '#:source-pkgs? source?))
(define source-runtime? (get-opt c '#:source-runtime? source?))
(define mac-pkg? (get-opt c '#:mac-pkg? #f))
@ -263,6 +267,7 @@
" BUILD_STAMP=" (q build-stamp)
" RELEASE_MODE=" (if release? "--release" (q ""))
" SOURCE_MODE=" (if source-runtime? "--source" (q ""))
" VERSIONLESS_MODE=" (if versionless? "--versionless" (q ""))
" PKG_SOURCE_MODE=" (if source-pkgs?
(q "--source --no-setup")
(q ""))
@ -340,6 +345,7 @@
(rdme (add-defaults c
'#:release? default-release?
'#:source? default-source?
'#:versionless? default-versionless?
'#:pkgs (string-split default-pkgs)
'#:install-name (if (get-opt c '#:release? default-release?)
""

View File

@ -105,18 +105,22 @@
@~a{The distribution includes any pre-installed packages in source form.}]))
(define (make-macosx-notes config)
(define vers-suffix
(if (hash-ref config '#:versionless? #f)
""
@~a{ v@(version)}))
(if (hash-ref config '#:mac-pkg? #f)
@~a{The installation directory is
/Applications/@(string-append
(hash-ref config '#:dist-name "Racket")
(if (hash-ref config '#:release? #f)
""
(string-append " v" (version))))
vers-suffix))
The installer also adjusts "/etc/paths.d/racket" to point to that
directory's "bin" directory, which adjusts the default PATH
environment variable for all users.}
@~a{Install by dragging the enclosing
@|(hash-ref config '#:dist-name "Racket")| v@(version)
@|(hash-ref config '#:dist-name "Racket")|@|vers-suffix|
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