Newer
Older
dub_jkp / semaphore-ci.sh
  1. #!/bin/bash
  2.  
  3. set -euo pipefail
  4. set -x
  5.  
  6. if [ "${D_VERSION:-dmd}" == "gdc" ] ; then
  7.  
  8. # Use the dub-updating fork of the installer script until https://github.com/dlang/installer/pull/301 is merged
  9. wget https://raw.githubusercontent.com/wilzbach/installer-dub/master/script/install.sh -O install.dub.sh
  10. bash install.dub.sh -a dub
  11. dub_path_activate="$(find $HOME/dlang/*/activate | head -1)"
  12. rm "${dub_path_activate}"
  13. dub_path="$(dirname "$dub_path_activate")"
  14. sudo ln -s "${dub_path}/dub" /usr/bin/dub
  15.  
  16. export DMD=gdmd
  17. export DC=gdc
  18. # It's technically ~"2.076", but Ternary doesn't seem to have been ported and Vibe.d seems to depend on this.
  19. # Ternary was added in 2.072: https://dlang.org/phobos/std_typecons.html#.Ternary
  20. # However, the nonet tests is done only for > 2.072
  21. export FRONTEND=2.072
  22.  
  23. sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
  24. sudo apt-get update
  25. sudo apt-get install -y gdc-8
  26. # fetch the dmd-like wrapper
  27. sudo wget https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -O /usr/bin/gdmd
  28. sudo chmod +x /usr/bin/gdmd
  29. # DUB requires gdmd
  30. sudo ln -s /usr/bin/gdc-8 /usr/bin/gdc
  31. # fake install script and create a fake 'activate' script
  32. mkdir -p ~/dlang/gdc-8
  33. echo "deactivate(){ echo;}" > ~/dlang/gdc-8/activate
  34.  
  35. else
  36. 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"
  37. fi
  38.  
  39. ./travis-ci.sh