last few fixes to install-haskell-packages

This commit is contained in:
Joey Hess 2013-05-08 22:33:30 -04:00
parent 6e5fb0f9f5
commit d935314473
2 changed files with 36 additions and 12 deletions

View file

@ -25,7 +25,7 @@ process:
* You will need to have the Android SDK and NDK installed; see * You will need to have the Android SDK and NDK installed; see
`standalone/android/Makefile` to configure the paths to them. You'll also `standalone/android/Makefile` to configure the paths to them. You'll also
need ant, and the JDK. need ant, and the JDK.
* In `standalone/android/`, run `install-haskell-packages native; install-haskell-packages` * In `standalone/android/`, run `install-haskell-packages native`
* You also need to install git and all the utilities listed on [[fromscratch]], * You also need to install git and all the utilities listed on [[fromscratch]],
on the system doing the building. on the system doing the building.
* Then to build the full Android app bundle, use `make androidapp` * Then to build the full Android app bundle, use `make androidapp`

View file

@ -15,16 +15,22 @@
# lib dir # lib dir
set -e set -e
doit () { if [ "$1" ]; then
echo "$@" mode="$1"
eval "$@" shift 1
fi
cabalopts="$@"
cabalinstall () {
echo cabal install "$@" "$cabalopts"
eval cabal install "$@" "$cabalopts"
} }
patched () { patched () {
pkg=$1 pkg=$1
version=$2 version=$2
if [ "$native" ]; then if [ "$native" ]; then
doit cabal install --force-reinstalls $pkg-$version cabalinstall --force-reinstalls $pkg-$version
else else
shift 2 shift 2
cabal unpack $pkg-$version cabal unpack $pkg-$version
@ -33,16 +39,16 @@ patched () {
echo applying $patch echo applying $patch
patch -p1 < $patch patch -p1 < $patch
done done
doit cabal install "$@" cabalinstall "$@"
cd .. cd ..
fi fi
} }
unpatched () { unpatched () {
if [ "$native" ]; then if [ "$native" ]; then
doit cabal install "$@" cabalinstall "$@"
else else
doit cabal install "$@" cabalinstall "$@"
fi fi
} }
@ -146,7 +152,8 @@ install_pkgs () {
patched yesod-static 1.1.2 patched yesod-static 1.1.2
unpatched ifelse-0.85 unpatched ifelse-0.85
unpatched SafeSemaphore-0.9.0 unpatched SafeSemaphore-0.9.0
unpatched bloomfilter-1.2.6.10 onlycross unpatched bloomfilter-1.2.6.10 --constraint 'bytestring >= 0.10.3.0'
onlynative unpatched bloomfilter-1.2.6.10
unpatched edit-distance-0.2.1.2 unpatched edit-distance-0.2.1.2
unpatched uuid-1.2.12 unpatched uuid-1.2.12
unpatched json-0.7 unpatched json-0.7
@ -157,17 +164,34 @@ install_pkgs () {
rm -rf tmp rm -rf tmp
} }
if [ "$1" = native ]; then native_install () {
echo "Native install"
native=1 native=1
if [ ! -e $HOME/.cabal/packages/hackage.haskell.org ]; then if [ ! -e $HOME/.cabal/packages/hackage.haskell.org ]; then
cabal update cabal update
fi fi
install_pkgs install_pkgs
else }
cross_install () {
echo "Cross install"
native= native=
PATH=$HOME/.ghc/android-14/arm-linux-androideabi-4.7/bin:$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin:$PATH PATH=$HOME/.ghc/android-14/arm-linux-androideabi-4.7/bin:$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin:$PATH
if [ ! -e $HOME/.ghc/android-14/arm-linux-androideabi-4.7/cabal/packages/hackage.haskell.org ]; then if [ ! -e $HOME/.ghc/android-14/arm-linux-androideabi-4.7/cabal/packages/hackage.haskell.org ]; then
cabal update cabal update
fi fi
install_pkgs install_pkgs
fi }
case "$mode" in
native)
native_install
;;
cross)
cross_install
;;
"")
cross_install
native_install
;;
esac