1{ cmake
2, fetchFromGitHub
3, freetype
4, ilmbase
5, lib
6, libjpeg
7, libtiff
8, libxml2
9, opencv
10, openexr
11, pkg-config
12, stdenv
13, swig
14, zlib
15, withPython ? true, python3
16}:
17
18stdenv.mkDerivation rec {
19 pname = "libyafaray";
20 version = "unstable-2022-09-17";
21
22 src = fetchFromGitHub {
23 owner = "YafaRay";
24 repo = "libYafaRay";
25 rev = "6e8c45fb150185b3356220e5f99478f20408ee49";
26 sha256 = "sha256-UVBA1vXOuLg4RT+BdF4rhbZ6I9ySeZX0N81gh3MH84I=";
27 };
28
29 postPatch = ''
30 sed '1i#include <memory>' -i \
31 include/geometry/poly_double.h include/noise/noise_generator.h # gcc12
32 '';
33
34 preConfigure = ''
35 NIX_CFLAGS_COMPILE+=" -isystem ${ilmbase.dev}/include/OpenEXR"
36 '';
37
38 nativeBuildInputs = [
39 cmake
40 pkg-config
41 ];
42
43 buildInputs = [
44 freetype
45 ilmbase
46 libjpeg
47 libtiff
48 libxml2
49 opencv
50 openexr
51 swig
52 zlib
53 ] ++ lib.optional withPython python3;
54
55 meta = with lib; {
56 description = "A free, open source raytracer";
57 downloadPage = "https://github.com/YafaRay/libYafaRay";
58 homepage = "http://www.yafaray.org";
59 maintainers = with maintainers; [ hodapp ];
60 license = licenses.lgpl21;
61 platforms = [ "aarch64-linux" "x86_64-linux" ];
62 };
63}
64
65# TODO: Add optional Ruby support
66# TODO: Add Qt support? (CMake looks for it, but what for?)