From edea1f16092fc51116832d12ce22e83559ae2265 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 13 Apr 2016 09:53:05 -0400 Subject: [PATCH] picolisp: Fix ext:Crypt and add bin/{httpGate,ssl} --- packages/picolisp/build.sh | 9 ++++++++- packages/picolisp/src-Makefile.patch | 2 +- packages/picolisp/src-ext.c.patch | 26 +++++++++----------------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/packages/picolisp/build.sh b/packages/picolisp/build.sh index 64be6a70c..240de6d0c 100644 --- a/packages/picolisp/build.sh +++ b/packages/picolisp/build.sh @@ -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 } diff --git a/packages/picolisp/src-Makefile.patch b/packages/picolisp/src-Makefile.patch index 00a8b7c93..59233bdf7 100644 --- a/packages/picolisp/src-Makefile.patch +++ b/packages/picolisp/src-Makefile.patch @@ -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 diff --git a/packages/picolisp/src-ext.c.patch b/packages/picolisp/src-ext.c.patch index cfb787b76..cb246bdc5 100644 --- a/packages/picolisp/src-ext.c.patch +++ b/packages/picolisp/src-ext.c.patch @@ -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 + + /*** Soundex Algorithm ***/ + static int SnxTab[] = {