about summary refs log tree commit diff
path: root/pkgs/development/libraries/chipmunk/default.nix
blob: d5471b9be75f3e9b6c10b52eeaf5f4ac02a8d45c (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
args :  
let 
  lib = args.lib;
  fetchurl = args.fetchurl;
  fullDepEntry = args.fullDepEntry;

  version = lib.attrByPath ["version"] "6.0.3" args; 
  majorVersion = lib.attrByPath ["majorVersion"] "6" args; 
  buildInputs = with args; [
    cmake freeglut mesa 
    libX11 xproto inputproto libXi libXmu
  ];
in
rec {
  src = fetchurl {
    url = "http://files.slembcke.net/chipmunk/release/Chipmunk-${majorVersion}.x/Chipmunk-${version}.tgz";
    sha256 = "c6f550454bc1c63a2a63e0ff8febecb4781a528ab6d6b657a17933a6f567541a";
  };

  inherit buildInputs;
  configureFlags = [];
  
  /* doConfigure should be specified separately */
  phaseNames = ["genMakefile" "doMakeInstall" "demoInstall"];

  genMakefile = fullDepEntry ''
    cmake -D CMAKE_INSTALL_PREFIX=$out . 
  '' ["minInit" "addInputs" "doUnpack"];

  demoInstall = fullDepEntry(''
    mkdir -p $out/bin
    cp Demo/chipmunk_demos $out/bin
  '') ["doMakeInstall" "defEnsureDir"];
      
  name = "chipmunk-" + version;
  meta = {
    description = "Chipmunk 2D physics engine";
  };
}