Permalink
Browse files

Simplify bin/compile, bin/release and update cucmber features

  • Loading branch information...
1 parent da58e66 commit e6e483cfce019a520ec050a695a3623f02b8bd93 @mbbx6spp committed May 29, 2012
Showing with 28 additions and 40 deletions.
  1. +17 −27 bin/compile
  2. +2 −6 bin/release
  3. +9 −7 features/compile.feature
View
@@ -10,33 +10,23 @@ echo "Info: BUILD_DIR=$BUILD_DIR"
CACHE_DIR=$2
echo "Info: CACHE_DIR=$CACHE_DIR"
-## CHECK BUILDPACK_GHC_BASE_URL is set
-if [ "$BUILDPACK_GHC_BASE_URL" != "" ]; then
- arch=$(uname -m)
- ghcver=$GHC_BOOTSTRAP_VERSION
- if [ "$ghcver" == "" ]; then
- echo "Error: please set GHC_BOOTSTRAP_VERSION";
- exit 1;
- fi;
- bsdir=$CACHE_DIR/bootstrap
- ghcurl="$BUILDPACK_GHC_BASE_URL/$ghcver/ghc-$ghcver-$arch-unknown-linux.tar.bz2"
- echo "Info: bootstrap directory: ${bsdir}";
- echo "Info: bootstrap URL: $ghcurl";
- if [ -f "$bsdir.downloaded" ]; then
- echo "Info: already downloaded GHC bootstrap version ${ghcver}";
- else
- echo "Info: downloading GHC $ghcver form $ghcurl";
- $(downloadAndExtract $bsdir $ghcurl);
- touch $bsdir.downloaded;
- fi;
+[ -z $GHC_VERSION ] && echo "Error: please set GHC_VERSION in environment" && exit 1
- if [ -f "$bsdir.compiled" ]; then
- echo "Info: already compiled GHC bootstrap version ${ghcver}";
- else
- $(configureMakeInstall $bsdir/ghc-$ghcver $BUILD_DIR/bootstrap/ghc-$ghcver);
- touch $bsdir.compiled;
- fi;
-else
+## CHECK BUILDPACK_GHC_BASE_URL is set
+if [ -z ${BUILDPACK_GHC_BASE_URL} ]; then
echo "Error: please set BUILDPACK_GHC_BASE_URL";
exit 1;
-fi
+else
+ pushd ${CACHE_DIR}
+ wget ${BUILDPACK_GHC_BASE_URL}/${GHC_VERSION}/ghc-heroku-${GHC_VERSION}.tar.bz2;
+ tar -jxf ghc=heroku-${GHC_VERSION}.tar.bz2;
+ cabal update
+ cabal install cabal cabal-install
+ popd
+
+ PATH=${CACHE_DIR}/ghc/bin:$PATH
+
+ pushd ${BUILD_DIR}
+ cabal install
+ popd
+fi;
View
@@ -8,12 +8,8 @@ cat <<EOF
config_vars:
GHC_PACKAGE_PATH: "$BUILD_DIR/ghc-packages.conf:"
GHCRTS: "-M512m -c70 -H128m"
- HASKELL_PLATFORM_VERSION: 2011.4.0.0
- GHC_BOOTSTRAP_VERSION: 7.0.4
- BUILDPACK_GHC_BASE_URL:
- BUILDPACK_PLATFORM_BASE_URL:
+ GHC_VERSION: 7.4.1
+ BUILDPACK_GHC_BASE_URL: "http://www.haskell.org/ghc/dist/"
addons:
- - shared-database:5mb
default_process_types:
EOF
-
@@ -6,26 +6,28 @@ Feature: Compile
Scenario: BUILDPACK_GHC_BASE_URL not set
Given environment variable BUILDPACK_GHC_BASE_URL is set to ""
+ And environment variable GHC_VERSION is set to "7.4.1"
When I run `compile ../tmp/build ../tmp/cache`
Then the output should contain "Error: please set BUILDPACK_GHC_BASE_URL"
And the exit status should be 1
Scenario: BUILDPACK_GHC_BASE_URL is set
- Given environment variable BUILDPACK_GHC_BASE_URL is set to "http://www.haskell.org/ghc/dist"
+ Given environment variable BUILDPACK_GHC_BASE_URL is set to "#{ENV['BUILDPACK_GHC_BASE_URL']}"
+ And environment variable GHC_VERSION is set to "7.4.1"
When I run `compile ../tmp/build ../tmp/cache`
Then the output should not contain "Error: please set BUILDPACK_GHC_BASE_URL"
And the exit status should be 0
- Scenario: GHC_BOOTSTRAP_VERSION is not set
- Given environment variable GHC_BOOTSTRAP_VERSION is set to ""
- Given environment variable BUILDPACK_GHC_BASE_URL is set to "http://www.haskell.org/ghc/dist"
+ Scenario: GHC_VERSION is not set
+ Given environment variable GHC_VERSION is set to ""
+ Given environment variable BUILDPACK_GHC_BASE_URL is set to "#{ENV['BUILDPACK_GHC_BASE_URL']}"
When I run `compile ../tmp/build ../tmp/cache`
- Then the output should contain "Error: please set GHC_BOOTSTRAP_VERSION"
+ Then the output should contain "Error: please set GHC_VERSION"
And the exit status should be 1
Scenario: GHC_BOOTSTRAP_VERSION is set
- Given environment variable GHC_BOOTSTRAP_VERSION is set to "7.0.4"
+ Given environment variable GHC_VERSION is set to "7.0.4"
Given environment variable BUILDPACK_GHC_BASE_URL is set to "http://www.haskell.org/ghc/dist"
When I run `compile ../tmp/build ../tmp/cache`
- Then the output should not contain "Error: please set GHC_BOOTSTRAP_VERSION"
+ Then the output should not contain "Error: please set GHC_VERSION"
And the exit status should be 0

0 comments on commit e6e483c

Please sign in to comment.