nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchurl,
5 meson,
6 ninja,
7 pkg-config,
8 gi-docgen,
9 gobject-introspection,
10 lcms2,
11 vala,
12}:
13
14stdenv.mkDerivation (finalAttrs: {
15 pname = "babl";
16 version = "0.1.122";
17
18 outputs = [
19 "out"
20 "dev"
21 "devdoc"
22 ];
23
24 src = fetchurl {
25 url = "https://download.gimp.org/pub/babl/${lib.versions.majorMinor finalAttrs.version}/babl-${finalAttrs.version}.tar.xz";
26 hash = "sha256-aFH3Bc2jjy3wikuoYYJ5zjDQpG+Vf+aqMlt7feKXvtI=";
27 };
28
29 patches = [
30 # Allow overriding path to dev output that will be hardcoded e.g. in pkg-config file.
31 ./dev-prefix.patch
32 ];
33
34 nativeBuildInputs = [
35 meson
36 ninja
37 pkg-config
38 gi-docgen
39 gobject-introspection
40 vala
41 ];
42
43 buildInputs = [
44 lcms2
45 ];
46
47 mesonFlags = [
48 "-Dprefix-dev=${placeholder "dev"}"
49 # On Linux, this would be disabled by default but we have -Dauto_features=enabled.
50 # Disable it on other platforms too, since I cannot test it there.
51 "-Drelocatable=disabled"
52 ]
53 ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
54 # Docs are opt-out in native but opt-in in cross builds.
55 "-Dwith-docs=true"
56 "-Denable-gir=true"
57 ];
58
59 postFixup = ''
60 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
61 moveToOutput "share/doc" "$devdoc"
62 '';
63
64 meta = {
65 description = "Image pixel format conversion library";
66 mainProgram = "babl";
67 homepage = "https://gegl.org/babl/";
68 changelog = "https://gitlab.gnome.org/GNOME/babl/-/blob/BABL_${
69 lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version
70 }/NEWS";
71 license = lib.licenses.lgpl3Plus;
72 maintainers = with lib.maintainers; [ jtojnar ];
73 platforms = lib.platforms.unix;
74 };
75})