2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, glib
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, gettext
|
2021-05-20 23:08:51 +00:00
|
|
|
, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
|
2021-03-09 03:18:52 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, fixDarwinDylibNames
|
2021-12-06 16:07:01 +00:00
|
|
|
, gi-docgen
|
2021-05-20 23:08:51 +00:00
|
|
|
, gnome
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "json-glib";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.6.6";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
outputs = [ "out" "dev" ]
|
|
|
|
++ lib.optional withIntrospection "devdoc";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-03-09 03:18:52 +00:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "luyYvnqR9t3jNjZyDj2i/27LuQ52zKpJSX8xpoVaSQ4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
gettext
|
|
|
|
glib
|
|
|
|
] ++ lib.optional stdenv.hostPlatform.isDarwin [
|
|
|
|
fixDarwinDylibNames
|
2021-05-20 23:08:51 +00:00
|
|
|
] ++ lib.optionals withIntrospection [
|
|
|
|
gobject-introspection
|
2021-12-06 16:07:01 +00:00
|
|
|
gi-docgen
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
mesonFlags = lib.optionals (!withIntrospection) [
|
|
|
|
"-Dintrospection=disabled"
|
2021-12-06 16:07:01 +00:00
|
|
|
# gi-docgen relies on introspection data
|
2021-05-20 23:08:51 +00:00
|
|
|
"-Dgtk_doc=disabled"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-12-06 16:07:01 +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
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru = {
|
2021-05-20 23:08:51 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2020-04-24 23:36:52 +00:00
|
|
|
packageName = pname;
|
2021-05-20 23:08:51 +00:00
|
|
|
versionPolicy = "odd-unstable";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library providing (de)serialization support for the JavaScript Object Notation (JSON) format";
|
|
|
|
homepage = "https://wiki.gnome.org/Projects/JsonGlib";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = teams.gnome.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = with platforms; unix;
|
|
|
|
};
|
|
|
|
}
|