From 29a3bfae91ff4843a9ea2cab5b8cd18393fbdbf4 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Mon, 2 Dec 2019 18:03:13 +0300 Subject: Refactor scripts --- build | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'build') diff --git a/build b/build index aa11764..be60f9c 100755 --- a/build +++ b/build @@ -8,11 +8,30 @@ shift cd "$SRC_DIR" || exit 1 -cabal new-configure \ - --enable-optimization \ - --enable-executable-stripping +if command -v cabal >/dev/null 2>&1 +then + #echo ">>> cabal sandbox init <<<" + #cabal sandbox --verbose init || exit 1 -cabal new-build + echo ">>> cabal new-configure <<<" + cabal new-configure \ + --verbose \ + --enable-optimization \ + --enable-executable-stripping || exit 1 -find "$SRC_DIR"/dist-newstyle -type f -executable -name "$EXE_NAME" \ - -exec mv -u '{}' "$OUT" ';' + #echo ">>> cabal install <<<" + #cabal install --verbose --only-dependencies || exit 1 + + echo ">>> cabal new-build <<<" + cabal new-build --verbose || exit 1 + + find "$SRC_DIR"/dist-newstyle -type f -executable -name "$EXE_NAME" \ + -exec mv -u '{}' "$OUT" ';' || exit 1 +else + unset STACK_YAML + + echo ">>> stack build <<<" + stack build --verbose || exit 1 + + ln -f -T "$(stack exec -- which $EXE_NAME)" "$1" || exit 1 +fi -- cgit 1.4.1