diff options
author | Lukas Werling | 2017-10-05 12:59:46 +0200 |
---|---|---|
committer | Lukas Werling | 2017-10-05 12:59:46 +0200 |
commit | b04da0af967b0eeaed188a61c0510ff5b3002a7b (patch) | |
tree | b2b4ffdb716187903519d49669b9600d202438a0 | |
parent | cf3f0fcd3b2d77674abfc3f70dc06335c3d8ee1e (diff) | |
download | aur-b04da0af967b0eeaed188a61c0510ff5b3002a7b.tar.gz |
Build with stack instead of cabal
As recommended by https://ruudvanasseldonk.com/2017/09/21/building-elm-with-stack
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | PKGBUILD | 48 | ||||
-rw-r--r-- | stack.yaml | 8 |
3 files changed, 31 insertions, 37 deletions
@@ -1,18 +1,16 @@ # Generated by mksrcinfo v8 -# Mon Nov 14 15:54:24 UTC 2016 +# Thu Oct 5 10:58:38 UTC 2017 pkgbase = elm-platform pkgdesc = Bundle of all core development tools for the Elm language. pkgver = 0.18.0 - pkgrel = 1 + pkgrel = 2 url = http://elm-lang.org arch = i686 arch = x86_64 license = BSD3 - makedepends = ghc - makedepends = cabal-install - depends = ncurses + makedepends = stack-static + makedepends = patchelf depends = gmp - depends = libffi depends = zlib conflicts = nodejs-elm source = elm-compiler-0.18.0.zip::https://github.com/elm-lang/elm-compiler/archive/0.18.0.zip @@ -20,11 +18,13 @@ pkgbase = elm-platform source = elm-make-0.18.0.zip::https://github.com/elm-lang/elm-make/archive/0.18.0.zip source = elm-reactor-0.18.0.zip::https://github.com/elm-lang/elm-reactor/archive/0.18.0.zip source = elm-repl-0.18.0.zip::https://github.com/elm-lang/elm-repl/archive/0.18.0.zip + source = stack.yaml sha256sums = 879a030cc750964bdfc821b6927edba94e8ade650b63c95478270287c040a372 sha256sums = a93a2777ee4488510c6e5f82fc7bd7299cbeed7e04004e833d5a8d6f43db44c8 sha256sums = dcd254ba3c30848bc3527fcab197f8608bc913ae0bee17f67cf97ebf7977dfa6 sha256sums = 6c5525b2dd35ab6ccf6c5f7e6568bd0164711b8932e80f0caa4a8b9358509902 sha256sums = 8eba195029a3824fdf690b634f70e925d167f6b3bb7e632dfb1f90900244c87b + sha256sums = SKIP pkgname = elm-platform @@ -1,13 +1,13 @@ # Maintainer: Lukas Werling <lukas.werling@gmail.com> pkgname=elm-platform pkgver=0.18.0 -pkgrel=1 +pkgrel=2 pkgdesc="Bundle of all core development tools for the Elm language." arch=('i686' 'x86_64') url="http://elm-lang.org" license=('BSD3') -depends=('ncurses' 'gmp' 'libffi' 'zlib') -makedepends=('ghc' 'cabal-install') +depends=('gmp' 'zlib') +makedepends=('stack-static' 'patchelf') conflicts=('nodejs-elm') source=( elm-compiler-${pkgver}.zip::https://github.com/elm-lang/elm-compiler/archive/${pkgver}.zip @@ -15,53 +15,39 @@ source=( elm-make-${pkgver}.zip::https://github.com/elm-lang/elm-make/archive/${pkgver}.zip elm-reactor-${pkgver}.zip::https://github.com/elm-lang/elm-reactor/archive/${pkgver}.zip elm-repl-${pkgver}.zip::https://github.com/elm-lang/elm-repl/archive/${pkgver}.zip + stack.yaml ) sha256sums=('879a030cc750964bdfc821b6927edba94e8ade650b63c95478270287c040a372' 'a93a2777ee4488510c6e5f82fc7bd7299cbeed7e04004e833d5a8d6f43db44c8' 'dcd254ba3c30848bc3527fcab197f8608bc913ae0bee17f67cf97ebf7977dfa6' '6c5525b2dd35ab6ccf6c5f7e6568bd0164711b8932e80f0caa4a8b9358509902' - '8eba195029a3824fdf690b634f70e925d167f6b3bb7e632dfb1f90900244c87b') + '8eba195029a3824fdf690b634f70e925d167f6b3bb7e632dfb1f90900244c87b' + 'SKIP') prepare() { cd "$srcdir" - # Remove version from source directories. Cabal reads the version on the - # directory and fails if it does not exactly match the version given in the - # dependencies (e.g. 0.18.0 vs. 0.18). Without a version on the directory, - # Cabal will read the version given in the .cabal files instead. - mv elm-compiler-${pkgver} elm-compiler - mv elm-package-${pkgver} elm-package - mv elm-make-${pkgver} elm-make - mv elm-reactor-${pkgver} elm-reactor - mv elm-repl-${pkgver} elm-repl - - # This is currently necessary to build with GHC 8, see https://github.com/elm-lang/elm-compiler/issues/1397 - echo 'allow-newer: aeson,base,HTTP,time,transformers' > cabal.config + ln -sf elm-compiler-${pkgver} elm-compiler + ln -sf elm-package-${pkgver} elm-package + ln -sf elm-make-${pkgver} elm-make + ln -sf elm-reactor-${pkgver} elm-reactor + ln -sf elm-repl-${pkgver} elm-repl } -# This does not actually use the build script in the elm-lang/elm-platform -# repository, but the commands below are taken from there. build() { cd "$srcdir" - cabal update - cabal sandbox init - - # Split because elm-reactor depends on elm-make to be built. - repos1=(elm-compiler elm-make elm-package elm-repl) - repos2=(elm-reactor) - repos=("${repos1[@]}" "${repos2[@]}") - - cabal sandbox add-source ${repos[@]} - cabal install -j --only-dependencies --ghc-options='-w' ${repos[@]} + stack build --install-ghc - cabal install -j ${repos1[@]} - PATH="$(pwd)/.cabal-sandbox/bin:$PATH" cabal install -j ${repos2[@]} + binpath="$(stack path --local-install-root)/bin" + for bin in elm elm-make elm-package elm-reactor elm-repl; do + patchelf --shrink-rpath "$binpath/$bin" + done } package() { cd "$srcdir" - binpath=".cabal-sandbox/bin" + binpath="$(stack path --local-install-root)/bin" install -Dm755 "$binpath/elm" "$pkgdir/usr/bin/elm" install -Dm755 "$binpath/elm-make" "$pkgdir/usr/bin/elm-make" diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 000000000000..7437a28547cd --- /dev/null +++ b/stack.yaml @@ -0,0 +1,8 @@ +resolver: lts-6.35 +allow-newer: true +packages: + - elm-compiler + - elm-make + - elm-package + - elm-reactor + - elm-repl |