2013-12-17 03:05:00 +00:00
|
|
|
#!/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.
|
|
|
|
#
|
2014-08-14 20:57:53 +00:00
|
|
|
# Note that the newest version of packages are installed.
|
2013-12-17 03:05:00 +00:00
|
|
|
# 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
|
|
|
|
|
2014-07-04 17:58:09 +00:00
|
|
|
if [ ! -d haskell-patches ]; then
|
2013-12-17 03:05:00 +00:00
|
|
|
cd standalone/linux
|
|
|
|
fi
|
|
|
|
|
|
|
|
cabalopts="$@"
|
|
|
|
|
|
|
|
cabalinstall () {
|
2014-08-14 01:14:44 +00:00
|
|
|
echo cabal install -j1 "$@" "$cabalopts"
|
|
|
|
eval cabal install -j1 "$@" "$cabalopts"
|
2013-12-17 03:05:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
patched () {
|
|
|
|
pkg=$1
|
|
|
|
shift 1
|
2014-08-15 14:58:04 +00:00
|
|
|
cabal unpack $pkg$1
|
2013-12-17 03:05:00 +00:00
|
|
|
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"
|
2014-03-10 17:53:01 +00:00
|
|
|
for patch in ../../haskell-patches/${pkg}_* ../../../no-th/haskell-patches/${pkg}_*; do
|
2013-12-17 03:05:00 +00:00
|
|
|
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
|
2014-09-13 01:01:40 +00:00
|
|
|
cabalinstall
|
2013-12-17 03:05:00 +00:00
|
|
|
rm -rf $pkg*
|
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
|
|
|
|
installgitannexdeps () {
|
|
|
|
pushd ../..
|
2014-05-22 19:23:50 +00:00
|
|
|
echo "cabal install QuickCheck -f-templateHaskell"
|
|
|
|
cabal install QuickCheck -f-templateHaskell
|
2013-12-17 03:05:00 +00:00
|
|
|
echo cabal install --only-dependencies "$@"
|
|
|
|
cabal install --only-dependencies "$@"
|
|
|
|
popd
|
|
|
|
}
|
|
|
|
|
|
|
|
install_pkgs () {
|
|
|
|
rm -rf tmp
|
|
|
|
mkdir tmp
|
|
|
|
cd tmp
|
|
|
|
|
2014-03-10 17:29:24 +00:00
|
|
|
patched network
|
2013-12-18 21:41:17 +00:00
|
|
|
patched wai-app-static
|
2014-06-10 16:42:09 +00:00
|
|
|
patched vector
|
2014-05-20 22:12:29 +00:00
|
|
|
patched aeson
|
2013-12-18 21:41:17 +00:00
|
|
|
patched shakespeare
|
|
|
|
patched yesod-routes
|
|
|
|
patched monad-logger
|
2014-06-10 18:13:50 +00:00
|
|
|
patched skein
|
2013-12-18 21:41:17 +00:00
|
|
|
patched yesod-core
|
|
|
|
patched persistent
|
|
|
|
patched persistent-template
|
2014-08-15 14:58:04 +00:00
|
|
|
# Newer versions of file-embed cause ghc -ddump-splices
|
|
|
|
# to output invalid character codes.
|
|
|
|
# Note that the system generating the splices should also
|
|
|
|
# use this version of file-embed.
|
|
|
|
patched file-embed -0.0.6
|
2013-12-18 21:41:17 +00:00
|
|
|
patched process-conduit
|
|
|
|
patched yesod-static
|
2014-03-07 06:23:56 +00:00
|
|
|
patched yesod-persistent
|
2013-12-18 21:41:17 +00:00
|
|
|
patched yesod-form
|
|
|
|
patched yesod-auth
|
|
|
|
patched yesod
|
|
|
|
patched generic-deriving
|
|
|
|
patched profunctors
|
|
|
|
patched reflection
|
|
|
|
patched lens
|
|
|
|
patched xml-hamlet
|
2013-12-17 03:05:00 +00:00
|
|
|
patched DAV
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
installgitannexdeps
|
|
|
|
}
|
|
|
|
|
|
|
|
cabal update
|
2014-07-15 01:18:24 +00:00
|
|
|
|
|
|
|
# Some packages fail to install in a non unicode locale.
|
|
|
|
LANG=C.UTF-8
|
|
|
|
export LANG
|
|
|
|
|
2013-12-17 03:05:00 +00:00
|
|
|
install_pkgs
|