summary refs log tree commit diff
path: root/pkgs/applications/science/misc/golly/default.nix
blob: 9d198cd5c7f807af1044456148784ba233003276 (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
x@{builderDefsPackage,
  wxGTK, perl, python, zlib
  , ...}:
builderDefsPackage
(a :
let
  s = import ./src-for-default.nix;
  helperArgNames = ["builderDefsPackage"] ++
    [];
  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
in
rec {
  src = a.fetchUrlFromSrcInfo s;

  inherit (s) name;
  inherit buildInputs;

  /* doConfigure should be removed if not needed */
  phaseNames = ["setVars" "doConfigure" "doMakeInstall"];
  setVars = a.noDepEntry ''
    export NIX_LDFLAGS="$NIX_LDFLAGS -lperl -L$(echo "${perl}"/lib/perl5/5*/*/CORE)"
    pythonLib="$(echo "${python}"/lib/libpython*.so)"
    pythonLib="''${pythonLib##*/lib}"
    pythonLib="''${pythonLib%%.so}"
    export NIX_LDFLAGS="$NIX_LDFLAGS -l$pythonLib"
    echo "Flags: $NIX_LDFLAGS"
  '';

  meta = {
    description = "Cellular automata simulation program";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms;
      linux;
    license = with a.lib.licenses;
      gpl2;
  };
}) x