Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dlang/installer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e9f717a190f9594e5104036b1427917891bfb30e
Choose a base ref
..
head repository: dlang/installer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1306c5036d50aa9cf767bf3b933edca846a4ae42
Choose a head ref
Showing with 99 additions and 23 deletions.
  1. +23 −0 LICENSE.txt
  2. +3 −0 README.md
  3. +5 −1 create_dmd_release/create_dmd_release.d
  4. +11 −0 script/deploy.sh
  5. +42 −11 script/install.sh
  6. +4 −0 travis.sh
  7. +10 −10 windows/d2-installer.nsi
  8. +1 −1 windows/dmc-installer.nsi
23 changes: 23 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,5 +6,8 @@ This repository hosts scripts to build DMD installers and packages.
To download a ready-built D installer or package, please visit the
[dlang.org downloads page](http://dlang.org/download.html).

To learn more about the install script, please visit the
[`install.sh` documentation](https://dlang.org/install.html).

To report a problem or browse the list of open bugs, please visit the
[bug tracker](http://issues.dlang.org/).
6 changes: 5 additions & 1 deletion create_dmd_release/create_dmd_release.d
Original file line number Diff line number Diff line change
@@ -514,6 +514,8 @@ void buildAll(Bits bits, string branch, bool dmdOnly=false)
run(makecmd~" DOC_OUTPUT_DIR="~origDir~"/docs release");
// put into docs/ folder which gets copied to all other platforms
copyFile("d-tags-release.json", origDir~"/docs/d-tags-release.json");
// copy generated man pages to docs/man which gets copied to all other platforms
copyDir(cloneDir~"/dmd/generated/docs/man", origDir~"/docs/man");
}
}
else version (Windows)
@@ -603,15 +605,17 @@ void createRelease(string branch)
!a.startsWith("images/original/") &&
!a.startsWith("chm/") &&
( a.endsWith(".html") || a.startsWith("css/", "images/", "js/") );
// copy docs from linux build
copyDir(origDir~"/docs", releaseDir~"/dmd2/html/d", a => dlangFilter(a));
version(Windows)
{
if(do32Bit)
copyFile(cloneDir~"/dlang.org/d.chm", releaseBin32Dir~"/d.chm");
}
copyDirVersioned(cloneDir~"/dmd/samples", releaseDir~"/dmd2/samples/d");
copyDirVersioned(cloneDir~"/dmd/docs/man", releaseDir~"/dmd2/man");
copyDirVersioned(cloneDir~"/tools/man", releaseDir~"/dmd2/man");
// copy man pages from linux build
copyDir(origDir~"/docs/man", releaseDir~"/dmd2/man");
makeDir(releaseDir~"/dmd2/html/d/zlib");
copyFile(cloneDir~"/phobos/etc/c/zlib/ChangeLog", releaseDir~"/dmd2/html/d/zlib/ChangeLog");
copyFile(cloneDir~"/phobos/etc/c/zlib/README", releaseDir~"/dmd2/html/d/zlib/README");
11 changes: 11 additions & 0 deletions script/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -uexo pipefail

ROOT=$(dirname $0)

${GPG:-gpg2} --detach-sign install.sh
scp "$ROOT/install.sh" "$ROOT/install.sh.sig" digitalmars.com:/usr/local/www/dlang.org/data/
scp "$ROOT/install.sh" "$ROOT/install.sh.sig" nightlies.dlang.org:/var/www/builds/
aws --profile ddo s3 cp "$ROOT/install.sh" s3://downloads.dlang.org/other/ --acl public-read --cache-control max-age=604800
aws --profile ddo s3 cp "$ROOT/install.sh.sig" s3://downloads.dlang.org/other/ --acl public-read --cache-control max-age=604800
53 changes: 42 additions & 11 deletions script/install.sh
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
# Copyright: Copyright Martin Nowak 2015 -.
# License: Boost License 1.0 (www.boost.org/LICENSE_1_0.txt)
# Authors: Martin Nowak
# Documentation: https://dlang.org/install.html

_() {
set -ueo pipefail
@@ -91,6 +92,7 @@ COMMAND=
COMPILER=dmd
VERBOSITY=1
ROOT=~/dlang
DUB_BIN_PATH=
case $(uname -s) in
Darwin) OS=osx;;
Linux) OS=linux;;
@@ -323,7 +325,19 @@ run_command() {
else
install_compiler "$2"
fi
install_dub

local -r binpath=$(binpath_for_compiler "$2")
if [ -f "$ROOT/$2/$binpath/dub" ]; then
if [[ $("$ROOT/$2/$binpath/dub" --version) =~ ([0-9]+\.[0-9]+\.[0-9]+(-[^, ]+)?) ]]; then
log "Using dub ${BASH_REMATCH[1]} shipped with $2"
else
log "Using dub shipped with $2"
fi
else
DUB_BIN_PATH="${ROOT}/dub"
install_dub
fi

write_env_vars "$2"

if [ "$(basename "$SHELL")" = fish ]; then
@@ -539,26 +553,43 @@ verify() {
fi
}

binpath_for_compiler() {
case $1 in
dmd*)
local suffix
[ $OS = osx ] || suffix=$MODEL
local -r binpath=$OS/bin$suffix
;;

ldc*)
local -r binpath=bin
;;

