nixpkgs/pkgs/by-name/ba/babl/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

65 lines
1.5 KiB
Nix

{ stdenv
, lib
, fetchurl
, meson
, ninja
, pkg-config
, gi-docgen
, gobject-introspection
, lcms2
, vala
}:
stdenv.mkDerivation (finalAttrs: {
pname = "babl";
version = "0.1.110";
outputs = [ "out" "dev" "devdoc" ];
src = fetchurl {
url = "https://download.gimp.org/pub/babl/${lib.versions.majorMinor finalAttrs.version}/babl-${finalAttrs.version}.tar.xz";
hash = "sha256-v0e+dUDWJ1OJ9mQx7wMGTfU3YxXiQ9C6tEjGqnE/V0M=";
};
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
];
buildInputs = [
lcms2
];
mesonFlags = [
"-Dprefix-dev=${placeholder "dev"}"
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
# Docs are opt-out in native but opt-in in cross builds.
"-Dwith-docs=true"
"-Denable-gir=true"
];
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";
homepage = "https://gegl.org/babl/";
changelog = "https://gitlab.gnome.org/GNOME/babl/-/blob/BABL_${replaceStrings [ "." ] [ "_" ] finalAttrs.version}/NEWS";
license = licenses.lgpl3Plus;
maintainers = with maintainers; [ jtojnar ];
platforms = platforms.unix;
};
})