summary refs log tree commit diff
path: root/pkgs/tools/graphics/welkin/default.nix
blob: 3d1a2aa5bdc0b52e0e91dbae92c0189d76523847 (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
x@{builderDefsPackage
  , jre
  , ...}:
builderDefsPackage
(a :
let
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
    ["jre"];

  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
  sourceInfo = rec {
    baseName="welkin";
    version="1.1";
    name="${baseName}-${version}";
    url="http://simile.mit.edu/dist/welkin/${name}.tar.gz";
    hash="0hr2xvfz887fdf2ysiqydv6m13gbdl5x0fh4960i655d5imvd5x0";
  };
in
rec {
  src = a.fetchurl {
    url = sourceInfo.url;
    sha256 = sourceInfo.hash;
  };

  inherit (sourceInfo) name version;
  inherit buildInputs;

  /* doConfigure should be removed if not needed */
  phaseNames = ["doDeploy" "createBin"];

  doDeploy = a.simplyShare "welkin";

  createBin = a.fullDepEntry ''
    mkdir -p "$out/bin"
    echo "#! ${a.stdenv.shell}" > "$out/bin/welkin"
    echo "export JAVA_HOME=${jre}" >> "$out/bin/welkin"
    echo "\"$out/share/welkin/welkin.sh\" \"\$@\"" >> "$out/bin/welkin"
    sed -e 's@[.]/lib/welkin[.]jar@"'"$out"'/share/welkin/lib/welkin.jar"@' -i "$out/share/welkin/welkin.sh"
    chmod a+x "$out/bin/welkin"
  '' ["minInit" "defEnsureDir"];

  meta = {
    description = "An RDF visualizer";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    hydraPlatforms = [];
    license = a.lib.licenses.free;
  };
  passthru = {
    updateInfo = {
      downloadPage = "http://simile.mit.edu/dist/welkin/";
    };
  };
}) x