summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/build-binary-dist.sh36
-rw-r--r--build-binary-dist.sh22
2 files changed, 36 insertions, 22 deletions
diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh
new file mode 100644
index 000000000..8a018a6f3
--- /dev/null
+++ b/bin/build-binary-dist.sh
@@ -0,0 +1,36 @@
+#! /bin/bash
+
+### This script builds a binary distribution tarball of GF from the source
+### package that this script is a part of. It assumes that you have installed
+### the Haskell Platform, version 2013.2.0.0 or 2012.4.0.0.
+
+os=$(uname) # Operating system name (e.g. Darwin or Linux)
+hw=$(uname -m) # Hardware name (e.g. i686 or x86_64)
+
+# GF version number:
+ver=$(grep -i ^version: gf.cabal | sed -e 's/version://' -e 's/ //g')
+
+destdir=/tmp/gf-binary-dist-$$ # assemble binary dist here
+prefix=/usr/local # where to install
+targz=gf-$ver-bin-$hw-$os.tar.gz # the final tar file
+
+set -e # Stop if an error occurs
+set -x # print commands before exuting them
+
+## First configure & build the C run-time system
+(
+cd src/runtime/c
+bash setup.sh configure --prefix=$prefix
+bash setup.sh build
+bash setup.sh install prefix=$destdir$prefix
+)
+
+## Now build GF, with C run-time support enabled
+cabal install --only-dependencies
+cabal configure --prefix=$prefix -fserver -fc-runtime --extra-lib-dirs=$destdir$prefix/lib --extra-include-dirs=$destdir$prefix/include
+cabal build
+cabal copy --destdir=$destdir
+
+tar -C $destdir/$prefix -zcf $targz .
+echo "Created $targz, consider renaming it to something more user friendly"
+rm -r $destdir
diff --git a/build-binary-dist.sh b/build-binary-dist.sh
deleted file mode 100644
index 439d7e6dc..000000000
--- a/build-binary-dist.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/bash
-
-### This script builds a binary distribution of GF from the source package
-### that this script is a part of. It also assumes that you have installed
-### the Haskell Platform, version 2010.1.0.0 or 2010.2.0.0
-
-destdir=/tmp/gf-build-binary-dist # assemble binary dist here
-prefix=/usr/local # where to install
-targz=gf-bin.tar.gz # the final tar file, should be renamed
-langs="" # which languages?
-#langs="langs=-Pol" # temporary problem with Polish, omit it
-
-set -e # Stop if an error occurs
-set -x # print commands before exuting them
-
-runhaskell Setup.hs configure --user --prefix $prefix -fserver
-runhaskell Setup.hs build $langs
-runhaskell Setup.hs copy --destdir=$destdir $langs
-
-tar -C $destdir/$prefix -zcf $targz .
-echo "Created $targz, rename it to something more informative"
-rm -r $destdir