webp-pixbuf-loader: Adopt by GNOME

GNOME uses this for backgrounds so let’s add GNOME team to maintainers
and adopt GNOME coding style aimed at cleaner git diffs:

- Format with `nixpkgs-fmt`
- Inherit `moduleDir` variable since it has the same name
- Avoid re-using `pname` for `src` in case it is overwritten
- Use conventional attribute ordering
- Have one dependency per line in inputs
- Move comments closer to what they describe
- Wrap long substitute line
- Quote bash values

+39 -21
+39 -21
pkgs/development/libraries/webp-pixbuf-loader/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub 2 - , meson, ninja, pkg-config, makeWrapper 3 - , gdk-pixbuf, libwebp 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , meson 5 + , ninja 6 + , pkg-config 7 + , makeWrapper 8 + , gdk-pixbuf 9 + , libwebp 4 10 }: 11 + 5 12 let 6 - moduleDir = gdk-pixbuf.moduleDir; 13 + inherit (gdk-pixbuf) moduleDir; 7 14 8 15 # turning lib/gdk-pixbuf-#.#/#.#.#/loaders into lib/gdk-pixbuf-#.#/#.#.#/loaders.cache 9 16 # removeSuffix is just in case moduleDir gets a trailing slash ··· 15 22 16 23 src = fetchFromGitHub { 17 24 owner = "aruiz"; 18 - repo = pname; 25 + repo = "webp-pixbuf-loader"; 19 26 rev = version; 20 27 sha256 = "sha256-dcdydWYrXZJjo4FxJtvzGzrQLOs87/BmxshFZwsT2ws="; 21 28 }; 22 29 23 - # It looks for gdk-pixbuf-thumbnailer in this package's bin rather than the gdk-pixbuf bin. We need to patch that. 24 - postPatch = '' 25 - substituteInPlace webp-pixbuf.thumbnailer.in --replace @bindir@/gdk-pixbuf-thumbnailer $out/bin/webp-thumbnailer 26 - ''; 30 + nativeBuildInputs = [ 31 + gdk-pixbuf 32 + meson 33 + ninja 34 + pkg-config 35 + makeWrapper 36 + ]; 27 37 28 - nativeBuildInputs = [ gdk-pixbuf meson ninja pkg-config makeWrapper ]; 29 - buildInputs = [ gdk-pixbuf libwebp ]; 38 + buildInputs = [ 39 + gdk-pixbuf 40 + libwebp 41 + ]; 30 42 31 43 mesonFlags = [ 32 44 "-Dgdk_pixbuf_query_loaders_path=${gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders" 33 45 "-Dgdk_pixbuf_moduledir=${placeholder "out"}/${moduleDir}" 34 46 ]; 35 47 36 - # It assumes gdk-pixbuf-thumbnailer can find the webp loader in the loaders.cache referenced by environment variable, breaking containment. 37 - # So we replace it with a wrapped executable. 38 - postInstall = '' 39 - mkdir -p $out/bin 40 - makeWrapper ${gdk-pixbuf}/bin/gdk-pixbuf-thumbnailer $out/bin/webp-thumbnailer \ 41 - --set GDK_PIXBUF_MODULE_FILE $out/${loadersPath} 48 + postPatch = '' 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" 42 52 ''; 43 53 44 - # environment variables controlling loaders.cache generation by gdk-pixbuf-query-loaders 45 54 preInstall = '' 46 - export GDK_PIXBUF_MODULE_FILE=$out/${loadersPath} 47 - export GDK_PIXBUF_MODULEDIR=$out/${moduleDir} 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}" 58 + ''; 59 + 60 + postInstall = '' 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. 63 + mkdir -p "$out/bin" 64 + makeWrapper "${gdk-pixbuf}/bin/gdk-pixbuf-thumbnailer" "$out/bin/webp-thumbnailer" \ 65 + --set GDK_PIXBUF_MODULE_FILE "$out/${loadersPath}" 48 66 ''; 49 67 50 68 meta = with lib; { ··· 52 70 homepage = "https://github.com/aruiz/webp-pixbuf-loader"; 53 71 license = licenses.lgpl2Plus; 54 72 platforms = platforms.unix; 55 - maintainers = [ maintainers.cwyc ]; 73 + maintainers = teams.gnome.members ++ [ maintainers.cwyc ]; 56 74 # meson.build:16:0: ERROR: Program or command 'gcc' not found or not executable 57 75 broken = stdenv.isDarwin; 58 76 };