kdePackages.kirigami-addons: 1.5.0 -> 1.6.0 (#360539)
[NixPkgs.git] / pkgs / applications / graphics / rawtherapee / default.nix
blobdeb45b06d19f17bac9c2c83010b25803fba2c845
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , pkg-config
6 , util-linux
7 , libselinux
8 , libsepol
9 , lerc
10 , libthai
11 , libdatrie
12 , libxkbcommon
13 , libepoxy
14 , libXtst
15 , wrapGAppsHook3
16 , makeWrapper
17 , pixman
18 , libpthreadstubs
19 , gtkmm3
20 , libXau
21 , libXdmcp
22 , lcms2
23 , libiptcdata
24 , fftw
25 , expat
26 , pcre2
27 , libsigcxx
28 , lensfun
29 , librsvg
30 , libcanberra-gtk3
31 , gtk-mac-integration
32 , exiv2
33 , libraw
34   , libjxl
37 stdenv.mkDerivation rec {
38   pname = "rawtherapee";
39   version = "5.11";
41   src = fetchFromGitHub {
42     owner = "Beep6581";
43     repo = "RawTherapee";
44     rev = version;
45     hash = "sha256-jIAbguwF2aqRTk72ro5oHNTawA7biPSFC41YHgRR730=";
46     # The developpers ask not to use the tarball from Github releases, see
47     # https://www.rawtherapee.com/downloads/5.10/#news-relevant-to-package-maintainers
48     forceFetchGit = true;
49   };
51   postPatch = ''
52     echo "set(HG_VERSION ${version})" > ReleaseInfo.cmake
53     substituteInPlace tools/osx/Info.plist.in rtgui/config.h.in \
54       --replace "/Applications" "${placeholder "out"}/Applications"
55   '';
57   nativeBuildInputs = [
58     cmake
59     pkg-config
60     wrapGAppsHook3
61   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
62     makeWrapper
63   ];
65   buildInputs = [
66     util-linux
67     libselinux
68     libsepol
69     lerc
70     libthai
71     libdatrie
72     libxkbcommon
73     libepoxy
74     libXtst
75     pixman
76     libpthreadstubs
77     gtkmm3
78     libXau
79     libXdmcp
80     lcms2
81     libiptcdata
82     fftw
83     expat
84     pcre2
85     libsigcxx
86     lensfun
87     librsvg
88     exiv2
89     libraw
90     libjxl
91   ] ++ lib.optionals stdenv.hostPlatform.isLinux [
92     libcanberra-gtk3
93   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
94     gtk-mac-integration
95   ];
97   cmakeFlags = [
98     "-DPROC_TARGET_NUMBER=2"
99     "-DCACHE_NAME_SUFFIX=\"\""
100     "-DWITH_SYSTEM_LIBRAW=\"ON\""
101     "-DWITH_JXL=\"ON\""
102   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
103     "-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinMinVersion}"
104   ];
106   CMAKE_CXX_FLAGS = toString [
107     "-std=c++11"
108     "-Wno-deprecated-declarations"
109     "-Wno-unused-result"
110   ];
111   env.CXXFLAGS = "-include cstdint"; # needed at least with gcc13 on aarch64-linux
113   postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
114     mkdir -p $out/Applications/RawTherapee.app $out/bin
115     cp -R Release $out/Applications/RawTherapee.app/Contents
116     for f in $out/Applications/RawTherapee.app/Contents/MacOS/*; do
117       makeWrapper $f $out/bin/$(basename $f)
118     done
119   '';
121   meta = {
122     description = "RAW converter and digital photo processing software";
123     homepage = "http://www.rawtherapee.com/";
124     license = lib.licenses.gpl3Plus;
125     maintainers = with lib.maintainers; [ jcumming mahe ];
126     platforms = with lib.platforms; unix;
127   };