From e09e3c264da0ceb02f4ec695e46ae5ec307f19f6 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 6 Jun 2021 10:42:16 +0200 Subject: [PATCH] Fix build on FreeBSD Related: https://gitlab.haskell.org/ghc/ghc/-/issues/19948 --- .gitlab/script/ghcup_release.sh | 2 +- .gitlab/script/ghcup_version.sh | 10 +++++++++- cabal.project | 6 +++++- cabal.project.freeze | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 cabal.project.freeze diff --git a/.gitlab/script/ghcup_release.sh b/.gitlab/script/ghcup_release.sh index 8f6c33d..08d4297 100755 --- a/.gitlab/script/ghcup_release.sh +++ b/.gitlab/script/ghcup_release.sh @@ -29,7 +29,7 @@ if [ "${OS}" = "LINUX" ] ; then ecabal build -w ghc-${GHC_VERSION} -ftui fi elif [ "${OS}" = "FREEBSD" ] ; then - ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections' --constraint="zlib +bundled-c-zlib" -ftui + ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections' --constraint="zlib +bundled-c-zlib" --constraint="zip +disable-zstd" -ftui elif [ "${OS}" = "WINDOWS" ] ; then ecabal build -w ghc-${GHC_VERSION} --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" else diff --git a/.gitlab/script/ghcup_version.sh b/.gitlab/script/ghcup_version.sh index 1e877bd..4274bed 100755 --- a/.gitlab/script/ghcup_version.sh +++ b/.gitlab/script/ghcup_version.sh @@ -34,23 +34,31 @@ ecabal update if [ "${OS}" = "DARWIN" ] ; then ecabal build -w ghc-${GHC_VERSION} -ftui ecabal test -w ghc-${GHC_VERSION} -ftui ghcup-test + ecabal haddock -w ghc-${GHC_VERSION} -ftui elif [ "${OS}" = "LINUX" ] ; then if [ "${ARCH}" = "32" ] ; then ecabal build -w ghc-${GHC_VERSION} -finternal-downloader -ftui -ftar ecabal test -w ghc-${GHC_VERSION} -finternal-downloader -ftui -ftar ghcup-test + ecabal haddock -w ghc-${GHC_VERSION} -finternal-downloader -ftui -ftar else ecabal build -w ghc-${GHC_VERSION} -finternal-downloader -ftui ecabal test -w ghc-${GHC_VERSION} -finternal-downloader -ftui ghcup-test + ecabal haddock -w ghc-${GHC_VERSION} -finternal-downloader -ftui fi +elif [ "${OS}" = "FREEBSD" ] ; then + ecabal build -w ghc-${GHC_VERSION} -finternal-downloader -ftui --constraint="zip +disable-zstd" + ecabal test -w ghc-${GHC_VERSION} -finternal-downloader -ftui --constraint="zip +disable-zstd" ghcup-test + ecabal haddock -w ghc-${GHC_VERSION} -finternal-downloader -ftui --constraint="zip +disable-zstd" elif [ "${OS}" = "WINDOWS" ] ; then ecabal build -w ghc-${GHC_VERSION} ecabal test -w ghc-${GHC_VERSION} ghcup-test + ecabal haddock -w ghc-${GHC_VERSION} else ecabal build -w ghc-${GHC_VERSION} -finternal-downloader -ftui ecabal test -w ghc-${GHC_VERSION} -finternal-downloader -ftui ghcup-test + ecabal haddock -w ghc-${GHC_VERSION} -finternal-downloader -ftui fi -ecabal haddock -w ghc-${GHC_VERSION} -ftar cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup')" . cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup-gen')" . diff --git a/cabal.project b/cabal.project index f543d56..1550800 100644 --- a/cabal.project +++ b/cabal.project @@ -3,7 +3,6 @@ packages: ./ghcup.cabal optimization: 2 package ghcup - ghc-options: -O2 -rtsopts tests: True flags: +tui @@ -12,6 +11,11 @@ source-repository-package location: https://github.com/Bodigrim/tar tag: ac197ec7ea4838dc2b4e22b9b888b080cedf29cf +source-repository-package + type: git + location: https://github.com/hasufell/zip + tag: 6f02aa48622b8ba764d0cc0e6900f480a107aa96 + constraints: http-io-streams -brotli package libarchive diff --git a/cabal.project.freeze b/cabal.project.freeze new file mode 100644 index 0000000..1412f0d --- /dev/null +++ b/cabal.project.freeze @@ -0,0 +1,2 @@ +-- windows picks weird version +constraints: any.hsc2hs ==0.68.7