2021-02-10 21:56:25 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, glib
|
|
|
|
, meson
|
|
|
|
, ninja
|
2022-08-20 06:45:18 +00:00
|
|
|
, nixosTests
|
2021-02-10 21:56:25 +00:00
|
|
|
, pkg-config
|
|
|
|
, gettext
|
2023-10-12 13:13:57 +00:00
|
|
|
, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
|
2023-02-06 18:05:04 +00:00
|
|
|
, buildPackages
|
2021-02-10 21:56:25 +00:00
|
|
|
, gobject-introspection
|
2021-10-20 15:59:17 +00:00
|
|
|
, gi-docgen
|
2022-07-07 18:34:37 +00:00
|
|
|
, libxslt
|
|
|
|
, fixDarwinDylibNames
|
2021-05-07 21:18:14 +00:00
|
|
|
, gnome
|
2018-01-30 21:03:43 +00:00
|
|
|
}:
|
2010-09-27 11:18:28 +00:00
|
|
|
|
2021-02-10 21:56:25 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-05-31 17:14:38 +00:00
|
|
|
pname = "json-glib";
|
2023-09-24 09:37:03 +00:00
|
|
|
version = "1.8.0";
|
2021-02-10 21:56:25 +00:00
|
|
|
|
2023-02-06 18:05:04 +00:00
|
|
|
outputs = [ "out" "dev" "installedTests" ]
|
|
|
|
++ lib.optional withIntrospection "devdoc";
|
2010-09-27 11:18:28 +00:00
|
|
|
|
2015-04-05 05:22:12 +00:00
|
|
|
src = fetchurl {
|
2021-02-10 21:56:25 +00:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2023-09-24 09:37:03 +00:00
|
|
|
sha256 = "l+9euSyoEQOa1Qpl8GYz8armR5J4kwe+cXB5XYsxlFQ=";
|
2010-09-27 11:18:28 +00:00
|
|
|
};
|
|
|
|
|
2022-08-20 06:45:18 +00:00
|
|
|
patches = [
|
|
|
|
# Add option for changing installation path of installed tests.
|
|
|
|
./meson-add-installed-tests-prefix-option.patch
|
|
|
|
];
|
|
|
|
|
2021-03-19 10:38:29 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2021-02-10 21:56:25 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
gettext
|
|
|
|
glib
|
2022-07-07 18:34:37 +00:00
|
|
|
libxslt
|
2022-10-06 16:38:53 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2022-07-07 18:34:37 +00:00
|
|
|
fixDarwinDylibNames
|
2023-02-06 18:05:04 +00:00
|
|
|
] ++ lib.optionals withIntrospection [
|
|
|
|
gobject-introspection
|
|
|
|
gi-docgen
|
2021-02-10 21:56:25 +00:00
|
|
|
];
|
2010-09-27 11:18:28 +00:00
|
|
|
|
2021-02-10 21:56:25 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
];
|
2016-12-09 14:47:12 +00:00
|
|
|
|
2022-08-20 06:45:18 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
2023-02-06 18:05:04 +00:00
|
|
|
(lib.mesonEnable "introspection" withIntrospection)
|
|
|
|
(lib.mesonEnable "gtk_doc" withIntrospection)
|
2022-08-20 06:45:18 +00:00
|
|
|
];
|
2022-07-07 18:34:37 +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-03-19 10:38:29 +00:00
|
|
|
|
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 = {
|
2022-08-20 06:45:18 +00:00
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.json-glib;
|
|
|
|
};
|
|
|
|
|
2021-05-07 21:18:14 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2018-05-31 17:14:38 +00:00
|
|
|
packageName = pname;
|
2021-03-20 23:57:24 +00:00
|
|
|
versionPolicy = "odd-unstable";
|
2018-05-31 17:14:38 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2010-09-27 11:18:28 +00:00
|
|
|
description = "A library providing (de)serialization support for the JavaScript Object Notation (JSON) format";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://wiki.gnome.org/Projects/JsonGlib";
|
2021-02-10 21:56:25 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = teams.gnome.members;
|
2016-08-02 17:50:55 +00:00
|
|
|
platforms = with platforms; unix;
|
2010-09-27 11:18:28 +00:00
|
|
|
};
|
|
|
|
}
|