about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/babl
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-05-03 15:14:25 +0200
committerAlyssa Ross <hi@alyssa.is>2024-05-07 11:19:19 +0200
commitd92b2b6a1bbd322dd65a8b6f51019610d350046e (patch)
tree7f7c21927b9cc05676501f297c51eb76b49e326c /nixpkgs/pkgs/development/libraries/babl
parent93c9e56b40530cc627d921cfc255c05b495d4017 (diff)
parent49050352f602fe87d16ff7b2b6a05b79eb20dc6f (diff)
downloadnixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.gz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.bz2
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.lz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.xz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.zst
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.zip
Merge remote-tracking branch 'nixpkgs/nixos-unstable-small'
Conflicts:
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/babl')
-rw-r--r--nixpkgs/pkgs/development/libraries/babl/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/babl/dev-prefix.patch29
2 files changed, 51 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/development/libraries/babl/default.nix b/nixpkgs/pkgs/development/libraries/babl/default.nix
index b3ec8194c92a..e74947dd8194 100644
--- a/nixpkgs/pkgs/development/libraries/babl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/babl/default.nix
@@ -1,30 +1,36 @@
 { stdenv
 , lib
-, fetchpatch
 , fetchurl
 , meson
 , ninja
 , pkg-config
+, gi-docgen
 , gobject-introspection
 , lcms2
 , vala
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "babl";
-  version = "0.1.106";
+  version = "0.1.108";
 
-  outputs = [ "out" "dev" ];
+  outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "https://download.gimp.org/pub/babl/${lib.versions.majorMinor version}/babl-${version}.tar.xz";
-    hash = "sha256-0yUTXTME8IjBNMxiABOs8DXeLl0SWlCi2RBU5zd8QV8=";
+    url = "https://download.gimp.org/pub/babl/${lib.versions.majorMinor finalAttrs.version}/babl-${finalAttrs.version}.tar.xz";
+    hash = "sha256-Jt7+neqresTQ4HbKtJwqDW69DfDDH9IJklpfB+3uFHU=";
   };
 
+  patches = [
+    # Allow overriding path to dev output that will be hardcoded e.g. in pkg-config file.
+    ./dev-prefix.patch
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
     pkg-config
+    gi-docgen
     gobject-introspection
     vala
   ];
@@ -33,6 +39,15 @@ stdenv.mkDerivation rec {
     lcms2
   ];
 
+  mesonFlags = [
+    "-Dprefix-dev=${placeholder "dev"}"
+  ];
+
+  postFixup = ''
+    # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
+    moveToOutput "share/doc" "$devdoc"
+  '';
+
   meta = with lib; {
     description = "Image pixel format conversion library";
     mainProgram = "babl";
@@ -42,4 +57,4 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ jtojnar ];
     platforms = platforms.unix;
   };
-}
+})
diff --git a/nixpkgs/pkgs/development/libraries/babl/dev-prefix.patch b/nixpkgs/pkgs/development/libraries/babl/dev-prefix.patch
new file mode 100644
index 000000000000..9dab6c6a9ad4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/babl/dev-prefix.patch
@@ -0,0 +1,29 @@
+diff --git a/meson.build b/meson.build
+index 2350a1f..56f015d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -551,7 +551,7 @@ pkgconfig.generate(
+   variables: [
+     'datadir=${prefix}/share',
+     'pluginsdir=${libdir}/@0@'.format(lib_name),
+-    'girdir=${datadir}/gir-1.0',
++    'girdir=@0@/share/gir-1.0'.format(get_option('prefix-dev')),
+     'typelibdir=${libdir}/girepository-1.0',
+   ],
+   uninstalled_variables: [
+diff --git a/meson_options.txt b/meson_options.txt
+index f9d558c..3cac593 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -9,6 +9,11 @@ option('enable-gir',
+   choices: ['auto', 'true', 'false'],
+   description: 'gobject introspection .gir generation'
+ )
++option('prefix-dev',
++  type: 'string',
++  value: '',
++  description: 'Like prefix but for dev output of the package'
++)
+ option('enable-vapi',
+   type: 'boolean',
+   value: 'true',