13 inherit (gdk-pixbuf) moduleDir;
15 # turning lib/gdk-pixbuf-#.#/#.#.#/loaders into lib/gdk-pixbuf-#.#/#.#.#/loaders.cache
16 # removeSuffix is just in case moduleDir gets a trailing slash
17 loadersPath = (lib.strings.removeSuffix "/" gdk-pixbuf.moduleDir) + ".cache";
19 stdenv.mkDerivation rec {
20 pname = "webp-pixbuf-loader";
23 src = fetchFromGitHub {
25 repo = "webp-pixbuf-loader";
27 sha256 = "sha256-dcdydWYrXZJjo4FxJtvzGzrQLOs87/BmxshFZwsT2ws=";
44 "-Dgdk_pixbuf_query_loaders_path=${gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders"
45 "-Dgdk_pixbuf_moduledir=${placeholder "out"}/${moduleDir}"
49 # It looks for gdk-pixbuf-thumbnailer in this package's bin rather than the gdk-pixbuf bin. We need to patch that.
50 substituteInPlace webp-pixbuf.thumbnailer.in \
51 --replace "@bindir@/gdk-pixbuf-thumbnailer" "$out/bin/webp-thumbnailer"
55 # environment variables controlling loaders.cache generation by gdk-pixbuf-query-loaders
56 export GDK_PIXBUF_MODULE_FILE="$out/${loadersPath}"
57 export GDK_PIXBUF_MODULEDIR="$out/${moduleDir}"
61 # It assumes gdk-pixbuf-thumbnailer can find the webp loader in the loaders.cache referenced by environment variable, breaking containment.
62 # So we replace it with a wrapped executable.
64 makeWrapper "${gdk-pixbuf}/bin/gdk-pixbuf-thumbnailer" "$out/bin/webp-thumbnailer" \
65 --set GDK_PIXBUF_MODULE_FILE "$out/${loadersPath}"
69 description = "WebP GDK Pixbuf Loader library";
70 homepage = "https://github.com/aruiz/webp-pixbuf-loader";
71 license = licenses.lgpl2Plus;
72 platforms = platforms.unix;
73 maintainers = teams.gnome.members ++ [ maintainers.cwyc ];
74 # meson.build:16:0: ERROR: Program or command 'gcc' not found or not executable
75 broken = stdenv.isDarwin;