diff options
author | Phil Ruffwind | 2021-06-06 00:28:32 -0700 |
---|---|---|
committer | Phil Ruffwind | 2021-06-06 00:28:32 -0700 |
commit | bf19fb464d8251e7cf002625eb1930dea4c9eff7 (patch) | |
tree | 57f24d5cfbca926953e66b271a921eb0f39e031e | |
parent | b0d83aa4b102d72e8501194ff9c203e260e98e9a (diff) | |
download | aur-ghc-pristine.tar.gz |
Refactor to use upstream static package db
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 25 |
2 files changed, 13 insertions, 18 deletions
@@ -1,12 +1,10 @@ pkgbase = ghc-pristine pkgdesc = Symlinks to GHC with only boot libs, useful for building static binaries (see PKGBUILD for details) pkgver = 8.10.4 - pkgrel = 1 + pkgrel = 2 url = https://www.haskell.org/ghc/ arch = any license = custom - depends = ghc - optdepends = ghc-static: needed to build static binaries + depends = ghc-static pkgname = ghc-pristine - @@ -1,13 +1,17 @@ # Maintainer: Phil Ruffwind <rf@rufflewind.com> pkgname=ghc-pristine pkgver=8.10.4 -pkgrel=1 +pkgrel=2 pkgdesc="Symlinks to GHC with only boot libs, useful for building static binaries (see PKGBUILD for details)" arch=(any) url=https://www.haskell.org/ghc/ license=(custom) -depends=(ghc) -optdepends=("ghc-static: needed to build static binaries") +depends=(ghc-static) + +# Note: There is a more direct approach for building Haskell code with static +# linking, documented at: +# https://wiki.archlinux.org/title/Haskell#Static_global_package_database +# Please consider using that approach instead of ghc-pristine. # This package provides symbolic links to the Glasgow Haskell Compiler, but # with the global package database restricted to only boot libraries. This is @@ -17,10 +21,8 @@ optdepends=("ghc-static: needed to build static binaries") # # See also: https://wiki.archlinux.org/index.php/Haskell#Static_linking # -# To use this package, make sure ghc-static is installed and the flag -# --with-compiler=/usr/share/ghc-pristine/bin/ghc -# is passed to all cabal invocations. You can also add this to your -# ~/.cabal/config file. +# To use this package, pass --with-compiler=/usr/share/ghc-pristine/bin/ghc +# to all cabal invocations. You can also add this to your ~/.cabal/config. # # For cabal new-builds, you just need to run this command once: # cabal v2-configure --with-compiler=/usr/share/ghc-pristine/bin/ghc @@ -31,7 +33,7 @@ pkgver() { package() { prefix=/usr/share/ghc-pristine - mkdir -p "$pkgdir$prefix/bin/" "$pkgdir$prefix/lib/package.conf.d/" + mkdir -p "$pkgdir$prefix/bin/" "$pkgdir$prefix/lib/" ver=`pacman -Q ghc` ver=${ver#* } ver=${ver%-*} @@ -51,13 +53,8 @@ package() { fi fi ;; - /usr/lib/ghc-$ver/package.conf.d/*.conf) - ln -fs "$f" "$pkgdir$prefix/lib/package.conf.d/" - ;; /usr/lib/ghc-$ver/*-*.*.*) ;; - /usr/lib/ghc-$ver/package.conf.d) - ;; /usr/lib/ghc-$ver/*/*) ;; /usr/lib/ghc-$ver/*) @@ -65,7 +62,7 @@ package() { ;; esac done - ghc-pkg -f "$pkgdir$prefix/lib/package.conf.d" recache + ln -Tfs "/usr/lib/ghc-$ver/static-package.conf.d" "$pkgdir$prefix/lib/package.conf.d" mkdir -p "$pkgdir/usr/share/licenses/ghc-pristine" ln -fs ../ghc-libs/LICENSE "$pkgdir/usr/share/licenses/ghc-pristine" } |