diff options
author | davidovski <david@davidovski.xyz> | 2023-02-02 14:10:02 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-02-02 14:10:02 +0000 |
commit | f29d569cd33a73da5ad675f43a34ad53c5cc9bc6 (patch) | |
tree | 76fe6267f8307e7630fc6f53ff99a9767ad40de0 /skip/cabal/cabal.xibuild | |
parent | 05d004dfe0c9a9d898fac8a4a0292ca2a74ca391 (diff) |
Work
Diffstat (limited to 'skip/cabal/cabal.xibuild')
-rw-r--r-- | skip/cabal/cabal.xibuild | 52 |
1 files changed, 36 insertions, 16 deletions
diff --git a/skip/cabal/cabal.xibuild b/skip/cabal/cabal.xibuild index 501b0e3..64bcd18 100644 --- a/skip/cabal/cabal.xibuild +++ b/skip/cabal/cabal.xibuild @@ -3,24 +3,37 @@ NAME="cabal" DESC="The Haskell Cabal" -MAKEDEPS="cabal-stage0" -DEPS="gmp libffi musl zlib " +MAKEDEPS="ghc gmp libffi zlib cabal-bootstrap" -PKG_VER=3.6.2.0 +PKG_VER=3.8.1.0 SOURCE="https://hackage.haskell.org/package/cabal-install-$PKG_VER/cabal-install-$PKG_VER.tar.gz" -ADDITIONAL="cabal.project.freeze " +ADDITIONAL=" +cabal.project.freeze +" + +cabal_update() { + cd $BUILD_ROOT + # Build a freeze file to make the build reproducible. + # This freeze file is stored in $source and thus tracked in Git. + HOME="$_cabal_home" cabal v2-update --allow-newer + ( + cd "$BUILD_ROOT" + HOME="$_cabal_home" cabal v2-freeze \ + --allow-newer --shadow-installed-packages + mv cabal.project.freeze "$startdir/" + ) +} -prepare () { - export cabal_home="$BUILD_ROOT/dist" - - ln -sf cabal.project.freeze \ - "cabal.project.freeze" +prepare() { + apply_patches + ln -sf "$BUILD_ROOT/cabal.project.freeze" \ + "$BUILD_ROOT/cabal.project.freeze" } -build () { - HOME="$cabal_home" cabal v2-update - HOME="$cabal_home" cabal v2-build all \ +build() { + HOME="$_cabal_home" cabal v2-update + HOME="$_cabal_home" cabal v2-build all \ --allow-newer \ --jobs=${JOBS:-1} \ --prefix=/usr \ @@ -28,13 +41,20 @@ build () { --sysconfdir=/etc } -package () { - HOME="$cabal_home" cabal list-bin --allow-newer all:exes | \ - xargs install -Dm755 -t "$PKG_DEST"/usr/bin +package() { + # With v2- cabal no longer wants us to separate v2-build and + # v2-install, however, we don't want to build everything in a + # fakeroot. We work around this by copying binaries build in the + # previous step manually. + # + # See https://github.com/haskell/cabal/issues/6919#issuecomment-761563498 + HOME="$_cabal_home" cabal list-bin --allow-newer all:exes | \ + xargs install -Dm755 -t "$PKG_DEST"/usr/bin mkdir -p "$PKG_DEST"/usr/share/man/man1 - HOME="$cabal_home" cabal man --raw \ + HOME="$_cabal_home" cabal man --raw \ > "$PKG_DEST"/usr/share/man/man1/cabal.1 install -Dm644 LICENSE "$PKG_DEST/usr/share/licenses/cabal/LICENSE" } + |