git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #161837 from bobby285271/appstream

appstream: 0.14.4 → 0.15.2

commitf02094df7281aa6fecd32bcb0f78e649ceb8fef2 authordavidak <davidak@users.noreply.github.com> dateWed 9 Mar 2022, 17:29 (5 years ago) parent06c57312bfd5ce
9 files changed+147−17
nixos/tests/installed-tests/appstream-qt.nix+9 nixos/tests/installed-tests/appstream.nix+9 nixos/tests/installed-tests/default.nix+2 pkgs/development/libraries/appstream/default.nix+20−6 pkgs/development/libraries/appstream/fix-build-for-qt-olderthan-514.patch+43 pkgs/development/libraries/appstream/fix-paths.patch+10−7 pkgs/development/libraries/appstream/installed-tests-path.patch+27 pkgs/development/libraries/appstream/qt.nix+18−3 pkgs/development/libraries/libxmlb/default.nix+9−1
nixos/tests/installed-tests/appstream-qt.nixnew file+9
@@ -0,0 +1,9 @@
1+{ pkgs, makeInstalledTest, ... }:
2+
3+makeInstalledTest {
4+ tested = pkgs.libsForQt5.appstream-qt;
5+
6+ testConfig = {
7+ appstream.enable = true;
8+ };
9+}
nixos/tests/installed-tests/appstream.nixnew file+9
@@ -0,0 +1,9 @@
1+{ pkgs, makeInstalledTest, ... }:
2+
3+makeInstalledTest {
4+ tested = pkgs.appstream;
5+
6+ testConfig = {
7+ appstream.enable = true;
8+ };
9+}
nixos/tests/installed-tests/default.nix+2
@@ -84,6 +84,8 @@ let
8484in
8585
8686{
87+ appstream = callInstalledTest ./appstream.nix {};
88+ appstream-qt = callInstalledTest ./appstream-qt.nix {};
8789 colord = callInstalledTest ./colord.nix {};
8890 flatpak = callInstalledTest ./flatpak.nix {};
8991 flatpak-builder = callInstalledTest ./flatpak-builder.nix {};
pkgs/development/libraries/appstream/default.nix+20−6
@@ -14,27 +14,31 @@
1414, glib
1515, xapian
1616, libxml2
17+, libxmlb
1718, libyaml
1819, gobject-introspection
1920, pcre
2021, itstool
2122, gperf
2223, vala
23−, lmdb
2424, curl
25+, nixosTests
2526}:
2627
2728stdenv.mkDerivation rec {
2829 pname = "appstream";
29− version = "0.14.4";
30+ version = "0.15.2";
31+ # When bumping this package, please also check whether
32+ # fix-build-for-qt-olderthan-514.patch still applies by
33+ # building libsForQt512.appstream-qt.
3034
31− outputs = [ "out" "dev" ];
35+ outputs = [ "out" "dev" "installedTests" ];
3236
3337 src = fetchFromGitHub {
3438 owner = "ximion";
3539 repo = "appstream";
3640 rev = "v${version}";
37− sha256 = "sha256-DJXCw50f+8c58bJw6xx0ECfkc9/KcWaeA+ne2zmTyhg=";
41+ sha256 = "sha256-/JZ49wjtcInbGUOVVjevVSrLCHcA60FMT165rhfb78Q=";
3842 };
3943
4044 patches = [
@@ -43,6 +47,9 @@ stdenv.mkDerivation rec {
4347 src = ./fix-paths.patch;
4448 libstemmer_includedir = "${lib.getDev libstemmer}/include";
4549 })
50+
51+ # Allow installing installed tests to a separate output.
52+ ./installed-tests-path.patch
4653 ];
4754
4855 nativeBuildInputs = [
@@ -65,9 +72,9 @@ stdenv.mkDerivation rec {
6572 glib
6673 xapian
6774 libxml2
75+ libxmlb
6876 libyaml
6977 gperf
70− lmdb
7178 curl
7279 ];
7380
@@ -75,8 +82,15 @@ stdenv.mkDerivation rec {
7582 "-Dapidocs=false"
7683 "-Ddocs=false"
7784 "-Dvapi=true"
85+ "-Dinstalled_test_prefix=${placeholder "installedTests"}"
7886 ];
7987
88+ passthru = {
89+ tests = {
90+ installed-tests = nixosTests.installed-tests.appstream;
91+ };
92+ };
93+
8094 meta = with lib; {
8195 description = "Software metadata handling library";
8296 homepage = "https://www.freedesktop.org/wiki/Distributions/AppStream/";
@@ -88,5 +102,5 @@ stdenv.mkDerivation rec {
88102 '';
89103 license = licenses.lgpl21Plus;
90104 platforms = platforms.unix;
91− };
105+ };
92106}
pkgs/development/libraries/appstream/fix-build-for-qt-olderthan-514.patchnew file+43
@@ -0,0 +1,43 @@
1+diff --git a/qt/component.h b/qt/component.h
2+index 47abd1f3..74de943c 100644
3+--- a/qt/component.h
4++++ b/qt/component.h
5+@@ -90,7 +90,7 @@ class APPSTREAMQT_EXPORT Component {
6+ UrlKindContact,
7+
8+ // deprecated
9+- UrlTranslate [[deprecated]] = UrlKindTranslate,
10++ UrlTranslate = UrlKindTranslate,
11+ };
12+ Q_ENUM(UrlKind)
13+
14+diff --git a/qt/pool.h b/qt/pool.h
15+index b59829b7..5237f613 100644
16+--- a/qt/pool.h
17++++ b/qt/pool.h
18+@@ -70,9 +70,9 @@ public:
19+ FlagMonitor = 1 << 7,
20+
21+ // deprecated
22+- FlagReadCollection [[deprecated]] = FlagLoadOsCollection,
23+- FlagReadMetainfo [[deprecated]] = FlagLoadOsMetainfo,
24+- FlagReadDesktopFiles [[deprecated]] = FlagLoadOsDesktopFiles,
25++ FlagReadCollection = FlagLoadOsCollection,
26++ FlagReadMetainfo = FlagLoadOsMetainfo,
27++ FlagReadDesktopFiles = FlagLoadOsDesktopFiles,
28+ };
29+
30+ /**
31+@@ -84,9 +84,9 @@ public:
32+ * Flags on how caching should be used.
33+ **/
34+ enum CacheFlags {
35+- CacheFlagNone [[deprecated]] = 0,
36+- CacheFlagUseUser [[deprecated]] = 1 << 0,
37+- CacheFlagUseSystem [[deprecated]] = 1 << 1,
38++ CacheFlagNone = 0,
39++ CacheFlagUseUser = 1 << 0,
40++ CacheFlagUseSystem = 1 << 1,
41+ };
42+
43+ /**
pkgs/development/libraries/appstream/fix-paths.patch+10−7
@@ -1,18 +1,21 @@
11diff --git a/data/meson.build b/data/meson.build
2−index 1eb3dfb0..623b66ec 100644
2+index 53f31cb4..90f40e77 100644
33--- a/data/meson.build
44+++ b/data/meson.build
5−@@ -26,4 +26,4 @@ i18n.merge_file (
5+@@ -68,7 +68,7 @@ test('as-validate_metainfo.cli',
66 )
77
8− install_data ('appstream.conf',
9−- install_dir: get_option('sysconfdir'))
10−+ install_dir: get_option('prefix') / 'etc')
8+ install_data('appstream.conf',
9+- install_dir: get_option('sysconfdir'))
10++ install_dir: get_option('prefix') / 'etc')
11+
12+ if get_option('compose')
13+ ascompose_metainfo = 'org.freedesktop.appstream.compose.metainfo.xml'
1114diff --git a/meson.build b/meson.build
12−index dc1fb1a5..5ee03b73 100644
15+index 2efe86b7..9dc79e28 100644
1316--- a/meson.build
1417+++ b/meson.build
15−@@ -108,12 +108,12 @@ if get_option ('gir')
18+@@ -107,12 +107,12 @@ if get_option ('gir')
1619 dependency('gobject-introspection-1.0', version: '>=1.56')
1720 endif
1821
pkgs/development/libraries/appstream/installed-tests-path.patchnew file+27
@@ -0,0 +1,27 @@
1+diff --git a/meson_options.txt b/meson_options.txt
2+index 8dd8e0c7..e2a30b06 100644
3+--- a/meson_options.txt
4++++ b/meson_options.txt
5+@@ -44,6 +44,11 @@ option('install-docs',
6+ value : true,
7+ description : 'Install documentation for API and specification'
8+ )
9++option('installed_test_prefix',
10++ type : 'string',
11++ value : '',
12++ description : 'Prefix for installed tests'
13++)
14+
15+ #
16+ # For development
17+diff --git a/tests/installed-tests/meson.build b/tests/installed-tests/meson.build
18+index 405820ce..f592a753 100644
19+--- a/tests/installed-tests/meson.build
20++++ b/tests/installed-tests/meson.build
21+@@ -10,5 +10,5 @@ configure_file(
22+ output : 'metainfo-validate.test',
23+ configuration : itconf,
24+ install: true,
25+- install_dir: join_paths('share', 'installed-tests', 'appstream'),
26++ install_dir: join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', 'appstream'),
27+ )
pkgs/development/libraries/appstream/qt.nix+18−3
@@ -1,12 +1,12 @@
1−{ mkDerivation, appstream, qtbase, qttools }:
1+{ lib, mkDerivation, appstream, qtbase, qttools, nixosTests }:
22
33# TODO: look into using the libraries from the regular appstream derivation as we keep duplicates here
44
55mkDerivation {
66 pname = "appstream-qt";
7− inherit (appstream) version src patches;
7+ inherit (appstream) version src;
88
9− outputs = [ "out" "dev" ];
9+ outputs = [ "out" "dev" "installedTests" ];
1010
1111 buildInputs = appstream.buildInputs ++ [ appstream qtbase ];
1212
@@ -14,11 +14,26 @@ mkDerivation {
1414
1515 mesonFlags = appstream.mesonFlags ++ [ "-Dqt=true" ];
1616
17+ patches = (appstream.patches or []) ++ lib.optionals (lib.versionOlder qtbase.version "5.14") [
18+ # Fix darwin build for libsForQt5.appstream-qt
19+ # Old Qt moc doesn't know about fancy C++14 features
20+ # ../qt/component.h:93: Parse error at "UrlTranslate"
21+ # Remove both this patch and related comment in default.nix
22+ # once Qt 5.14 or later becomes default on darwin
23+ ./fix-build-for-qt-olderthan-514.patch
24+ ];
25+
1726 postFixup = ''
1827 sed -i "$dev/lib/cmake/AppStreamQt/AppStreamQtConfig.cmake" \
1928 -e "/INTERFACE_INCLUDE_DIRECTORIES/ s@\''${PACKAGE_PREFIX_DIR}@$dev@"
2029 '';
2130
31+ passthru = appstream.passthru // {
32+ tests = {
33+ installed-tests = nixosTests.installed-tests.appstream-qt;
34+ };
35+ };
36+
2237 meta = appstream.meta // {
2338 description = "Software metadata handling library - Qt";
2439 };
pkgs/development/libraries/libxmlb/default.nix+9−1
@@ -1,6 +1,7 @@
11{ stdenv
22, lib
33, fetchFromGitHub
4+, fetchpatch
45, docbook_xml_dtd_43
56, docbook_xsl
67, glib
@@ -30,6 +31,13 @@ stdenv.mkDerivation rec {
3031
3132 patches = [
3233 ./installed-tests-path.patch
34+ # Fix darwin build, can be removed on next release
35+ # `--version-script` isn't supported by the macOS linker
36+ # https://github.com/hughsie/libxmlb/pull/119
37+ (fetchpatch {
38+ url = "https://github.com/hughsie/libxmlb/commit/d83aac5bd78cfbbfa2ecd428ff54b811071dfe4d.patch";
39+ sha256 = "sha256-UNRMbyNzdxfTZ8xV6J8a622hPnr3mowooP1q8Dg19yw=";
40+ })
3341 ];
3442
3543 nativeBuildInputs = [
@@ -72,6 +80,6 @@ stdenv.mkDerivation rec {
7280 homepage = "https://github.com/hughsie/libxmlb";
7381 license = licenses.lgpl21Plus;
7482 maintainers = with maintainers; [ jtojnar ];
75− platforms = platforms.linux;
83+ platforms = platforms.unix;
7684 };
7785}