chiark / gitweb /
Fix 32-bit picolisp loading of 'ext'
authorFredrik Fornwall <fredrik@fornwall.net>
Fri, 27 Nov 2015 11:24:29 +0000 (06:24 -0500)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 27 Nov 2015 11:24:29 +0000 (06:24 -0500)
packages/picolisp/build.sh
packages/picolisp/src-Makefile.patch
packages/picolisp/src-ext.c.patch [new file with mode: 0644]
packages/picolisp/src-main.c.patch [new file with mode: 0644]

index 9ee204b30c66f0370c02c194f989aac96ae12faa..902c3f0ae5120f4b3c5b6cd5f565c254a875e844 100644 (file)
@@ -1,6 +1,7 @@
 TERMUX_PKG_HOMEPAGE=http://picolisp.com
 TERMUX_PKG_DESCRIPTION="Lisp interpreter and application server framework"
 TERMUX_PKG_VERSION=15.11
 TERMUX_PKG_HOMEPAGE=http://picolisp.com
 TERMUX_PKG_DESCRIPTION="Lisp interpreter and application server framework"
 TERMUX_PKG_VERSION=15.11
+TERMUX_PKG_BUILD_REVISION=1
 TERMUX_PKG_SRCURL=http://software-lab.de/picoLisp-${TERMUX_PKG_VERSION}.tgz
 TERMUX_PKG_FOLDERNAME=picoLisp
 TERMUX_PKG_BUILD_IN_SRC=true
 TERMUX_PKG_SRCURL=http://software-lab.de/picoLisp-${TERMUX_PKG_VERSION}.tgz
 TERMUX_PKG_FOLDERNAME=picoLisp
 TERMUX_PKG_BUILD_IN_SRC=true
index ac3a148f0988feae0a11c8434fbad67a3be9650a..e2c16411496c6d7b146e92d416ff04d80d407c47 100644 (file)
@@ -114,7 +114,7 @@ diff -u -r ../picoLisp/src/Makefile ./src/Makefile
 +LCRYPT = 
 +OS = Android
 +PICOLISP-FLAGS = -rdynamic -lm $(LDFLAGS)
 +LCRYPT = 
 +OS = Android
 +PICOLISP-FLAGS = -rdynamic -lm $(LDFLAGS)
-+DYNAMIC-LIB-FLAGS = -shared -export-dynamic $(LDFLAGS)
++DYNAMIC-LIB-FLAGS = -shared -export-dynamic $(LDFLAGS) -lm
  
  picolisp: $(bin)/picolisp $(lib)/ext$(dll) $(lib)/ht$(dll)
  tools: $(bin)/lat1 $(bin)/utf2 $(bin)/balance
  
  picolisp: $(bin)/picolisp $(lib)/ext$(dll) $(lib)/ht$(dll)
  tools: $(bin)/lat1 $(bin)/utf2 $(bin)/balance
diff --git a/packages/picolisp/src-ext.c.patch b/packages/picolisp/src-ext.c.patch
new file mode 100644 (file)
index 0000000..28985d9
--- /dev/null
@@ -0,0 +1,19 @@
+The crypt(3) function is not available in Android, so remove support
+in ext for now.
+
+diff -u -r ../picoLisp/src/ext.c ./src/ext.c
+--- ../picoLisp/src/ext.c      2015-04-27 00:34:17.000000000 -0400
++++ ./src/ext.c        2015-11-27 06:07:18.767005597 -0500
+@@ -252,6 +252,7 @@
+ /*** Password hashing ***/
+ // (Ext:Crypt 'key 'salt) -> str
++#ifndef __ANDROID__
+ any Crypt(any x) {
+    any y;
+@@ -269,3 +270,4 @@
+       }
+    }
+ }
++#endif
diff --git a/packages/picolisp/src-main.c.patch b/packages/picolisp/src-main.c.patch
new file mode 100644 (file)
index 0000000..0f35191
--- /dev/null
@@ -0,0 +1,15 @@
+diff -u -r ../picoLisp/src/main.c ./src/main.c
+--- ../picoLisp/src/main.c     2015-11-24 02:39:50.000000000 -0500
++++ ./src/main.c       2015-11-26 18:07:24.794312532 -0500
+@@ -834,8 +834,10 @@
+          strcpy(buf + n + 4 + strlen(nm), ".dll");
+ #endif
+       }
+-      if (!(h = dlopen(buf, RTLD_LAZY | RTLD_GLOBAL))  ||  !(h = dlsym(h,p)))
++      if (!(h = dlopen(buf, RTLD_LAZY | RTLD_GLOBAL))  ||  !(h = dlsym(h,p))) {
++       fprintf(stderr, "dlopen/dlsym problem: %s\n", dlerror());
+          return NO;
++      }
+       val(x) = box(num(h));
+    }
+    return YES;