From 36ac446b2a848f13ce3677701c3a8018962d7193 Mon Sep 17 00:00:00 2001 From: Dominic Monroe Date: Thu, 18 May 2017 20:35:38 +0100 Subject: [PATCH] haskell-stack: Add support for stack.yaml in source --- Manual.md | 6 ++++-- common/build-style/haskell-stack.sh | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Manual.md b/Manual.md index e9fc6420ac9..3ee11ff2d60 100644 --- a/Manual.md +++ b/Manual.md @@ -1199,8 +1199,10 @@ and set build style to `haskell-stack`. The following variables influence how Haskell packages are built: - `stackage`: The Stackage version used to build the package, e.g. - `lts-3.5`. Alternatively, you can prepare a `stack.yaml` - configuration for the project and put it into `files/stack.yaml`. + `lts-3.5`. Alternatively: + - You can prepare a `stack.yaml` configuration for the project and put it + into `files/stack.yaml`. + - If a `stack.yaml` file is present in the source files, it will be used - `make_build_args`: This is passed as-is to `stack build ...`, so you can add your `--flag ...` parameters there. diff --git a/common/build-style/haskell-stack.sh b/common/build-style/haskell-stack.sh index f09acd1ab35..407bd876017 100644 --- a/common/build-style/haskell-stack.sh +++ b/common/build-style/haskell-stack.sh @@ -8,6 +8,8 @@ do_build() { if [ -f "${FILESDIR}/stack.yaml" ]; then msg_normal "Using stack config in stack.yaml.\n" cp "${FILESDIR}/stack.yaml" . + elif [ -z "$stackage" -a -f "stack.yaml" ]; then + msg_normal "Using stack.yaml from downloaded source.\n" else if [ -z "$stackage" ]; then msg_error "Stackage version not set in \$stackage.\n"