cabal-install-2.x can new-build (#386)
authorOleg Grenrus <oleg.grenrus@iki.fi>
Wed, 2 Aug 2017 10:33:09 +0000 (13:33 +0300)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Wed, 2 Aug 2017 10:33:09 +0000 (11:33 +0100)
.gitignore
build.cabal.sh

index 2e3581b..4b026f2 100644 (file)
@@ -11,6 +11,7 @@ cabal.sandbox.config
 
 # build.cabal-new.sh specific
 /dist-newstyle/
+.ghc.environment.*
 
 # build.stack.sh and build.stack.bat specific
 /.stack-work/
index 973cd3e..0dd9731 100755 (executable)
@@ -42,14 +42,14 @@ CABVERSTR=$("$CABAL" --numeric-version)
 
 CABVER=( ${CABVERSTR//./ } )
 
-if [ "${CABVER[0]}" -eq 1 -a "${CABVER[1]}" -ge 24 ]; then
+if [ "${CABVER[0]}" -eq 2 -o "${CABVER[0]}" -eq 1 -a "${CABVER[1]}" -ge 24 ]; then
     # New enough cabal version detected, so
     # let's use the superior 'cabal new-build' mode
 
     # there's no 'cabal new-run' yet, but it's easy to emulate
     "$CABAL" new-build --disable-profiling --disable-documentation -j exe:hadrian
     PKGVER="$(awk '/^version:/ { print $2 }' hadrian.cabal)"
-    "./dist-newstyle/build/hadrian-${PKGVER}/build/hadrian/hadrian" \
+    $(find ./dist-newstyle -type f -name hadrian | head -n 1) \
         --lint                         \
         --directory "$absoluteRoot/.." \
         "$@"