File: semaphore-ci.sh

package info (click to toggle)
dub 1.16.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,168 kB
  • sloc: sh: 1,577; xml: 37; makefile: 17; ansic: 11
file content (39 lines) | stat: -rwxr-xr-x 1,517 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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 nonet tests is done only for > 2.072
    export FRONTEND=2.072

    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