Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GDC from Semaphore and upgrade the minimally required host compiler
- Loading branch information
Showing
2 changed files
with
52 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
set -x | ||
|
||
if [ "${D_VERSION:-dmd}" == "gdc" ] ; then | ||
|
||
# Use the dub-updating fork of the installer script until https://github.com/dlang/installer/pull/301 is merged | ||
wget https://raw.githubusercontent.com/wilzbach/installer-dub/master/script/install.sh -O install.dub.sh | ||
bash install.dub.sh -a dub | ||
dub_path_activate="$(find $HOME/dlang/*/activate | head -1)" | ||
rm "${dub_path_activate}" | ||
dub_path="$(dirname "$dub_path_activate")" | ||
sudo ln -s "${dub_path}/dub" /usr/bin/dub | ||
|
||
export DMD=gdmd | ||
export DC=gdc | ||
# It's technically ~"2.076", but Ternary doesn't seem to have been ported and Vibe.d seems to depend on this. | ||
# Ternary was added in 2.072: https://dlang.org/phobos/std_typecons.html#.Ternary | ||
# However, the respective tests (`test/fetchzip.sh.min_frontend`, `test/issue1416-maven-repo-pkg-supplier.sh.min_frontend`) only require 2.076 as .min_frontend | ||
export FRONTEND=2.075 | ||
|
||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | ||
sudo apt-get update | ||
sudo apt-get install -y gdc-8 | ||
# fetch the dmd-like wrapper | ||
sudo wget https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -O /usr/bin/gdmd | ||
sudo chmod +x /usr/bin/gdmd | ||
# DUB requires gdmd | ||
sudo ln -s /usr/bin/gdc-8 /usr/bin/gdc | ||
# fake install script and create a fake 'activate' script | ||
mkdir -p ~/dlang/gdc-8 | ||
echo "deactivate(){ echo;}" > ~/dlang/gdc-8/activate | ||
|
||
else | ||
curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 1 --retry-max-time 60 https://dlang.org/install.sh | bash -s "$D_VERSION" | ||
fi | ||
|
||
./travis-ci.sh |