20 , gobject-introspection
26 stdenv.mkDerivation rec {
30 outputs = [ "out" "dev" "man" "devdoc" "installedTests" ];
33 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
34 sha256 = "05ggmzwvrxq9w4zcvmrnnd6qplsmb4n95lj4q607c7arzlf6mil3";
38 # Move installed tests to a separate output
39 ./installed-tests-path.patch
56 ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
58 propagatedBuildInputs = [
67 "-Dintrospection=${if gobject-introspection != null then "enabled" else "disabled"}"
68 "-Dgio_sniffing=false"
72 chmod +x build-aux/* # patchShebangs only applies to executables
73 patchShebangs build-aux
75 substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests"
79 # meson erroneously installs loaders with .dylib extension on Darwin.
80 # Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them.
81 lib.optionalString stdenv.isDarwin ''
82 for f in $out/${passthru.moduleDir}/*.dylib; do
83 install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
84 mv $f ''${f%.dylib}.so
87 # All except one utility seem to be only useful during building.
89 moveToOutput "bin" "$dev"
90 moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
91 '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
92 # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/
93 $dev/bin/gdk-pixbuf-query-loaders --update-cache
96 # The fixDarwinDylibNames hook doesn't patch binaries.
97 preFixup = lib.optionalString stdenv.isDarwin ''
98 for f in $out/bin/* $dev/bin/*; do
99 install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
104 PATH=$PATH:$out/bin # for install script
107 # The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
110 setupHook = ./setup-hook.sh;
112 separateDebugInfo = stdenv.isLinux;
115 updateScript = gnome3.updateScript {
120 installedTests = nixosTests.installed-tests.gdk-pixbuf;
123 # gdk_pixbuf_moduledir variable from gdk-pixbuf-2.0.pc
124 moduleDir = "lib/gdk-pixbuf-2.0/2.10.0/loaders";
128 description = "A library for image loading and manipulation";
129 homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf";
130 maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
131 license = licenses.lgpl21Plus;
132 platforms = platforms.unix;