summary refs log tree commit diff
path: root/pkgs/development/interpreters/picolisp/default.nix
blob: ddb2a26bab2e3c0aa1dfa1a8eb25b8fe27f372b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
x@{builderDefsPackage
  , jdk /* only used in bootstrap */
  , ...}:
builderDefsPackage
(a :  
let 
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
    [];

  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
  sourceInfo = rec {
    baseName="picolisp";
    tarballBaseName="picoLisp";
    version="3.1.9";
    name="${baseName}-${version}";
    tarballName="${tarballBaseName}-${version}";
    extension="tgz";
    url="http://www.software-lab.de/${tarballName}.${extension}";
    sha256="1rhfd743ga9qsgn4h2aw1xcgrc7amsllli2zqg8cgm408vxkr6j1";
  };
in
rec {
  src = a.fetchurl {
    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 ..

    sed -e "s@/usr/@$out/@g" -i bin/pil

    mkdir -p "$out/share/picolisp" "$out/lib" "$out/bin"
    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"
  '') ["minInit" "defEnsureDir" "doMake"];
      
  meta = {
    description = "An interpreter for a small Lisp dialect with builtin DB";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms;
      linux;
    license = a.lib.licenses.mit;
  };
  passthru = {
    updateInfo = {
      downloadPage = "http://www.software-lab.de/down.html";
    };
  };
}) x