git.iko.soy/heroku-buildpack-stack
on c330c89 help sign in
3 files changed+10−25
since splitsnapshots
unifiedsplit
Procfile.example−1 README.md+2−15 bin/compile+8−9
Procfile.exampledeleted−1
@@ -1 +0,0 @@
1−web: YOURAPPNAME-exe # $ cat *.cabal | grep executable
README.md+2−15
@@ -12,14 +12,6 @@ Set this buildpack on an existing app:
1212
1313 $ heroku buildpacks:set https://github.com/mfine/heroku-buildpack-stack
1414
15−Binary executables are placed in `/app/.local/bin/` after compilation, a directory which Heroku includes in your `$PATH`, so assuming that your application is [binding to `$PORT`](https://devcenter.heroku.com/articles/dynos#web-dynos), you can serve your app by [creating a `Procfile`](https://devcenter.heroku.com/articles/procfile) at your project root that defines a `web` process type for the `executable` defined in your `.cabal` file:
16−
17− $ cat *.cabal | grep executable
18− executable YOURAPPNAME-exe
19−
20− $ echo "web: YOURAPPNAME-exe" >> Procfile
21−
22−
2315### Templating stack.yaml
2416
2517To avoid committing secrets into `stack.yaml` for access to private
@@ -45,14 +37,9 @@ before compilation, the `stack.yaml` will be substituted as follows:
4537
4638
4739### Makefile Support
40+This buildpack now supports an optional Makefile, in case you need to coordinate other build steps with Stack. It assumes that the Makefile includes a `make install` target that uses the Stack build command with the flag `--copy-bins`. For example, a possible `install` target configuration in the Makefile could be:
4841
49−This buildpack now supports an optional Makefile, in case you need to coordinate
50−other build steps with Stack. It assumes that the Makefile includes a `make
51−install` target that uses the Stack build command with the flag `--copy-bins`.
52−For example, a possible `install` target configuration in the Makefile could be:
53−
54− install:
55− stack build --copy-bins
42+ install: stack build --copy-bins
5643
5744[1]: https://github.com/mfine/heroku-buildpack-stack
5845[2]: http://devcenter.heroku.com/articles/buildpacks
bin/compile+8−9
@@ -45,7 +45,7 @@ function set-default-env (){
4545}
4646
4747export LANG=en_US.UTF-8
48−export LIBRARY_PATH=$WORK_DIR/vendor/ghc-libs:$WORK_DIR/vendor/lib:/usr/lib:$LIBRARY_PATH
48+export LIBRARY_PATH=$WORK_DIR/vendor/ghc-libs:/usr/lib:$LIBRARY_PATH
4949export LD_LIBRARY_PATH=$LIBRARY_PATH
5050export PATH=$WORK_DIR/.local/bin:$WORK_DIR/vendor/bin:$PATH
5151export STACK_ROOT=$CACHE_DIR/.stack
@@ -63,7 +63,7 @@ speak "Restoring $LIBGMP_VER files from cache"
6363cp -Rp "$LIBGMP_DIR/ghc-libs/." "$WORK_DIR/vendor/ghc-libs"
6464
6565########## stack exe ###############################################
66−STACK_VER=${STACK_VER:-2.1.3}
66+STACK_VER=${STACK_VER:-1.2.0}
6767STACK_URL=${STACK_URL:-https://github.com/commercialhaskell/stack/releases/download/v"$STACK_VER"/stack-"$STACK_VER"-linux-x86_64.tar.gz}
6868STACK_DIR="$CACHE_DIR/stack-$STACK_VER"
6969STACK_EXE="$STACK_DIR/stack"
@@ -96,18 +96,17 @@ cd "$WORK_DIR"
9696# Makefile support (if you need other build tools than Stack that you need to use in conjunction)
9797if [ -f "$BUILD_DIR/Makefile" ]; then
9898 speak "Makefile detected"
99− make
100− make install
99+ make -C "$BUILD_DIR"
100+ make -C "$BUILD_DIR" install
101101else
102102 stack setup
103− stack clean
104− stack build --ghc-options='-O2' --copy-bins
103+ stack build --fast --copy-bins
105104fi
106105
107106# Set context environment variables.
108−set-env PATH "$WORK_DIR/.local/bin:$WORK_DIR/vendor/bin:\$PATH"
109−set-default-env LIBRARY_PATH "$WORK_DIR/vendor/ghc-libs:$WORK_DIR/vendor/lib:/usr/lib"
110−set-default-env LD_LIBRARY_PATH "$WORK_DIR/vendor/ghc-libs:$WORK_DIR/vendor/lib:/usr/lib"
107+set-env PATH "$WORK_DIR/.local/bin:$PATH"
108+set-default-env LIBRARY_PATH "$WORK_DIR/vendor/ghc-libs:/usr/lib"
109+set-default-env LD_LIBRARY_PATH "$WORK_DIR/vendor/ghc-libs:/usr/lib"
111110
112111speak "Making stack binaries available"
113112mkdir -p "$BUILD_DIR/vendor"