summaryrefslogtreecommitdiff
path: root/notes.txt
blob: 0b9921ee893eaa4b90be522e278676dd8b59ee76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Getting a statically-linked cabal-install in termux

Be sure to have lots of free RAM; building the Cabal library from source takes roughly 4.5GiB at peak. Force stop apps if needed.

apt install ghc ghc-libs-static
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 in the root of this repository, called ghc-boot-pkgdb

In ghc-boot-pkgdb, run `ghc-pkg recache`

In the directory 'cbl':

cabal get resolv
cabal get cabal-install
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
+++ resolv-0.1.2.0-patch/cbits/hs_resolv.h	2022-02-03 20:54:49.602546255 +0530
@@ -84,12 +84,8 @@
 {
   assert(!s);
 
-  if (!(_res.options & RES_INIT)) {
     int rc = res_init();
     if (rc) return rc;
-  }
-
-  _res.options |= RES_USE_DNSSEC | RES_USE_EDNS0;
 
   return 0;
 }
@@ -112,7 +108,7 @@
 {
   assert(!s);
 
-  return res_send(msg, msglen, answer, anslen);
+  return -1;
 }
 
 inline static int
EOF
cd ..
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
apt autoremove