git-annex/standalone/android/install-haskell-packages

125 lines
2.4 KiB
Text
Raw Normal View History

#!/bin/bash
# Bootstraps from an empty cabal to all the necessary haskell packages
# being installed, with the necessary patches to work on Android.
#
2013-09-22 18:13:31 +00:00
# You should install ghc-android first.
#
# 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
2013-09-23 21:39:53 +00:00
#
# Future work: Convert to using the method used here:
# https://github.com/kaoskorobase/ghc-ios-cabal-scripts/
set -e
2013-09-22 19:58:13 +00:00
if [ ! -d haskell-patches ]; then
cd standalone/android
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/${pkg}_* ../../../no-th/haskell-patches/${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 () {
2013-09-23 14:25:21 +00:00
pushd ../..
echo cabal install --only-dependencies "$@"
cabal install --only-dependencies "$@"
popd
2013-05-08 16:30:39 +00:00
}
install_pkgs () {
rm -rf tmp
mkdir tmp
cd tmp
patched network
2013-09-23 00:14:48 +00:00
patched unix-time
patched lifted-base
patched zlib
patched MissingH
patched bloomfilter
patched SafeSemaphore
2013-10-18 23:11:39 +00:00
patched distributive
patched comonad
patched iproute
patched primitive
patched socks
patched entropy
patched vector
patched stm-chans
patched persistent
patched profunctors
patched skein
patched lens
patched persistent-template
2013-09-22 18:13:31 +00:00
patched wai-app-static
patched shakespeare
patched shakespeare-css
2013-12-27 04:32:29 +00:00
patched shakespeare-js
2013-09-22 18:13:31 +00:00
patched yesod-routes
patched yesod-core
patched yesod-persistent
patched yesod-form
patched crypto-numbers
patched certificate
patched yesod-auth
patched yesod
2013-12-30 02:13:19 +00:00
patched shakespeare-text
2013-12-27 04:32:29 +00:00
patched process-conduit
2013-09-22 18:13:31 +00:00
patched gnuidn
2013-09-22 22:17:46 +00:00
patched DAV
2013-12-27 04:32:29 +00:00
patched yesod-static
patched uuid
patched dns
2013-12-27 04:32:29 +00:00
patched gnutls
cd ..
2013-09-23 14:25:21 +00:00
installgitannexdeps -fAndroid -f-Pairing
2013-05-09 17:08:24 +00:00
}
echo
echo
echo native build
echo
cabal update
installgitannexdeps
echo
echo
echo cross build
echo
PATH=$HOME/.ghc/$(cat abiversion)/bin:$HOME/.ghc/$(cat abiversion)/arm-linux-androideabi/bin:$PATH
cabal update
install_pkgs