summary refs log tree commit diff
path: root/pkgs/tools/graphics/libyafaray/default.nix
blob: 22bbfddbcf5d4b2644e216c460d08fe2b8a3157d (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
66
{ cmake
, fetchFromGitHub
, freetype
, ilmbase
, lib
, libjpeg
, libtiff
, libxml2
, opencv
, openexr
, pkg-config
, stdenv
, swig
, zlib
, withPython ? true, python3
}:

stdenv.mkDerivation rec {
  pname = "libyafaray";
  version = "unstable-2022-09-17";

  src = fetchFromGitHub {
    owner  = "YafaRay";
    repo   = "libYafaRay";
    rev    = "6e8c45fb150185b3356220e5f99478f20408ee49";
    sha256 = "sha256-UVBA1vXOuLg4RT+BdF4rhbZ6I9ySeZX0N81gh3MH84I=";
  };

  postPatch = ''
    sed '1i#include <memory>' -i \
      include/geometry/poly_double.h include/noise/noise_generator.h # gcc12
  '';

  preConfigure = ''
    NIX_CFLAGS_COMPILE+=" -isystem ${ilmbase.dev}/include/OpenEXR"
  '';

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    freetype
    ilmbase
    libjpeg
    libtiff
    libxml2
    opencv
    openexr
    swig
    zlib
  ] ++ lib.optional withPython python3;

  meta = with lib; {
    description = "A free, open source raytracer";
    downloadPage = "https://github.com/YafaRay/libYafaRay";
    homepage = "http://www.yafaray.org";
    maintainers = with maintainers; [ hodapp ];
    license = licenses.lgpl21;
    platforms = [ "aarch64-linux" "x86_64-linux" ];
  };
}

# TODO: Add optional Ruby support
# TODO: Add Qt support? (CMake looks for it, but what for?)