gdc*)
local -r binpath=bin
;;
esac
echo "$binpath"
}

write_env_vars() {
local -r binpath=$(binpath_for_compiler "$1")
case $1 in
dmd*)
local suffix
[ $OS = osx ] || suffix=$MODEL
local binpath=$OS/bin$suffix
local libpath=$OS/lib$suffix
local dc=dmd
local dmd=dmd
;;

ldc*)
local binpath=bin
local libpath=lib
local dc=ldc2
local dmd=ldmd2
;;

gdc*)
local binpath=bin
if [ -d "$ROOT/$1/lib$MODEL" ]; then
local libpath=lib$MODEL
else
@@ -592,9 +623,9 @@ _OLD_D_LIBRARY_PATH="\${LIBRARY_PATH:-}"
_OLD_D_LD_LIBRARY_PATH="\${LD_LIBRARY_PATH:-}"
_OLD_D_PS1="\${PS1:-}"
export PATH="$ROOT/dub:$ROOT/$1/$binpath:\${PATH:-}"
export LIBRARY_PATH="$ROOT/$1/$libpath:\${LIBRARY_PATH:-}"
export LD_LIBRARY_PATH="$ROOT/$1/$libpath:\${LD_LIBRARY_PATH:-}"
export PATH="${DUB_BIN_PATH}${DUB_BIN_PATH:+:}$ROOT/$1/$binpath\${PATH:+:}\${PATH:-}"
export LIBRARY_PATH="$ROOT/$1/$libpath\${LIBRARY_PATH:+:}\${LIBRARY_PATH:-}"
export LD_LIBRARY_PATH="$ROOT/$1/$libpath\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH:-}"
export DMD=$dmd
export DC=$dc
export PS1="($1)\${PS1:-}"
@@ -624,9 +655,9 @@ set -g _OLD_D_LIBRARY_PATH \$LIBRARY_PATH
set -g _OLD_D_LD_LIBRARY_PATH \$LD_LIBRARY_PATH
set -g _OLD_D_PS1 \$PS1
set -gx PATH "$ROOT/dub" "$ROOT/$1/$binpath" \$PATH
set -gx LIBRARY_PATH "$ROOT/$1/$libpath" \$LIBRARY_PATH
set -gx LD_LIBRARY_PATH "$ROOT/$1/$libpath" \$LD_LIBRARY_PATH
set -gx PATH ${DUB_BIN_PATH:+\'}${DUB_BIN_PATH}${DUB_BIN_PATH:+\' }'$ROOT/$1/$binpath' \$PATH
set -gx LIBRARY_PATH '$ROOT/$1/$libpath' \$LIBRARY_PATH
set -gx LD_LIBRARY_PATH '$ROOT/$1/$libpath' \$LD_LIBRARY_PATH
set -gx DMD $dmd
set -gx DC $dc
functions -c fish_prompt _old_d_fish_prompt
@@ -665,7 +696,7 @@ install_dub() {
return
fi
local url=http://code.dlang.org/download/LATEST
logV "Determing latest dub version ($url)."
logV "Determining latest dub version ($url)."
dub="dub-$(fetch $url)"
if [ -d "$ROOT/$dub" ]; then
log "$dub already installed"
4 changes: 4 additions & 0 deletions travis.sh
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ set -uexo pipefail
compilers=(
dmd-2.069.2
dmd-2.071.2
dmd-2.077.1
dmd-2016-10-19
dmd-master-2016-10-24
ldc-1.4.0
@@ -13,6 +14,7 @@ compilers=(
versions=(
'DMD64 D Compiler v2.069.2'
'DMD64 D Compiler v2.071.2'
'DMD64 D Compiler v2.077.1'
'DMD64 D Compiler v2.073.0-master-878b882'
'DMD64 D Compiler v2.073.0-master-ab9d712'
'LDC - the LLVM D compiler (1.4.0):'
@@ -45,7 +47,9 @@ do

source $(./script/install.sh $compiler --activate)
deactivate

source $(./script/install.sh $compiler -a)
command -v dub >/dev/null 2>&1 || { echo >&2 "DUB hasn't been installed."; exit 1; }
deactivate

./script/install.sh uninstall $compiler
20 changes: 10 additions & 10 deletions windows/d2-installer.nsi
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@
; Routinely Update
; ----------------
; Visual D
!define VersionVisualD "0.45.1"
!define VersionVisualD "0.46.0"

; DMC
!define VersionDMC "857"
@@ -155,7 +155,7 @@ SetCompressor /SOLID lzma
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "digital_mars_d_compiler_installer") ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONSTOP "An instance of DMD installer is already running"
MessageBox MB_OK|MB_ICONSTOP "An instance of DMD installer is already running" /SD IDOK
Abort
!macroend

@@ -171,7 +171,7 @@ SetCompressor /SOLID lzma
!endif

; failed
MessageBox MB_OK|MB_ICONEXCLAMATION "Could not download ${Filename}$\r$\n$\r$\n${Url}"
MessageBox MB_OK|MB_ICONEXCLAMATION "Could not download ${Filename}$\r$\n$\r$\n${Url}" /SD IDOK

Goto dandr_done_${Filename}

@@ -290,7 +290,6 @@ SectionGroup /e "D2"
WriteRegDWORD HKLM "${ARP}" "NoModify" 1
WriteRegDWORD HKLM "${ARP}" "NoRepair" 1
WriteUninstaller "uninstall.exe"

SectionEnd


@@ -458,20 +457,21 @@ Function .onInit
StrCmp $R5 "" done_uninst_prev
MessageBox MB_OKCANCEL|MB_ICONQUESTION \
"A previous DMD is installed on your system$\n$\nPress 'OK' to replace by ${DName} ${Version2}" \
IDOK +2
/SD IDOK IDOK +2
Abort
ClearErrors
; Run uninstaller fron installed directory
ExecWait '$R5 /S _?=$R6' $K
; Exit if uninstaller return an error
IfErrors 0 +3
MessageBox MB_OK|MB_ICONSTOP \
"An error occurred when removing DMD$\n$\nRun '${InstallerFilename} /f' to force install ${DName} ${Version2}"
"An error occurred when removing DMD$\n$\nRun '${InstallerFilename} /f' to force install ${DName} ${Version2}" \
/SD IDOK
Abort
; Remove in background the remaining uninstaller program itself
Sleep 1000
Exec '$R5 /S'
; MessageBox MB_OK|MB_ICONINFORMATION "Previous DMD uninstalled"
; MessageBox MB_OK|MB_ICONINFORMATION "Previous DMD uninstalled" /SD IDOK

done_uninst_prev:
; End of removing previous dmd installation section
@@ -485,7 +485,7 @@ Function .onInit
ReadRegStr $J HKLM "${ARP}" "DisplayVersion"
MessageBox MB_OKCANCEL|MB_ICONQUESTION \
"$I v$J is installed on your system$\n$\nPress 'OK' to replace by ${DName} ${Version2}" \
IDOK uninst
/SD IDOK IDOK uninst
Abort

uninst:
@@ -497,7 +497,8 @@ Function .onInit
; Exit if uninstaller return an error
IfErrors 0 +3
MessageBox MB_OK|MB_ICONSTOP \
"An error occurred when removing $I v$J$\n$\nRun '${InstallerFilename} /f' to force install ${DName} ${Version2}"
"An error occurred when removing $I v$J$\n$\nRun '${InstallerFilename} /f' to force install ${DName} ${Version2}" \
/SD IDOK
Abort
; Exit if uninstaller is cancelled by user
StrCmp $K 0 +2
@@ -506,7 +507,6 @@ Function .onInit
Exec '$R0 /IC False /S'

done_uninst:

FunctionEnd


2 changes: 1 addition & 1 deletion windows/dmc-installer.nsi
Original file line number Diff line number Diff line change
@@ -199,7 +199,7 @@ Function .onInit
ReadRegStr $I HKLM "${ARP}" "DisplayName"
ReadRegStr $J HKLM "${ARP}" "DisplayVersion"
MessageBox MB_OKCANCEL|MB_ICONQUESTION \
"$I v$J is installed on your system$\n$\nPress 'OK' to replace by ${DmcName} ${VersionDmc}" \
"$I v$J is installed on your system$\n$\nPress 'OK' to replace it with ${DmcName} ${VersionDmc}" \
IDOK uninst
Abort