summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xstandalone/android/install-haskell-packages14
-rw-r--r--standalone/haskell-patches/no-th/DAV_build-without-TH.patch (renamed from standalone/android/haskell-patches/DAV_build-without-TH.patch)0
-rwxr-xr-xstandalone/linux/install-haskell-packages72
3 files changed, 80 insertions, 6 deletions
diff --git a/standalone/android/install-haskell-packages b/standalone/android/install-haskell-packages
index a8d4a18f9..b78eda83a 100755
--- a/standalone/android/install-haskell-packages
+++ b/standalone/android/install-haskell-packages
@@ -35,12 +35,14 @@ patched () {
git config user.email dummy@example.com
git add .
git commit -m "pre-patched state of $pkg"
- for patch in ../../haskell-patches/${pkg}_*; do
- echo trying $patch
- if ! patch -p1 < $patch; then
- echo "failed to apply $patch"
- echo "please resolve this, replace the patch with a new version, and exit the subshell to continue"
- $SHELL
+ for patch in ../../haskell-patches/${pkg}_* ../../../haskell-patches/no-th/${pkg}_*; do
+ if [ -e "$patch" ]; then
+ echo trying $patch
+ if ! patch -p1 < $patch; then
+ echo "failed to apply $patch"
+ echo "please resolve this, replace the patch with a new version, and exit the subshell to continue"
+ $SHELL
+ fi
fi
done
cabalinstall "$@"
diff --git a/standalone/android/haskell-patches/DAV_build-without-TH.patch b/standalone/haskell-patches/no-th/DAV_build-without-TH.patch
index b871fa9ef..b871fa9ef 100644
--- a/standalone/android/haskell-patches/DAV_build-without-TH.patch
+++ b/standalone/haskell-patches/no-th/DAV_build-without-TH.patch
diff --git a/standalone/linux/install-haskell-packages b/standalone/linux/install-haskell-packages
new file mode 100755
index 000000000..62bdf701b
--- /dev/null
+++ b/standalone/linux/install-haskell-packages
@@ -0,0 +1,72 @@
+#!/bin/bash
+# Bootstraps from an empty cabal (plus apt-get build-dep git-annex)
+# to all the necessary haskell packages being installed, with the
+# necessary patches to work on architectures that lack template haskell.
+#
+# Note that the newest version of packages is installed.
+# It attempts to reuse patches for older versions, but
+# new versions of packages often break cross-compilation by adding TH,
+# etc
+#
+# Future work: Convert to using the method used here:
+# https://github.com/kaoskorobase/ghc-ios-cabal-scripts/
+
+set -e
+
+if [ ! -d ../haskell-patches ]; then
+ cd standalone/linux
+fi
+
+cabalopts="$@"
+
+cabalinstall () {
+ echo cabal install "$@" "$cabalopts"
+ eval cabal install "$@" "$cabalopts"
+}
+
+patched () {
+ pkg=$1
+ shift 1
+ cabal unpack $pkg
+ cd $pkg*
+ git init
+ git config user.name dummy
+ git config user.email dummy@example.com
+ git add .
+ git commit -m "pre-patched state of $pkg"
+ for patch in ../../../haskell-patches/no-th/${pkg}_*; do
+ if [ -e "$patch" ]; then
+ echo trying $patch
+ if ! patch -p1 < $patch; then
+ echo "failed to apply $patch"
+ echo "please resolve this, replace the patch with a new version, and exit the subshell to continue"
+ $SHELL
+ fi
+ fi
+ done
+ cabalinstall "$@"
+ rm -rf $pkg*
+ cd ..
+}
+
+installgitannexdeps () {
+ pushd ../..
+ echo cabal install --only-dependencies "$@"
+ cabal install --only-dependencies "$@"
+ popd
+}
+
+install_pkgs () {
+ rm -rf tmp
+ mkdir tmp
+ cd tmp
+
+ patched DAV
+
+ cd ..
+
+ installgitannexdeps
+}
+
+cabal update
+install_pkgs