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

113 lines
2.5 KiB
Text
Raw Normal View History

#!/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.
#
# The cabal.config is used to pin the haskell packages to the last
# versions that have been gotten working. To update, delete the
# cabal.config, run this script with an empty cabal and fix up the broken
# patches, and then use cabal freeze to generate a new cabal.config.
set -e
2014-07-04 17:58:09 +00:00
if [ ! -d haskell-patches ]; then
cd standalone/linux
fi
cabalopts="$@"
cabalinstall () {
echo cabal install -j1 "$@" "$cabalopts"
eval cabal install -j1 "$@" "$cabalopts"
}
patched () {
pkg=$1
ver=$2
if [ -z "$ver" ]; then
ver="$(grep " $pkg " ../cabal.config | cut -d= -f 3 | sed 's/,$//')"
fi
if [ -z "$ver" ]; then
cabal unpack --pristine $pkg
else
cabal unpack --pristine $pkg-$ver
fi
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"
ln -sf ../../cabal.config
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
2014-09-13 01:01:40 +00:00
cabalinstall
rm -f cabal.config
cd ..
rm -rf $pkg*
}
installgitannexdeps () {
pushd ../..
ln -sf standalone/linux/cabal.config
2014-05-22 19:23:50 +00:00
echo "cabal install QuickCheck -f-templateHaskell"
cabal install -j1 QuickCheck -f-templateHaskell
echo cabal install --only-dependencies "$@"
cabal install -j1 --only-dependencies "$@"
rm -f cabal.config
popd
}
install_pkgs () {
rm -rf tmp
mkdir tmp
cd tmp
patched network
patched wai-app-static
2014-06-10 16:42:09 +00:00
patched vector
2014-05-20 22:12:29 +00:00
patched aeson
patched shakespeare
patched yesod-routes
patched monad-logger
patched skein
2014-12-04 17:50:41 +00:00
patched shakespeare-js
patched hamlet
patched yesod-core
patched persistent
patched persistent-template
patched file-embed
patched process-conduit
patched yesod-static
2014-03-07 06:23:56 +00:00
patched yesod-persistent
patched yesod-form
patched yesod-auth
patched yesod
patched generic-deriving
patched profunctors
patched reflection
patched lens
patched xml-hamlet
patched DAV
cd ..
installgitannexdeps
}
cabal update
# Some packages fail to install in a non unicode locale.
LANG=C.UTF-8
export LANG
install_pkgs