picolisp: Fix ext:Crypt and add bin/{httpGate,ssl}
authorFredrik Fornwall <fredrik@fornwall.net>
Wed, 13 Apr 2016 13:53:05 +0000 (09:53 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Wed, 13 Apr 2016 13:53:05 +0000 (09:53 -0400)
packages/picolisp/build.sh
packages/picolisp/src-Makefile.patch
packages/picolisp/src-ext.c.patch

index 64be6a7..240de6d 100644 (file)
@@ -1,5 +1,6 @@
 TERMUX_PKG_HOMEPAGE=http://picolisp.com
 TERMUX_PKG_DESCRIPTION="Lisp interpreter and application server framework"
+TERMUX_PKG_DEPENDS="libcrypt, openssl"
 TERMUX_PKG_VERSION=16.4.1
 TERMUX_PKG_SRCURL=http://software-lab.de/picoLisp.tgz
 TERMUX_PKG_FOLDERNAME=picoLisp
@@ -22,12 +23,14 @@ termux_step_pre_configure() {
                fi
        fi
        TERMUX_PKG_BUILDDIR=$TERMUX_PKG_SRCDIR
+       ORIG_CFLAGS="$CFLAGS"
        CFLAGS+=" -c $LDFLAGS $CPPFLAGS"
 }
 
 termux_step_make_install () {
+       cd $TERMUX_PKG_SRCDIR/
+
        if [ $TERMUX_ARCH_BITS = "64" ]; then
-               cd $TERMUX_PKG_SRCDIR/
                $CC -pie -o ../bin/picolisp -rdynamic ${TERMUX_PKG_EXTRA_MAKE_ARGS}.base.s -lc -lm -ldl
                chmod +x ../bin/picolisp
                $CC -pie -o ../lib/ext -shared -export-dynamic ${TERMUX_PKG_EXTRA_MAKE_ARGS}.ext.s
@@ -47,4 +50,8 @@ termux_step_make_install () {
        sed -i "1 s|^.*$|#!$TERMUX_PREFIX/bin/picolisp $TERMUX_PREFIX/lib/picolisp/lib.l|g" $TERMUX_PREFIX/lib/picolisp/bin/pil
 
        ( cd $TERMUX_PREFIX/bin && ln -f -s ../lib/picolisp/bin/picolisp picolisp && ln -f -s ../lib/picolisp/bin/pil pil )
+
+       # Bundled tools
+       $CC $ORIG_CFLAGS $CPPFLAGS $LDFLAGS -o $TERMUX_PREFIX/bin/ssl ../src/ssl.c -lssl -lcrypto
+       $CC $ORIG_CFLAGS $CPPFLAGS $LDFLAGS -o $TERMUX_PREFIX/bin/httpGate ../src/httpGate.c -lssl -lcrypto
 }
index 00a8b7c..59233bd 100644 (file)
@@ -119,7 +119,7 @@ diff -u -r ../picoLisp/src/Makefile ./src/Makefile
 -
 +CCLD = $(CC)
  
-+LCRYPT = 
++LCRYPT = -lcrypt
 +OS = Android
 +PICOLISP-FLAGS = -rdynamic -lm $(LDFLAGS)
 +DYNAMIC-LIB-FLAGS = -shared -export-dynamic $(LDFLAGS) -lm
index cfb787b..cb246bd 100644 (file)
@@ -1,19 +1,11 @@
-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-11-27 02:25:22.000000000 -0500
-+++ ./src/ext.c        2016-02-08 06:19:58.405969024 -0500
-@@ -250,6 +250,7 @@
-    return T;
- }
+--- ../picoLisp/src/ext.c      2016-04-01 04:05:10.000000000 -0400
++++ ./src/ext.c        2016-04-13 06:40:31.791712225 -0400
+@@ -3,6 +3,7 @@
+  */
  
-+#ifndef __ANDROID__
- /*** Password hashing ***/
- // (ext:Crypt 'key 'salt) -> str
- any Crypt(any x) {
-@@ -269,3 +270,4 @@
-       }
-    }
- }
-+#endif
+ #include "pico.h"
++#include <crypt.h>
+ /*** Soundex Algorithm ***/
+ static int SnxTab[] = {