|  | 
|  | 1 | +# This Travis job script has been generated by a script via | 
|  | 2 | +# | 
|  | 3 | +#   haskell-ci 'travis' 'arrayfire.cabal' | 
|  | 4 | +# | 
|  | 5 | +# For more information, see https://github.com/haskell-CI/haskell-ci | 
|  | 6 | +# | 
|  | 7 | +# version: 0.3.20190814 | 
|  | 8 | +# | 
|  | 9 | +language: c | 
|  | 10 | +dist: xenial | 
|  | 11 | +sudo: required | 
|  | 12 | +git: | 
|  | 13 | +  # whether to recursively clone submodules | 
|  | 14 | +  submodules: false | 
|  | 15 | +cache: | 
|  | 16 | +  directories: | 
|  | 17 | +    - $HOME/.cabal/packages | 
|  | 18 | +    - $HOME/.cabal/store | 
|  | 19 | +before_cache: | 
|  | 20 | +  - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log | 
|  | 21 | +  # remove files that are regenerated by 'cabal update' | 
|  | 22 | +  - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.* | 
|  | 23 | +  - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json | 
|  | 24 | +  - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache | 
|  | 25 | +  - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar | 
|  | 26 | +  - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx | 
|  | 27 | +  - rm -rfv $CABALHOME/packages/head.hackage | 
|  | 28 | +matrix: | 
|  | 29 | +  include: | 
|  | 30 | +    - compiler: ghc-8.8.1 | 
|  | 31 | +      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}} | 
|  | 32 | +    - compiler: ghc-8.6.5 | 
|  | 33 | +      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}} | 
|  | 34 | +    - compiler: ghc-8.4.4 | 
|  | 35 | +      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}} | 
|  | 36 | +before_install: | 
|  | 37 | +  - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//') | 
|  | 38 | +  - WITHCOMPILER="-w $HC" | 
|  | 39 | +  - HCPKG="$HC-pkg" | 
|  | 40 | +  - unset CC | 
|  | 41 | +  - CABAL=/opt/ghc/bin/cabal | 
|  | 42 | +  - CABALHOME=$HOME/.cabal | 
|  | 43 | +  - export PATH="$CABALHOME/bin:$PATH" | 
|  | 44 | +  - export LD_LIBRARY_PATH="/opt/arrayfire/lib64:$LD_LIBRARY_PATH" | 
|  | 45 | +  - TOP=$(pwd) | 
|  | 46 | +  - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')" | 
|  | 47 | +  - echo $HCNUMVER | 
|  | 48 | +  - CABAL="$CABAL -vnormal+nowrap+markoutput" | 
|  | 49 | +  - set -o pipefail | 
|  | 50 | +  - | | 
|  | 51 | +    echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }'           >> .colorful.awk | 
|  | 52 | +    echo 'BEGIN { state = "output"; }'                                     >> .colorful.awk | 
|  | 53 | +    echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }'            >> .colorful.awk | 
|  | 54 | +    echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }'             >> .colorful.awk | 
|  | 55 | +    echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk | 
|  | 56 | +    echo '  if (state == "cabal") {'                                       >> .colorful.awk | 
|  | 57 | +    echo '    print blue($0)'                                              >> .colorful.awk | 
|  | 58 | +    echo '  } else {'                                                      >> .colorful.awk | 
|  | 59 | +    echo '    print $0'                                                    >> .colorful.awk | 
|  | 60 | +    echo '  }'                                                             >> .colorful.awk | 
|  | 61 | +    echo '}'                                                               >> .colorful.awk | 
|  | 62 | +  - cat .colorful.awk | 
|  | 63 | +  - | | 
|  | 64 | +    color_cabal_output () { | 
|  | 65 | +      awk -f $TOP/.colorful.awk | 
|  | 66 | +    } | 
|  | 67 | +  - echo text | color_cabal_output | 
|  | 68 | +install: | 
|  | 69 | +  - echo "Downloading ArrayFire-3.6.4"  | 
|  | 70 | +  - curl -O http://arrayfire.s3.amazonaws.com/3.6.4/ArrayFire-v3.6.4_Linux_x86_64.sh | 
|  | 71 | +  - chmod +x ArrayFire-v3.6.4_Linux_x86_64.sh | 
|  | 72 | +  - ./ArrayFire-v3.6.4_Linux_x86_64.sh --include-subdir --prefix=/opt | 
|  | 73 | +  - ls -lah /opt/arrayfire/ | 
|  | 74 | +  - ${CABAL} --version | 
|  | 75 | +  - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" | 
|  | 76 | +  - TEST=--enable-tests | 
|  | 77 | +  - BENCH=--enable-benchmarks | 
|  | 78 | +  - HEADHACKAGE=false | 
|  | 79 | +  - rm -f $CABALHOME/config | 
|  | 80 | +  - | | 
|  | 81 | +    echo "verbose: normal +nowrap +markoutput"          >> $CABALHOME/config | 
|  | 82 | +    echo "remote-build-reporting: anonymous"            >> $CABALHOME/config | 
|  | 83 | +    echo "write-ghc-environment-files: always"          >> $CABALHOME/config | 
|  | 84 | +    echo "remote-repo-cache: $CABALHOME/packages"       >> $CABALHOME/config | 
|  | 85 | +    echo "logs-dir:          $CABALHOME/logs"           >> $CABALHOME/config | 
|  | 86 | +    echo "world-file:        $CABALHOME/world"          >> $CABALHOME/config | 
|  | 87 | +    echo "extra-prog-path:   $CABALHOME/bin"            >> $CABALHOME/config | 
|  | 88 | +    echo "symlink-bindir:    $CABALHOME/bin"            >> $CABALHOME/config | 
|  | 89 | +    echo "installdir:        $CABALHOME/bin"            >> $CABALHOME/config | 
|  | 90 | +    echo "build-summary:     $CABALHOME/logs/build.log" >> $CABALHOME/config | 
|  | 91 | +    echo "store-dir:         $CABALHOME/store"          >> $CABALHOME/config | 
|  | 92 | +    echo "install-dirs user"                            >> $CABALHOME/config | 
|  | 93 | +    echo "  prefix: $CABALHOME"                         >> $CABALHOME/config | 
|  | 94 | +    echo "repository hackage.haskell.org"               >> $CABALHOME/config | 
|  | 95 | +    echo "  url: http://hackage.haskell.org/"           >> $CABALHOME/config | 
|  | 96 | +  - cat $CABALHOME/config | 
|  | 97 | +  - rm -fv cabal.project cabal.project.local cabal.project.freeze | 
|  | 98 | +  - travis_retry ${CABAL} v2-update -v | 
|  | 99 | +  # Generate cabal.project | 
|  | 100 | +  - rm -rf cabal.project cabal.project.local cabal.project.freeze | 
|  | 101 | +  - touch cabal.project | 
|  | 102 | +  - | | 
|  | 103 | +    echo "packages: ." >> cabal.project | 
|  | 104 | +  - | | 
|  | 105 | +  - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(arrayfire)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" | 
|  | 106 | +  - cat cabal.project || true | 
|  | 107 | +  - cat cabal.project.local || true | 
|  | 108 | +  - ${CABAL} install $WITHCOMPILER hspec-discover | color_cabal_output # needed on $PATH for tests | 
|  | 109 | +  - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi | 
|  | 110 | +  - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output | 
|  | 111 | +  - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'" | 
|  | 112 | +  - rm  cabal.project.freeze | 
|  | 113 | +  - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all | color_cabal_output | 
|  | 114 | +  - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output | 
|  | 115 | +script: | 
|  | 116 | +  - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) | 
|  | 117 | +  # Packaging... | 
|  | 118 | +  - ${CABAL} v2-sdist all | color_cabal_output | 
|  | 119 | +  # Unpacking... | 
|  | 120 | +  - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/ | 
|  | 121 | +  - cd ${DISTDIR} || false | 
|  | 122 | +  - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \; | 
|  | 123 | +  - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm       '{}' \; | 
|  | 124 | +  - PKGDIR_arrayfire="$(find . -maxdepth 1 -type d -regex '.*/arrayfire-[0-9.]*')" | 
|  | 125 | +  # Generate cabal.project | 
|  | 126 | +  - rm -rf cabal.project cabal.project.local cabal.project.freeze | 
|  | 127 | +  - touch cabal.project | 
|  | 128 | +  - | | 
|  | 129 | +    echo "packages: ${PKGDIR_arrayfire}" >> cabal.project | 
|  | 130 | +  - | | 
|  | 131 | +  - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(arrayfire)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" | 
|  | 132 | +  - cat cabal.project || true | 
|  | 133 | +  - cat cabal.project.local || true | 
|  | 134 | +  # Building... | 
|  | 135 | +  # this builds all libraries and executables (without tests/benchmarks) | 
|  | 136 | +  - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output | 
|  | 137 | +  # Building with tests and benchmarks... | 
|  | 138 | +  # build & run tests, build benchmarks | 
|  | 139 | +  - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output | 
|  | 140 | +  # Testing... | 
|  | 141 | +  - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output | 
|  | 142 | +  # cabal check... | 
|  | 143 | +  - (cd ${PKGDIR_arrayfire} && ${CABAL} -vnormal check) | 
|  | 144 | +  # haddock... | 
|  | 145 | +  - ${CABAL} v2-haddock $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output | 
|  | 146 | +  # Building without installed constraints for packages in global-db... | 
|  | 147 | +  - rm -f cabal.project.local | 
|  | 148 | +  - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output | 
|  | 149 | + | 
|  | 150 | +# REGENDATA ["travis","arrayfire.cabal"] | 
|  | 151 | +# EOF | 
0 commit comments