nixpkgs/pkgs/development/libraries/json-glib/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 lines
1.9 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchurl
, glib
, meson
, ninja
, pkg-config
, gettext
, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
, gobject-introspection
, fixDarwinDylibNames
2021-10-20 15:59:17 +00:00
, gi-docgen
, gnome
}:
stdenv.mkDerivation rec {
2018-05-31 17:14:38 +00:00
pname = "json-glib";
2021-10-20 15:59:17 +00:00
version = "1.6.6";
outputs = [ "out" "dev" ]
++ lib.optional withIntrospection "devdoc";
2015-04-05 05:22:12 +00:00
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
2021-10-20 15:59:17 +00:00
sha256 = "luyYvnqR9t3jNjZyDj2i/27LuQ52zKpJSX8xpoVaSQ4=";
};
strictDeps = true;
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
meson
ninja
pkg-config
gettext
glib
] ++ lib.optional stdenv.hostPlatform.isDarwin [
fixDarwinDylibNames
] ++ lib.optionals withIntrospection [
gobject-introspection
2021-10-20 15:59:17 +00:00
gi-docgen
];
propagatedBuildInputs = [
glib
];
2016-12-09 14:47:12 +00:00
mesonFlags = lib.optionals (!withIntrospection) [
"-Dintrospection=disabled"
2021-10-20 15:59:17 +00:00
# gi-docgen relies on introspection data
"-Dgtk_doc=disabled"
];
2017-10-12 21:30:40 +00:00
doCheck = true;
2021-10-20 15:59:17 +00:00
postFixup = ''
# Move developer documentation to devdoc output.
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
if [[ -d "$out/share/doc" ]]; then
find -L "$out/share/doc" -type f -regex '.*\.devhelp2?' -print0 \
| while IFS= read -r -d ''' file; do
moveToOutput "$(dirname "''${file/"$out/"/}")" "$devdoc"
done
fi
'';
2018-05-31 17:14:38 +00:00
passthru = {
updateScript = gnome.updateScript {
2018-05-31 17:14:38 +00:00
packageName = pname;
versionPolicy = "odd-unstable";
2018-05-31 17:14:38 +00:00
};
};
meta = with lib; {
description = "A library providing (de)serialization support for the JavaScript Object Notation (JSON) format";
homepage = "https://wiki.gnome.org/Projects/JsonGlib";
license = licenses.lgpl21Plus;
maintainers = teams.gnome.members;
platforms = with platforms; unix;
};
}