Merge pull request #8345 from joachifm/reimplement-picolisp

Re-define picolisp
This commit is contained in:
Arseniy Seroka 2015-06-15 22:43:03 +02:00
commit 8a23f0eba0

View File

@ -1,66 +1,44 @@
x@{builderDefsPackage { stdenv, fetchurl, jdk }:
, jdk /* only used in bootstrap */ with stdenv.lib;
, ...}:
builderDefsPackage
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
[];
buildInputs = map (n: builtins.getAttr n x) stdenv.mkDerivation rec {
(builtins.attrNames (builtins.removeAttrs x helperArgNames)); name = "picoLisp-${version}";
sourceInfo = rec { version = "3.1.10";
baseName="picolisp"; src = fetchurl {
tarballBaseName="picoLisp"; url = "http://www.software-lab.de/${name}.tgz";
version="3.1.9"; sha256 = "1pn5c0d81rz1fazsdijhw4cqybaad2wn6qramdj2qqkzxa3vvll1";
name="${baseName}-${version}";
tarballName="${tarballBaseName}-${version}";
extension="tgz";
url="http://www.software-lab.de/${tarballName}.${extension}";
sha256="1rhfd743ga9qsgn4h2aw1xcgrc7amsllli2zqg8cgm408vxkr6j1";
}; };
in buildInputs = [ jdk ];
rec { sourceRoot = ''picoLisp/src${optionalString stdenv.is64bit "64"}'';
src = a.fetchurl { installPhase = ''
url = sourceInfo.url;
sha256 = sourceInfo.sha256;
};
inherit (sourceInfo) name version;
inherit buildInputs;
/* doConfigure should be removed if not needed */
phaseNames = ["doMake" "doDeploy"];
goSrcDir = if a.stdenv.system == "x86_64-linux" then
"cd src64" else "cd src";
makeFlags = [''PREFIX=$out''];
doDeploy = a.fullDepEntry (''
cd .. cd ..
sed -e "s@/usr/@$out/@g" -i bin/pil
mkdir -p "$out/share/picolisp" "$out/lib" "$out/bin" mkdir -p "$out/share/picolisp" "$out/lib" "$out/bin"
cp -r . "$out/share/picolisp/build-dir" cp -r . "$out/share/picolisp/build-dir"
ln -s "$out/share/picolisp/build-dir" "$out/lib/picolisp" ln -s "$out/share/picolisp/build-dir" "$out/lib/picolisp"
ln -s "$out/lib/picolisp/bin/picolisp" "$out/bin/picolisp" ln -s "$out/lib/picolisp/bin/picolisp" "$out/bin/picolisp"
'') ["minInit" "defEnsureDir" "doMake"];
cat >"$out/bin/pil" <<EOF
#! /bin/sh
$out/bin/picolisp $out/lib/picolisp/lib.l @lib/misc.l @lib/btree.l @lib/db.l @lib/pilog.l
EOF
chmod +x "$out/bin/pil"
mkdir -p "$out/share/emacs"
ln -s "$out/lib/picolisp/lib/el" "$out/share/emacs/site-lisp"
'';
meta = { meta = {
description = "An interpreter for a small Lisp dialect with builtin DB"; description = "A simple Lisp with an integrated database.";
maintainers = with a.lib.maintainers; homepage = http://picolisp.com/;
[ license = licenses.mit;
raskin platform = platforms.all;
]; maintainers = with maintainers; [ raskin ];
platforms = with a.lib.platforms;
linux;
license = a.lib.licenses.mit;
}; };
passthru = { passthru = {
updateInfo = { updateInfo = {
downloadPage = "http://www.software-lab.de/down.html"; downloadPage = "http://www.software-lab.de/down.html";
}; };
}; };
}) x }