darktable: Fix compilation on macOS

Only compile X11 and other components on Linux. Use DYLD_LIBRARY_PATH on
macOS instead of LD_LIBRARY_PATH.

+17 -9
+17 -9
pkgs/applications/graphics/darktable/default.nix
··· 3 , ilmbase, gtk3, intltool, lcms2, lensfun, libX11, libexif, libgphoto2, libjpeg 4 , libpng, librsvg, libtiff, openexr, osm-gps-map, pkgconfig, sqlite, libxslt 5 , openjpeg, lua, pugixml, colord, colord-gtk, libwebp, libsecret, gnome3 6 - , ocl-icd 7 }: 8 9 stdenv.mkDerivation rec { ··· 18 nativeBuildInputs = [ cmake ninja llvm pkgconfig intltool perl desktop-file-utils wrapGAppsHook ]; 19 20 buildInputs = [ 21 - cairo curl exiv2 glib gtk3 ilmbase lcms2 lensfun libX11 libexif 22 libgphoto2 libjpeg libpng librsvg libtiff openexr sqlite libxslt 23 libsoup graphicsmagick json-glib openjpeg lua pugixml 24 - colord colord-gtk libwebp libsecret gnome3.adwaita-icon-theme 25 - osm-gps-map ocl-icd 26 - ]; 27 - 28 cmakeFlags = [ 29 "-DBUILD_USERMANUAL=False" 30 ]; 31 32 # darktable changed its rpath handling in commit 33 # 83c70b876af6484506901e6b381304ae0d073d3c and as a result the 34 # binaries can't find libdarktable.so, so change LD_LIBRARY_PATH in 35 # the wrappers: 36 - preFixup = '' 37 gappsWrapperArgs+=( 38 - --prefix LD_LIBRARY_PATH ":" "$out/lib/darktable:${ocl-icd}/lib" 39 ) 40 ''; 41 ··· 43 description = "Virtual lighttable and darkroom for photographers"; 44 homepage = https://www.darktable.org; 45 license = licenses.gpl3Plus; 46 - platforms = platforms.linux; 47 maintainers = with maintainers; [ goibhniu rickynils flosse mrVanDalo ]; 48 }; 49 }
··· 3 , ilmbase, gtk3, intltool, lcms2, lensfun, libX11, libexif, libgphoto2, libjpeg 4 , libpng, librsvg, libtiff, openexr, osm-gps-map, pkgconfig, sqlite, libxslt 5 , openjpeg, lua, pugixml, colord, colord-gtk, libwebp, libsecret, gnome3 6 + , ocl-icd, pcre, gtk-mac-integration 7 }: 8 9 stdenv.mkDerivation rec { ··· 18 nativeBuildInputs = [ cmake ninja llvm pkgconfig intltool perl desktop-file-utils wrapGAppsHook ]; 19 20 buildInputs = [ 21 + cairo curl exiv2 glib gtk3 ilmbase lcms2 lensfun libexif 22 libgphoto2 libjpeg libpng librsvg libtiff openexr sqlite libxslt 23 libsoup graphicsmagick json-glib openjpeg lua pugixml 24 + libwebp libsecret gnome3.adwaita-icon-theme osm-gps-map pcre 25 + ] ++ stdenv.lib.optionals stdenv.isLinux [ 26 + colord colord-gtk libX11 ocl-icd 27 + ] ++ stdenv.lib.optional stdenv.isDarwin gtk-mac-integration; 28 + 29 cmakeFlags = [ 30 "-DBUILD_USERMANUAL=False" 31 + ] ++ stdenv.lib.optionals stdenv.isDarwin [ 32 + "-DUSE_COLORD=OFF" 33 + "-DUSE_KWALLET=OFF" 34 ]; 35 + 36 37 # darktable changed its rpath handling in commit 38 # 83c70b876af6484506901e6b381304ae0d073d3c and as a result the 39 # binaries can't find libdarktable.so, so change LD_LIBRARY_PATH in 40 # the wrappers: 41 + preFixup = let 42 + libPathEnvVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; 43 + libPathPrefix = "$out/lib/darktable" + stdenv.lib.optionalString stdenv.isLinux ":${ocl-icd}/lib"; 44 + in '' 45 gappsWrapperArgs+=( 46 + --prefix ${libPathEnvVar} ":" "${libPathPrefix}" 47 ) 48 ''; 49 ··· 51 description = "Virtual lighttable and darkroom for photographers"; 52 homepage = https://www.darktable.org; 53 license = licenses.gpl3Plus; 54 + platforms = platforms.linux ++ platforms.darwin; 55 maintainers = with maintainers; [ goibhniu rickynils flosse mrVanDalo ]; 56 }; 57 }