2022-03-10 19:12:11 +00:00
|
|
|
{ lib, mkDerivation, appstream, qtbase, qttools, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# TODO: look into using the libraries from the regular appstream derivation as we keep duplicates here
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
mkDerivation {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "appstream-qt";
|
2022-03-10 19:12:11 +00:00
|
|
|
inherit (appstream) version src;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
outputs = [ "out" "dev" "installedTests" ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = appstream.buildInputs ++ [ appstream qtbase ];
|
|
|
|
|
|
|
|
nativeBuildInputs = appstream.nativeBuildInputs ++ [ qttools ];
|
|
|
|
|
|
|
|
mesonFlags = appstream.mesonFlags ++ [ "-Dqt=true" ];
|
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
patches = (appstream.patches or []) ++ lib.optionals (lib.versionOlder qtbase.version "5.14") [
|
|
|
|
# Fix darwin build for libsForQt5.appstream-qt
|
|
|
|
# Old Qt moc doesn't know about fancy C++14 features
|
|
|
|
# ../qt/component.h:93: Parse error at "UrlTranslate"
|
|
|
|
# Remove both this patch and related comment in default.nix
|
|
|
|
# once Qt 5.14 or later becomes default on darwin
|
|
|
|
./fix-build-for-qt-olderthan-514.patch
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
postFixup = ''
|
|
|
|
sed -i "$dev/lib/cmake/AppStreamQt/AppStreamQtConfig.cmake" \
|
|
|
|
-e "/INTERFACE_INCLUDE_DIRECTORIES/ s@\''${PACKAGE_PREFIX_DIR}@$dev@"
|
|
|
|
'';
|
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
passthru = appstream.passthru // {
|
|
|
|
tests = {
|
|
|
|
installed-tests = nixosTests.installed-tests.appstream-qt;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = appstream.meta // {
|
|
|
|
description = "Software metadata handling library - Qt";
|
|
|
|
};
|
|
|
|
}
|