circleci: Add integer-simple build target
[ghc.git] / .circleci / prepare-system.sh
index dbb1011..d424243 100755 (executable)
@@ -11,6 +11,7 @@ hackage_index_state="@1522046735"
 
 if [[ -z ${BUILD_SPHINX_HTML:-} ]]; then BUILD_SPHINX_HTML=YES; fi
 if [[ -z ${BUILD_SPHINX_PDF:-} ]]; then BUILD_SPHINX_PDF=YES; fi
+if [[ -z ${INTEGER_LIBRARY:-} ]]; then INTEGER_LIBRARY=integer-gmp; fi
 
 cat > mk/build.mk <<EOF
 V=1
@@ -20,6 +21,7 @@ HSCOLOUR_SRCS=YES
 BUILD_SPHINX_HTML=$BUILD_SPHINX_HTML
 BUILD_SPHINX_PDF=$BUILD_SPHINX_PDF
 BeConservative=YES
+INTEGER_LIBRARY=$INTEGER_LIBRARY
 EOF
 
 case "$(uname)" in
@@ -27,15 +29,6 @@ case "$(uname)" in
     if [[ -n ${TARGET:-} ]]; then
       if [[ $TARGET = FreeBSD ]]; then
         # cross-compiling to FreeBSD
-        add-apt-repository -y ppa:hvr/ghc
-        apt-get update -qq
-        apt-get install -qy ghc-8.0.2 cabal-install-1.24 alex happy \
-                            ncurses-dev git make automake autoconf gcc perl \
-                            python3 texinfo xz-utils lbzip2 patch
-        cabal update
-        cabal install --reinstall hscolour --index-state=$hackage_index_state
-        ln -s $HOME/.cabal/bin/HsColour /usr/local/bin/HsColour
-
         echo 'HADDOCK_DOCS = NO' >> mk/build.mk
         echo 'WERROR=' >> mk/build.mk
         # https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
@@ -43,10 +36,6 @@ case "$(uname)" in
       else
         fail "TARGET=$target not supported"
       fi
-    else
-      cabal update
-      cabal install --reinstall hscolour
-      sudo ln -s /home/ghc/.cabal/bin/HsColour /usr/local/bin/HsColour || true
     fi
     ;;
 
@@ -69,6 +58,7 @@ case "$(uname)" in
     ln -s $HOME/.cabal/bin/alex /usr/local/bin/alex || true
     ln -s $HOME/.cabal/bin/happy /usr/local/bin/happy || true
     ln -s $HOME/.cabal/bin/HsColour /usr/local/bin/HsColour || true
+    echo "libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp" >> mk/build.mk
     ;;
   *)
     fail "uname=$(uname) not supported"