summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xghc-pkg-shim.sh3
-rwxr-xr-xghc-shim.sh3
-rw-r--r--notes.txt33
3 files changed, 7 insertions, 32 deletions
diff --git a/ghc-pkg-shim.sh b/ghc-pkg-shim.sh
index 92d7607..d00ad77 100755
--- a/ghc-pkg-shim.sh
+++ b/ghc-pkg-shim.sh
@@ -6,4 +6,5 @@ for arg; do
args[${#args[@]}]="$arg"
fi
done
-ghc-pkg --package-db /data/data/com.termux/files/home/ghc-boot-pkgdb "${args[@]}"
+thisdir="$(dirname "$0")"
+ghc-pkg --package-db "$thisdir"/ghc-boot-pkgdb "${args[@]}"
diff --git a/ghc-shim.sh b/ghc-shim.sh
index 6885dc7..8f6a12d 100755
--- a/ghc-shim.sh
+++ b/ghc-shim.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
+thisdir="$(dirname "$0")"
if [[ $# = 1 && $1 = --print-global-package-db ]]; then
- echo /data/data/com.termux/files/home/ghc-boot-pkgdb
+ echo "$thisdir"/ghc-boot-pkgdb
else
#echo >/dev/tty "!! ghc $*"
ghc "$@"
diff --git a/notes.txt b/notes.txt
index 7c14f19..0b9921e 100644
--- a/notes.txt
+++ b/notes.txt
@@ -8,41 +8,14 @@ apt install cabal-install
I assume you're currently in $HOME/ghc-cabal-build.
Check using `dpkg -L ghc-libs-static' which libraries have static libs available
-Copy the .conf files for just those libraries from /data/data/com.termux/files/usr/lib/ghc-8.10.7/package.conf.d/ into a new directory, ghc-boot-pkgdb
+Copy the .conf files for just those libraries from /data/data/com.termux/files/usr/lib/ghc-8.10.7/package.conf.d/ into a new directory in the root of this repository, called ghc-boot-pkgdb
In ghc-boot-pkgdb, run `ghc-pkg recache`
-cat >ghc-shim.sh <<EOF
-#!/usr/bin/env bash
-if [[ $# = 1 && $1 = --print-global-package-db ]]; then
- echo /data/data/com.termux/files/home/ghc-cabal-build/ghc-boot-pkgdb
-else
- #echo >/dev/tty "!! ghc $*"
- ghc "$@"
-fi
-EOF
-
-cat >ghc-pkg-shim.sh <<EOF
-#!/usr/bin/env bash
-#echo >/dev/tty "!! ghc-pkg $*"
-args=()
-for arg; do
- if [[ $arg != --global ]]; then
- args[${#args[@]}]="$arg"
- fi
-done
-ghc-pkg --package-db /data/data/com.termux/files/home/ghc-cabal-build/ghc-boot-pkgdb "${args[@]}"
-EOF
-
-Make a new directory 'cbl', and in that directory:
+In the directory 'cbl':
cabal get resolv
cabal get cabal-install
-cat >cabal.project <<EOF
-packages:
- resolv-0.1.2.0/
- cabal-install-3.6.2.0/
-EOF
cd resolv-0.1.2.0
patch -p1 <<EOF # this is https://raw.githubusercontent.com/termux/termux-packages/master/packages/haskell-resolv/hs_resolv.patch
--- resolv-0.1.2.0/cbits/hs_resolv.h 2001-09-09 07:16:40.000000000 +0530
@@ -71,7 +44,7 @@ patch -p1 <<EOF # this is https://raw.githubusercontent.com/termux/termux-packa
inline static int
EOF
cd ..
-cabal install -w ../ghc-shim.sh --with-hc-pkg=../ghc-pkg-shim.sh cabal-install
+cabal install -w "$PWD"/../ghc-shim.sh --with-hc-pkg="$PWD"/../ghc-pkg-shim.sh cabal-install
# Remove the extraneous dynamic libs that were installed, so that our system is stable again
apt remove cabal-install