about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix
blob: c961dfd069a6b41ddf2dac7dfbbcd8beefb76a68 (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
{ lib, stdenv, fetchFromGitHub, re2, openfx, zlib, ilmbase, libGLU, libGL, openexr }:

stdenv.mkDerivation {
  pname = "openexrid-unstable";
  version = "2017-09-17";

  src = fetchFromGitHub {
    owner = "MercenariesEngineering";
    repo = "openexrid";
    rev = "bec0081548a096f9bcdd1504970c96264b0fc050";
    sha256 = "0h4b74lv59p4hhrvrqdmlnchn2i0v5id4kl8xc7j26l9884q0383";
  };

  outputs = [ "dev" "out" "lib" ];

  patches = [ ./openexrid.patch ];

  postPatch = ''
    substituteInPlace openexrid/makefile \
        --replace g++ c++
  '';

  env.NIX_CFLAGS_COMPILE = ''-I${ilmbase.dev}/include/OpenEXR
                       -I${openexr.dev}/include/OpenEXR
                       -I${openfx.dev}/include/OpenFX
                      '';

  buildInputs = [ re2 openfx zlib ilmbase libGLU libGL openexr ];

  enableParallelBuilding = true;

  buildPhase = ''
      mkdir openexrid/release

      PREFIX=$out make -C openexrid install

      mkdir $dev;
      mkdir $lib;
  '';

  installPhase = ''
      find $out
      mv $out/include $dev/
      mv $out/lib $lib/
  '';

  meta = with lib; {
    description = "OpenEXR files able to isolate any object of a CG image with a perfect antialiazing";
    homepage = "https://github.com/MercenariesEngineering/openexrid";
    maintainers = [ maintainers.guibou ];
    platforms = platforms.all;
    license = licenses.mit;
  };
}