17 , gobject-introspection
24 stdenv.mkDerivation rec {
28 outputs = [ "out" "dev" "man" "devdoc" ]
29 ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests";
32 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
33 sha256 = "7ptsddE7oJaQei48aye2G80X9cfr6rWltDnS8uOf5Es=";
37 # Move installed tests to a separate output
38 ./installed-tests-path.patch
41 # gdk-pixbuf-thumbnailer is not wrapped therefore strictDeps will work
61 ] ++ lib.optionals stdenv.isDarwin [
65 buildInputs = [ gobject-introspection ];
67 propagatedBuildInputs = [
75 "-Dgio_sniffing=false"
80 chmod +x build-aux/* # patchShebangs only applies to executables
81 patchShebangs build-aux
83 substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests"
85 # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
86 # it should be a build-time dep for build
88 substituteInPlace docs/meson.build \
89 --replace "dependency('gi-docgen'," "dependency('gi-docgen', native:true," \
90 --replace "'gi-docgen', req" "'gi-docgen', native:true, req"
95 # All except one utility seem to be only useful during building.
96 moveToOutput "bin" "$dev"
97 moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
99 '' + lib.optionalString stdenv.isDarwin ''
100 # meson erroneously installs loaders with .dylib extension on Darwin.
101 # Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them.
102 for f in $out/${passthru.moduleDir}/*.dylib; do
103 install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
104 mv $f ''${f%.dylib}.so
107 # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/
108 ${stdenv.hostPlatform.emulator buildPackages} $dev/bin/gdk-pixbuf-query-loaders --update-cache
111 # The fixDarwinDylibNames hook doesn't patch binaries.
112 preFixup = lib.optionalString stdenv.isDarwin ''
113 for f in $out/bin/* $dev/bin/*; do
114 install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
119 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
120 moveToOutput "share/doc" "$devdoc"
123 # The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
126 setupHook = ./setup-hook.sh;
128 separateDebugInfo = stdenv.isLinux;
131 updateScript = gnome.updateScript {
133 versionPolicy = "odd-unstable";
137 installedTests = nixosTests.installed-tests.gdk-pixbuf;
140 # gdk_pixbuf_moduledir variable from gdk-pixbuf-2.0.pc
141 moduleDir = "lib/gdk-pixbuf-2.0/2.10.0/loaders";
145 description = "A library for image loading and manipulation";
146 homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf";
147 license = licenses.lgpl21Plus;
148 maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
149 mainProgram = "gdk-pixbuf-thumbnailer";
150 platforms = platforms.unix;