summary refs log tree commit diff
path: root/pkgs/games/the-butterfly-effect/default.nix
blob: 44d07cf3ffd57aa29efa4295cb79a27d8105b946 (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
x@{builderDefsPackage
  , qt4, box2d, which
  ,fetchsvn
  , ...}:
builderDefsPackage
(a :
let
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
    ["fetchsvn"];

  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
  sourceInfo = rec {
    baseName="tbe";
    revision="1319";
    version="r${revision}";
    name="${baseName}-${version}";
    url="https://tbe.svn.sourceforge.net/svnroot/tbe/trunk";
    hash="e9a7c24f0668ba2f36c472c1d05238fa7d9ed2150d99ce8a927285d099cc0f7f";
  };
in
rec {
  srcDrv = a.fetchsvn {
    url = sourceInfo.url;
    sha256 = sourceInfo.hash;
    rev = sourceInfo.revision;
  };
  src = srcDrv + "/";

  inherit (sourceInfo) name version;
  inherit buildInputs;

  phaseNames = ["setVars" "doConfigure" "doMakeInstall" "doDeploy"];
  configureCommand = "sh configure";

  setVars = a.noDepEntry ''
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${a.box2d}/include/Box2D"
  '';

  doDeploy = a.fullDepEntry ''
    mkdir -p "$out/share/tbe"
    cp -r . "$out/share/tbe/build-dir"
    mkdir -p "$out/bin"
    echo '#!${a.stdenv.shell}' >> "$out/bin/tbe"
    echo "$out/share/tbe/build-dir/tbe \"\$@\"" >> "$out/bin/tbe"
    chmod a+x "$out/bin/tbe"
  '' ["minInit" "doMake" "defEnsureDir"];

  meta = {
    description = "A physics-based game vaguely similar to Incredible Machine";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms;
      linux;
    license = a.stdenv.lib.licenses.gpl2;
  };
  passthru = {
    inherit srcDrv;
    updateInfo = {
      downloadPage = "http://sourceforge.net/projects/tbe/files/";
    };
  };
}) x