Forgot to do `toolDepends` -> `buildToolDepends` in the code itself
[cabal.git] / travis-bootstrap.sh
blobe69b3d3e717179b8ffd8352b5428fc1535762b23
1 #!/bin/sh
3 . ./travis-common.sh
5 # ---------------------------------------------------------------------
6 # Bootstrap cabal, to verify bootstrap.sh script works.
7 # ---------------------------------------------------------------------
9 bootstrap_jobs="-j"
11 (cd cabal-install && timed env EXTRA_CONFIGURE_OPTS="" ./bootstrap.sh $bootstrap_jobs --no-doc)
12 timed $HOME/.cabal/bin/cabal --version
13 PATH=$HOME/.cabal/bin:$PATH
15 # ---------------------------------------------------------------------
16 # Verify that installation from tarball works.
17 # ---------------------------------------------------------------------
19 # The following scriptlet checks that the resulting source distribution can be
20 # built & installed.
21 install_from_tarball() {
22 SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
23 export SRC_TGZ
24 if [ -f "dist/$SRC_TGZ" ]; then
25 cabal install --force-reinstalls $jobs "dist/$SRC_TGZ" -v2;
26 else
27 echo "expected 'dist/$SRC_TGZ' not found";
28 exit 1;
32 timed cabal update
34 # NB: The cabal cleans here hack around an sdist bug where
35 # the bootstrapped Cabal/cabal-install may be built
36 # without a Paths_* module available. Under some situations
37 # which I have not been able to reproduce except on Travis,
38 # cabal sdist will incorrectly pick up the left over dist
39 # directory from the bootstrap and then try to package
40 # up the Paths module, but to no avail because it is not
41 # available. I ran out of patience trying to debug this
42 # issue, and it is easy enough to work around: clean first.
44 echo Cabal
45 (cd Cabal && timed cabal clean) || exit $?
46 (cd Cabal && timed cabal sdist) || exit $?
47 (cd Cabal && timed install_from_tarball) || exit $?
49 echo cabal-install
50 (cd cabal-install && timed cabal clean) || exit $?
51 (cd cabal-install && timed cabal sdist) || exit $?
52 (cd cabal-install && timed install_from_tarball) || exit $?