24 # The way third-party dependencies are packaged has changed
25 # significantly from the 2.0.8 release. This means any packaging
26 # effort for the 2.0.8 release would have to be redone for the next
27 # release. Hence we package the git version for now and can easily
28 # jump onto the next release once it's available.
29 djvVersion = "2.0.8-unstable-2021-07-31";
31 djvSrc = fetchFromGitHub {
32 owner = "darbyjohnston";
34 rev = "ae31712c4f2802a874217ac194bde26287993934";
35 sha256 = "1qgia6vqb6fhyfj8w925xl6k6zidrp2gj5f32bpi94lwwhi6p9pd";
38 # DJV's build system tries to automatically pull in FSeq, another
39 # library by the DJV author.
41 # When updating, check the following file in the DJV source:
42 # etc/SuperBuild/cmake/Modules/BuildFSeq.cmake
44 # If there is revision or tag specified, DJV wants to use the most
45 # recent master version
46 fseqSrc = fetchFromGitHub {
47 owner = "darbyjohnston";
49 rev = "545fac6018100f7fca474b8ee4f1efa7cbf6bf45";
50 sha256 = "0qfhbrzji05hh5kwgd1wvq2lbf81ylbi7v7aqk28aws27f8d2hk0";
53 djv-deps = stdenv.mkDerivation rec {
54 pname = "djv-dependencies";
59 sourceRoot = "${src.name}/etc/SuperBuild";
61 nativeBuildInputs = [ cmake ];
69 sed -i 's,GIT_REPOSITORY https://github.com/darbyjohnston/FSeq.git,SOURCE_DIR ${fseqSrc},' \
70 cmake/Modules/BuildFSeq.cmake
72 # We pull these projects in as normal Nix dependencies. No need
73 # to build them again here.
75 sed -i CMakeLists.txt \
76 -e '/list(APPEND DJV_THIRD_PARTY_DEPS RapidJSON)/d' \
77 -e '/list(APPEND DJV_THIRD_PARTY_DEPS RtAudio)/d' \
78 -e '/list(APPEND DJV_THIRD_PARTY_DEPS IlmBase)/d' \
79 -e '/list(APPEND DJV_THIRD_PARTY_DEPS GLM)/d' \
80 -e '/list(APPEND DJV_THIRD_PARTY_DEPS GLFW)/d' \
81 -e '/list(APPEND DJV_THIRD_PARTY_DEPS ZLIB)/d' \
82 -e '/list(APPEND DJV_THIRD_PARTY_DEPS PNG)/d' \
83 -e '/list(APPEND DJV_THIRD_PARTY_DEPS FreeType)/d' \
84 -e '/list(APPEND DJV_THIRD_PARTY_DEPS OCIO)/d'
86 # The "SuperBuild" wants to build DJV right here. This is
87 # inconvenient, because then the `make install` target is not generated
88 # by CMake. We build DJV in its own derivation below. This also makes
89 # the build a bit more modular.
91 sed -i '/include(BuildDJV)/d' \
96 "-DDJV_THIRD_PARTY_OpenEXR:BOOL=False"
97 "-DDJV_THIRD_PARTY_JPEG:BOOL=False"
98 "-DDJV_THIRD_PARTY_TIFF:BOOL=False"
106 stdenv.mkDerivation rec {
108 version = djvVersion;
112 # Pull fix ending upstream inclusion for gcc-12+ support:
113 # https://github.com/darbyjohnston/DJV/pull/477
115 name = "gcc-13-cstdint-include.patch";
116 url = "https://github.com/darbyjohnston/DJV/commit/be0dd90c256f30c0305ff7b180fd932a311e66e5.patch";
117 hash = "sha256-x8GAfakhgjBiCKHbfgCukT5iFNad+zqURDJkQr092uk=";
120 name = "gcc-11-limits.patch";
121 url = "https://github.com/darbyjohnston/DJV/commit/0544ffa1a263a6b8e8518b47277de7601b21b4f4.patch";
122 hash = "sha256-x6ye0xMwTlKyNW4cVFb64RvAayvo71kuOooPj3ROn0g=";
125 name = "gcc-11-IO.patch";
126 url = "https://github.com/darbyjohnston/DJV/commit/ce79f2d2cb35d03322648323858834bff942c792.patch";
127 hash = "sha256-oPbXOnN5Y5QL+bs/bL5eJALu45YHnyTBLQcC8XcJi0c=";
130 name = "gcc-11-sleep_for.patch";
131 url = "https://github.com/darbyjohnston/DJV/commit/6989f43db27f66a7691f6048a2eb3299ef43a92e.patch";
132 hash = "sha256-1kiF3VrZiO+FSoR7NHCbduQ8tMq/Uuu6Z+sQII4xBAw=";
136 nativeBuildInputs = [ cmake ];
158 # When linking opencolorio statically this results in failing to
159 # pull in opencolorio's dependencies (tixml and yaml libraries). Avoid
160 # this by linking it statically instead.
162 sed -i cmake/Modules/FindOCIO.cmake \
163 -e 's/PATH_SUFFIXES static//' \
164 -e '/OpenColorIO_STATIC/d'
167 # GLFW requires a working X11 session.
171 description = "A professional review software for VFX, animation, and film production";
172 homepage = "https://darbyjohnston.github.io/DJV/";
173 platforms = platforms.linux;
174 maintainers = [ maintainers.blitz ];
175 license = licenses.bsd3;