push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,158 @@
{
lib,
stdenv,
buildPackages,
replaceVars,
fetchFromGitHub,
fetchpatch,
meson,
mesonEmulatorHook,
appstream,
ninja,
pkg-config,
cmake,
gettext,
xmlto,
docbook-xsl-nons,
docbook_xml_dtd_45,
libxslt,
libstemmer,
glib,
xapian,
libxml2,
libxmlb,
libyaml,
gobject-introspection,
itstool,
gperf,
vala,
curl,
cairo,
gdk-pixbuf,
pango,
librsvg,
systemd,
nixosTests,
testers,
withIntrospection ?
lib.meta.availableOn stdenv.hostPlatform gobject-introspection
&& stdenv.hostPlatform.emulatorAvailable buildPackages,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "appstream";
version = "1.0.4";
outputs = [
"out"
"dev"
"installedTests"
];
src = fetchFromGitHub {
owner = "ximion";
repo = "appstream";
rev = "v${finalAttrs.version}";
sha256 = "sha256-UnSJcXH0yWK/dPKgbOx9x3iJjKcKNYFkD2Qs5c3FtM8=";
};
patches = [
# Fix hardcoded paths
(replaceVars ./fix-paths.patch {
libstemmer_includedir = "${lib.getDev libstemmer}/include";
})
# Allow installing installed tests to a separate output.
./installed-tests-path.patch
(fetchpatch {
name = "static.patch";
url = "https://github.com/ximion/appstream/commit/90675d8853188f65897d2453346cb0acd531b58f.patch";
hash = "sha256-d3h5h7B/MP3Sun5YwYCqMHcw4PMMwg1YS/S9vsMzkQ4=";
})
];
strictDeps = true;
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
meson
ninja
pkg-config
cmake
gettext
libxslt
xmlto
docbook-xsl-nons
docbook_xml_dtd_45
glib
itstool
gperf
]
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
]
++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [
appstream
]
++ lib.optionals withIntrospection [
gobject-introspection
vala
];
buildInputs = [
libstemmer
glib
xapian
libxml2
libxmlb
libyaml
curl
cairo
gdk-pixbuf
pango
librsvg
]
++ lib.optionals withSystemd [
systemd
];
mesonFlags = [
"-Dapidocs=false"
"-Dc_args=-Wno-error=missing-include-dirs"
"-Ddocs=false"
"-Dvapi=true"
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
"-Dcompose=true"
(lib.mesonBool "gir" withIntrospection)
]
++ lib.optionals (!withSystemd) [
"-Dsystemd=false"
];
passthru.tests = {
installed-tests = nixosTests.installed-tests.appstream;
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
};
meta = with lib; {
description = "Software metadata handling library";
longDescription = ''
AppStream is a cross-distro effort for building Software-Center applications
and enhancing metadata provided by software components. It provides
specifications for meta-information which is shipped by upstream projects and
can be consumed by other software.
'';
homepage = "https://www.freedesktop.org/wiki/Distributions/AppStream/";
license = licenses.lgpl21Plus;
mainProgram = "appstreamcli";
platforms = platforms.unix;
pkgConfigModules = [ "appstream" ];
};
})

View File

@@ -0,0 +1,17 @@
diff --git a/meson.build b/meson.build
index 5e7f57d5..3fe89e8c 100644
--- a/meson.build
+++ b/meson.build
@@ -171,10 +171,10 @@ endif
stemmer_inc_dirs = include_directories()
if get_option('stemming')
stemmer_lib = cc.find_library('stemmer', required: true)
- stemmer_inc_dirs = include_directories(['/usr/include'])
+ stemmer_inc_dirs = include_directories(['@libstemmer_includedir@'])
if not cc.has_header('libstemmer.h')
if cc.has_header('libstemmer/libstemmer.h')
- stemmer_inc_dirs = include_directories('/usr/include/libstemmer')
+ stemmer_inc_dirs = include_directories('@libstemmer_includedir@/libstemmer')
else
error('Unable to find Snowball header "libstemmer.h". Please ensure libstemmer/Snowball is installed properly in order to continue.')
endif

View File

@@ -0,0 +1,27 @@
diff --git a/meson_options.txt b/meson_options.txt
index 8dd8e0c7..e2a30b06 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -44,6 +44,11 @@ option('install-docs',
value : true,
description : 'Install documentation for API and specification'
)
+option('installed_test_prefix',
+ type : 'string',
+ value : '',
+ description : 'Prefix for installed tests'
+)
#
# For development
diff --git a/tests/installed-tests/meson.build b/tests/installed-tests/meson.build
index 405820ce..f592a753 100644
--- a/tests/installed-tests/meson.build
+++ b/tests/installed-tests/meson.build
@@ -10,5 +10,5 @@ configure_file(
output : 'metainfo-validate.test',
configuration : itconf,
install: true,
- install_dir: join_paths('share', 'installed-tests', 'appstream'),
+ install_dir: join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', 'appstream'),
)

View File

@@ -0,0 +1,59 @@
{
lib,
stdenv,
appstream,
qtbase,
qttools,
nixosTests,
}:
# TODO: look into using the libraries from the regular appstream derivation as we keep duplicates here
let
qtSuffix = lib.optionalString (lib.versions.major qtbase.version == "5") "5";
in
stdenv.mkDerivation {
pname = "appstream-qt";
inherit (appstream) version src;
outputs = [
"out"
"dev"
"installedTests"
];
buildInputs = appstream.buildInputs ++ [
appstream
qtbase
];
nativeBuildInputs = appstream.nativeBuildInputs ++ [ qttools ];
mesonFlags = appstream.mesonFlags ++ [
(lib.mesonBool "qt" true)
(lib.mesonOption "qt-versions" (lib.versions.major qtbase.version))
];
patches = appstream.patches;
dontWrapQtApps = true;
# AppStreamQt tries to be relocatable, in hacky cmake ways that generally fail
# horribly on NixOS. Just hardcode the paths.
postFixup = ''
sed -i "$dev/lib/cmake/AppStreamQt${qtSuffix}/AppStreamQt${qtSuffix}Config.cmake" \
-e "/INTERFACE_INCLUDE_DIRECTORIES/ s@\''${PACKAGE_PREFIX_DIR}@$dev@"
sed -i "$dev/lib/cmake/AppStreamQt${qtSuffix}/AppStreamQt${qtSuffix}Config.cmake" \
-e "/IMPORTED_LOCATION/ s@\''${PACKAGE_PREFIX_DIR}@$out@"
'';
passthru = appstream.passthru // {
tests = {
installed-tests = nixosTests.installed-tests.appstream-qt;
};
};
meta = appstream.meta // {
description = "Software metadata handling library - Qt";
};
}