2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, glib
|
|
|
|
, meson
|
|
|
|
, ninja
|
2022-09-14 18:05:37 +00:00
|
|
|
, nixosTests
|
2021-03-09 03:18:52 +00:00
|
|
|
, pkg-config
|
|
|
|
, gettext
|
2023-10-19 13:55:26 +00:00
|
|
|
, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
|
2023-03-15 16:39:30 +00:00
|
|
|
, buildPackages
|
2021-03-09 03:18:52 +00:00
|
|
|
, gobject-introspection
|
2021-12-06 16:07:01 +00:00
|
|
|
, gi-docgen
|
2022-08-12 12:06:08 +00:00
|
|
|
, libxslt
|
|
|
|
, fixDarwinDylibNames
|
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";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.8.0";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
outputs = [ "out" "dev" "installedTests" ]
|
|
|
|
++ 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";
|
2024-01-02 11:29:13 +00:00
|
|
|
sha256 = "l+9euSyoEQOa1Qpl8GYz8armR5J4kwe+cXB5XYsxlFQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
patches = [
|
|
|
|
# Add option for changing installation path of installed tests.
|
|
|
|
./meson-add-installed-tests-prefix-option.patch
|
|
|
|
];
|
|
|
|
|
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
|
2022-08-12 12:06:08 +00:00
|
|
|
libxslt
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2022-08-12 12:06:08 +00:00
|
|
|
fixDarwinDylibNames
|
2023-03-15 16:39:30 +00:00
|
|
|
] ++ lib.optionals withIntrospection [
|
|
|
|
gobject-introspection
|
|
|
|
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
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
2023-03-15 16:39:30 +00:00
|
|
|
(lib.mesonEnable "introspection" withIntrospection)
|
|
|
|
(lib.mesonEnable "gtk_doc" withIntrospection)
|
2022-09-14 18:05:37 +00:00
|
|
|
];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
|
|
|
|
# it should be a build-time dep for build
|
|
|
|
# TODO: send upstream
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace doc/meson.build \
|
|
|
|
--replace "'gi-docgen', ver" "'gi-docgen', native:true, ver" \
|
|
|
|
--replace "'gi-docgen', req" "'gi-docgen', native:true, req"
|
|
|
|
'';
|
2021-05-20 23:08:51 +00:00
|
|
|
|
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 = {
|
2022-09-14 18:05:37 +00:00
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.json-glib;
|
|
|
|
};
|
|
|
|
|
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";
|
2024-05-15 15:35:15 +00:00
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/json-glib";
|
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;
|
|
|
|
};
|
|
|
|
}
|