2021-01-23 14:15:07 +01:00
|
|
|
{ lib, stdenv, fetchurl, jdk, w3m, openssl, makeWrapper }:
|
|
|
|
with lib;
|
2015-03-21 21:28:11 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "picoLisp";
|
2020-07-06 06:04:30 +02:00
|
|
|
version = "20.6";
|
2015-03-21 21:28:11 +01:00
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "https://www.software-lab.de/${pname}-${version}.tgz";
|
2020-07-06 06:04:30 +02:00
|
|
|
sha256 = "0l51x98bn1hh6kv40sdgp0x09pzg5i8yxbcjvm9n5bxsd6bbk5w2";
|
2011-03-28 10:16:15 +02:00
|
|
|
};
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [openssl] ++ optional stdenv.is64bit jdk;
|
2018-12-28 15:30:57 +01:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i "s/which java/command -v java/g" mkAsm
|
|
|
|
|
|
|
|
${optionalString stdenv.isAarch32 ''
|
|
|
|
sed -i s/-m32//g Makefile
|
|
|
|
cat >>Makefile <<EOF
|
|
|
|
ext.o: ext.c
|
|
|
|
\$(CC) \$(CFLAGS) -fPIC -D_OS='"\$(OS)"' \$*.c
|
|
|
|
ht.o: ht.c
|
|
|
|
\$(CC) \$(CFLAGS) -fPIC -D_OS='"\$(OS)"' \$*.c
|
|
|
|
EOF
|
|
|
|
''}
|
2015-10-01 11:20:24 +02:00
|
|
|
'';
|
2015-03-21 21:28:11 +01:00
|
|
|
sourceRoot = ''picoLisp/src${optionalString stdenv.is64bit "64"}'';
|
2019-06-17 21:00:57 +02:00
|
|
|
postBuild = ''
|
|
|
|
cd ../src; make gate
|
|
|
|
'';
|
2015-03-21 21:28:11 +01:00
|
|
|
installPhase = ''
|
2011-03-28 10:16:15 +02:00
|
|
|
cd ..
|
|
|
|
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/share/picolisp" "$out/lib" "$out/bin"
|
2011-03-28 10:16:15 +02:00
|
|
|
cp -r . "$out/share/picolisp/build-dir"
|
|
|
|
ln -s "$out/share/picolisp/build-dir" "$out/lib/picolisp"
|
|
|
|
ln -s "$out/lib/picolisp/bin/picolisp" "$out/bin/picolisp"
|
2019-06-17 21:00:57 +02:00
|
|
|
ln -s "$out/lib/picolisp/bin/httpGate" "$out/bin/httpGate"
|
2015-03-21 21:28:11 +01:00
|
|
|
|
2018-12-28 15:30:57 +01:00
|
|
|
|
|
|
|
makeWrapper $out/bin/picolisp $out/bin/pil \
|
2019-06-14 23:41:39 +02:00
|
|
|
--prefix PATH : ${w3m}/bin \
|
2018-12-28 15:30:57 +01:00
|
|
|
--add-flags "$out/lib/picolisp/lib.l" \
|
|
|
|
--add-flags "@lib/misc.l" \
|
|
|
|
--add-flags "@lib/btree.l" \
|
|
|
|
--add-flags "@lib/db.l" \
|
|
|
|
--add-flags "@lib/pilog.l"
|
2015-03-21 21:28:11 +01:00
|
|
|
|
|
|
|
mkdir -p "$out/share/emacs"
|
|
|
|
ln -s "$out/lib/picolisp/lib/el" "$out/share/emacs/site-lisp"
|
|
|
|
'';
|
|
|
|
|
2011-03-28 10:16:15 +02:00
|
|
|
meta = {
|
2016-02-27 18:24:00 +01:00
|
|
|
description = "A simple Lisp with an integrated database";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://picolisp.com/";
|
2015-03-21 21:28:11 +01:00
|
|
|
license = licenses.mit;
|
2016-08-02 16:41:28 +02:00
|
|
|
platforms = platforms.all;
|
2018-06-23 23:31:44 +02:00
|
|
|
broken = stdenv.isDarwin; # times out
|
2015-11-24 23:27:16 +01:00
|
|
|
maintainers = with maintainers; [ raskin tohl ];
|
2011-03-28 10:16:15 +02:00
|
|
|
};
|
2015-03-21 21:28:11 +01:00
|
|
|
|
2011-03-28 10:16:15 +02:00
|
|
|
passthru = {
|
|
|
|
updateInfo = {
|
|
|
|
downloadPage = "http://www.software-lab.de/down.html";
|
|
|
|
};
|
|
|
|
};
|
2015-03-21 21:28:11 +01:00
|
|
|
}
|