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,51 @@
{
stdenvNoCC,
lib,
fetchFromGitLab,
cmake,
qtbase,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "cmake-extras";
version = "1.9";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/cmake-extras";
tag = finalAttrs.version;
hash = "sha256-7dIuQ2SdtpG93cPZTmoxXUCwFhsq11gmg4OJlGTQ3VY=";
};
postPatch = ''
# We have nothing to build here, no need to depend on a C compiler
substituteInPlace CMakeLists.txt \
--replace-fail 'project(cmake-extras' 'project(cmake-extras LANGUAGES NONE'
# This is in a function that reverse dependencies use to determine where to install their files to
substituteInPlace src/QmlPlugins/QmlPluginsConfig.cmake \
--replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt\''${QT_VERSION_MAJOR}/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
'';
strictDeps = true;
# Produces no binaries
dontWrapQtApps = true;
nativeBuildInputs = [
cmake
];
buildInputs = [
qtbase
];
meta = {
description = "Collection of add-ons for the CMake build tool";
homepage = "https://gitlab.com/ubports/development/core/cmake-extras";
changelog = "https://gitlab.com/ubports/development/core/cmake-extras/-/blob/${finalAttrs.version}/ChangeLog";
license = lib.licenses.gpl3Only;
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,76 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
testers,
cmake,
pkg-config,
cmake-extras,
gtest,
yaml-cpp,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "deviceinfo";
version = "0.2.4";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/deviceinfo";
rev = finalAttrs.version;
hash = "sha256-eZQyTRhMRobufPk5AcTY8G718T+/e3teFtqV5kGspxw=";
};
outputs = [
"out"
"dev"
"bin"
];
postPatch = ''
# For our automatic pkg-config output patcher to work, prefix must be used here
substituteInPlace headers/deviceinfo.pc.in \
--replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
cmake-extras
yaml-cpp
];
checkInputs = [
gtest
];
cmakeFlags = [
"-DDISABLE_TESTS=${lib.boolToString (!finalAttrs.finalPackage.doCheck)}"
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = with lib; {
description = "Library to detect and configure devices";
homepage = "https://gitlab.com/ubports/development/core/deviceinfo";
changelog = "https://gitlab.com/ubports/development/core/deviceinfo/-/blob/${finalAttrs.version}/ChangeLog";
license = licenses.gpl3Only;
teams = [ teams.lomiri ];
platforms = platforms.linux;
mainProgram = "device-info";
pkgConfigModules = [
"deviceinfo"
];
};
})

View File

@@ -0,0 +1,122 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
testers,
buildPackages,
cmake,
docbook-xsl-nons,
docbook_xml_dtd_45,
gettext,
glib,
glibcLocales,
withExamples ? true,
gtk3,
# Uses gtkdoc-scan* tools, which produces a binary linked against lib for hostPlatform and executes it to generate docs
withDocumentation ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
gtk-doc,
pkg-config,
validatePkgConfig,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "geonames";
version = "0.3.1";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/geonames";
rev = finalAttrs.version;
hash = "sha256-AhRnUoku17kVY0UciHQXFDa6eCH6HQ4ZGIOobCaGTKQ=";
};
outputs = [
"out"
"dev"
]
++ lib.optionals withExamples [
"bin"
]
++ lib.optionals withDocumentation [
"devdoc"
];
postPatch = ''
patchShebangs src/generate-locales.sh tests/setup-test-env.sh
'';
strictDeps = true;
nativeBuildInputs = [
cmake
gettext
glib # glib-compile-resources
pkg-config
validatePkgConfig
]
++ lib.optionals withDocumentation [
docbook-xsl-nons
docbook_xml_dtd_45
gtk-doc
];
buildInputs = [
glib
]
++ lib.optionals withExamples [
gtk3
];
# Tests need to be able to check locale
LC_ALL = lib.optionalString finalAttrs.finalPackage.doCheck "en_US.UTF-8";
nativeCheckInputs = [
glibcLocales
];
makeFlags = [
# gtkdoc-scan runs ld, can't find qsort & strncpy symbols
"LD=${stdenv.cc.targetPrefix}cc"
];
cmakeFlags = [
(lib.cmakeBool "WANT_DOC" withDocumentation)
(lib.cmakeBool "WANT_DEMO" withExamples)
(lib.cmakeBool "WANT_TESTS" finalAttrs.finalPackage.doCheck)
# Keeps finding & using glib-compile-resources from buildInputs otherwise
(lib.cmakeFeature "CMAKE_PROGRAM_PATH" (lib.makeBinPath [ buildPackages.glib.dev ]))
]
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
# only for cross without native execute support because the canExecute "emulator" call has a format that I can't get CMake to accept
(lib.cmakeFeature "CMAKE_CROSSCOMPILING_EMULATOR" (stdenv.hostPlatform.emulator buildPackages))
];
preInstall = lib.optionalString withDocumentation ''
# gtkdoc-mkhtml generates images without write permissions, errors out during install
chmod +w doc/reference/html/*
'';
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = with lib; {
description = "Parse and query the geonames database dump";
mainProgram = "geonames-demo";
homepage = "https://gitlab.com/ubports/development/core/geonames";
changelog = "https://gitlab.com/ubports/development/core/geonames/-/blob/${finalAttrs.version}/ChangeLog";
license = licenses.gpl3Only;
teams = [ teams.lomiri ];
platforms = platforms.all;
# Cross requires hostPlatform emulation during build
# https://gitlab.com/ubports/development/core/geonames/-/issues/1
broken =
stdenv.buildPlatform != stdenv.hostPlatform && !stdenv.hostPlatform.emulatorAvailable buildPackages;
pkgConfigModules = [
"geonames"
];
};
})

View File

@@ -0,0 +1,104 @@
{
stdenv,
lib,
fetchFromGitLab,
fetchpatch,
gitUpdater,
testers,
cmake,
cmake-extras,
dbus,
dbus-test-runner,
glib,
gtest,
libqtdbustest,
lomiri-api,
pkg-config,
qtbase,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gmenuharness";
version = "0.1.4";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/gmenuharness";
rev = finalAttrs.version;
hash = "sha256-MswB8cQvz3JvcJL2zj7szUOBzKRjxzJO7/x+87m7E7c=";
};
patches = [
# Remove when version > 0.1.4
(fetchpatch {
name = "0001-gmenuharness-Rename-type-attribute-from-x-canonical-type-to-x-lomiri-type.patch";
url = "https://gitlab.com/ubports/development/core/gmenuharness/-/commit/70e9ed85792a6ac1950faaf26391ce91e69486ab.patch";
hash = "sha256-jeue0qrl2JZCt/Yfj4jT210wsF/E+MlbtNT/yFTcw5I=";
})
];
postPatch = ''
# GTest needs C++17
# Remove when https://gitlab.com/ubports/development/core/gmenuharness/-/merge_requests/5 merged & in release
substituteInPlace CMakeLists.txt \
--replace-fail 'std=c++14' 'std=c++17'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
cmake-extras
glib
lomiri-api
qtbase
];
nativeCheckInputs = [
dbus
dbus-test-runner
];
checkInputs = [
gtest
libqtdbustest
];
cmakeFlags = [
"-Denable_tests=${lib.boolToString finalAttrs.finalPackage.doCheck}"
];
dontWrapQtApps = true;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
enableParallelChecking = false;
checkPhase = ''
runHook preCheck
dbus-test-runner -t make -p test -p "''${enableParallelChecking:+-j $NIX_BUILD_CORES}"
runHook postCheck
'';
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = with lib; {
description = "Library to test GMenuModel structures";
homepage = "https://gitlab.com/ubports/development/core/gmenuharness";
license = licenses.gpl3Only;
teams = [ teams.lomiri ];
platforms = platforms.unix;
pkgConfigModules = [
"libgmenuharness"
];
};
})

View File

@@ -0,0 +1,133 @@
{
stdenv,
lib,
fetchFromGitLab,
fetchpatch,
gitUpdater,
testers,
cmake,
cmake-extras,
dbus,
doxygen,
glibcLocales,
gsettings-qt,
gtest,
intltool,
json-glib,
libapparmor,
libqtdbustest,
pkg-config,
qdjango,
qtbase,
qtdeclarative,
qtxmlpatterns,
ubports-click,
validatePkgConfig,
wrapQtAppsHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libusermetrics";
version = "1.3.3";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/libusermetrics";
rev = finalAttrs.version;
hash = "sha256-V4vxNyHMs2YYBILkpco79FN9xnooULgB+z2Kf3V0790=";
};
outputs = [
"out"
"dev"
"doc"
];
patches = [
# Remove when https://gitlab.com/ubports/development/core/libusermetrics/-/merge_requests/17 merged & in release
(fetchpatch {
name = "0001-libusermetrics-BUILD_TESTING.patch";
url = "https://gitlab.com/ubports/development/core/libusermetrics/-/commit/c1e4847601cc4522034a766755ce491d48132d77.patch";
hash = "sha256-UWc9/ngpuiSm0Rd6eBK/R3N/NwDRtMxie78seN3+y/8=";
})
];
postPatch = ''
# Tries to query QMake for QT_INSTALL_QML variable, would return broken paths into /build/qtbase-<commit> even if qmake was available
substituteInPlace src/modules/UserMetrics/CMakeLists.txt \
--replace-fail 'query_qmake(QT_INSTALL_QML QT_IMPORTS_DIR)' 'set(QT_IMPORTS_DIR "''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}")'
substituteInPlace doc/CMakeLists.txt \
--replace-fail "\''${CMAKE_INSTALL_FULL_DATAROOTDIR}/doc/libusermetrics-doc" "\''${CMAKE_INSTALL_DOCDIR}"
'';
strictDeps = true;
nativeBuildInputs = [
cmake
doxygen
intltool
pkg-config
validatePkgConfig
wrapQtAppsHook
];
buildInputs = [
cmake-extras
gsettings-qt
json-glib
libapparmor
qdjango
qtxmlpatterns
ubports-click
# Plugin
qtbase
];
# Tests need to be able to check locale
LC_ALL = lib.optionalString finalAttrs.finalPackage.doCheck "en_US.UTF-8";
nativeCheckInputs = [
dbus
glibcLocales
];
checkInputs = [
gtest
libqtdbustest
qtdeclarative
];
cmakeFlags = [
(lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
(lib.cmakeBool "GSETTINGS_COMPILE" true)
(lib.cmakeBool "ENABLE_CLICK" true)
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
preCheck = ''
export QT_PLUGIN_PATH=${lib.getBin qtbase}/lib/qt-${qtbase.version}/plugins/
export QML2_IMPORT_PATH=${lib.getBin qtdeclarative}/lib/qt-${qtbase.version}/qml/
'';
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = {
description = "Enables apps to locally store interesting numerical data for later presentation";
homepage = "https://gitlab.com/ubports/development/core/libusermetrics";
changelog = "https://gitlab.com/ubports/development/core/libusermetrics/-/blob/${finalAttrs.version}/ChangeLog";
license = lib.licenses.lgpl3Only;
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
mainProgram = "usermetricsinput";
pkgConfigModules = [
"libusermetricsinput-1"
"libusermetricsoutput-1"
];
};
})

View File

@@ -0,0 +1,115 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
makeFontsConf,
testers,
cmake,
cmake-extras,
dbus,
doxygen,
glib,
graphviz,
gtest,
libqtdbustest,
pkg-config,
python3,
qtbase,
qtdeclarative,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-api";
version = "0.2.2";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-api";
tag = finalAttrs.version;
hash = "sha256-+ttmtvt18NMKYfGntEXgBOSJ3lW9Bf55327XYIzxMh8=";
};
outputs = [
"out"
"dev"
"doc"
];
postPatch = ''
patchShebangs $(find test -name '*.py')
substituteInPlace data/liblomiri-api.pc.in \
--replace "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" '@CMAKE_INSTALL_FULL_LIBDIR@'
# Variable is queried via pkg-config by reverse dependencies
# TODO This is likely not supposed to be the regular Qt QML import prefix
# but otherwise i.e. lomiri-notifications cannot be found in lomiri
substituteInPlace CMakeLists.txt \
--replace 'SHELL_PLUGINDIR ''${CMAKE_INSTALL_LIBDIR}/lomiri/qml' 'SHELL_PLUGINDIR ${qtbase.qtQmlPrefix}'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
doxygen
graphviz
pkg-config
qtdeclarative
];
buildInputs = [
cmake-extras
glib
gtest
libqtdbustest
qtbase
qtdeclarative
];
nativeCheckInputs = [
dbus
python3
];
dontWrapQtApps = true;
env.FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
preBuild = ''
# Makes fontconfig produce less noise in logs
export HOME=$TMPDIR
'';
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
preCheck = ''
# needs minimal plugin and QtTest QML
export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
export QML2_IMPORT_PATH=${lib.getBin qtdeclarative}/${qtbase.qtQmlPrefix}
'';
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = {
description = "Lomiri API Library for integrating with the Lomiri shell";
homepage = "https://gitlab.com/ubports/development/core/lomiri-api";
license = with lib.licenses; [
lgpl3Only
gpl3Only
];
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [
"liblomiri-api"
"lomiri-shell-api"
"lomiri-shell-application"
"lomiri-shell-launcher"
"lomiri-shell-notifications"
];
};
})

View File

@@ -0,0 +1,59 @@
From e4fe87427f24aa9b506c15c0f73f298e8909aabe Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Fri, 31 May 2024 21:31:46 +0200
Subject: [PATCH] Inject current-system PATH
---
liblomiri-app-launch/jobs-systemd.cpp | 16 ++++++++++++++++
liblomiri-app-launch/jobs-systemd.h | 1 +
2 files changed, 17 insertions(+)
diff --git a/liblomiri-app-launch/jobs-systemd.cpp b/liblomiri-app-launch/jobs-systemd.cpp
index e9be801..246bea8 100644
--- a/liblomiri-app-launch/jobs-systemd.cpp
+++ b/liblomiri-app-launch/jobs-systemd.cpp
@@ -574,6 +574,20 @@ void SystemD::copyEnvByPrefix(const std::string& prefix, std::list<std::pair<std
}
}
+/* We don't have a normal PATH, so we need to inject our special one as a fallback & propagate it */
+void SystemD::setupNixosPath(std::list<std::pair<std::string, std::string>>& env)
+{
+ std::string newPath { "/run/current-system/sw/bin" };
+ char* oldPath = getenv("PATH");
+ if (oldPath != NULL && oldPath[0] != '\0')
+ {
+ newPath.insert(0, 1, ':');
+ newPath.insert(0, oldPath);
+ }
+ setenv("PATH", newPath.c_str(), true);
+ copyEnv("PATH", env);
+}
+
std::shared_ptr<Application::Instance> SystemD::launch(
const AppID& appId,
const std::string& job,
@@ -625,6 +639,8 @@ std::shared_ptr<Application::Instance> SystemD::launch(
copyEnv("DISPLAY", env);
+ setupNixosPath(env);
+
for (const auto& prefix : {"DBUS_", "MIR_", "LOMIRI_APP_LAUNCH_"})
{
copyEnvByPrefix(prefix, env);
diff --git a/liblomiri-app-launch/jobs-systemd.h b/liblomiri-app-launch/jobs-systemd.h
index fe35932..19bf44e 100644
--- a/liblomiri-app-launch/jobs-systemd.h
+++ b/liblomiri-app-launch/jobs-systemd.h
@@ -136,6 +136,7 @@ private:
static void copyEnv(const std::string& envname, std::list<std::pair<std::string, std::string>>& env);
static void copyEnvByPrefix(const std::string& prefix, std::list<std::pair<std::string, std::string>>& env);
static int envSize(std::list<std::pair<std::string, std::string>>& env);
+ static void setupNixosPath(std::list<std::pair<std::string, std::string>>& env);
static std::vector<std::string> parseExec(std::list<std::pair<std::string, std::string>>& env);
static void application_start_cb(GObject* obj, GAsyncResult* res, gpointer user_data);
--
2.42.0

View File

@@ -0,0 +1,156 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
testers,
cmake,
cmake-extras,
curl,
dbus,
dbus-test-runner,
dpkg,
gobject-introspection,
gtest,
json-glib,
libxkbcommon,
lomiri-api,
lttng-ust,
pkg-config,
properties-cpp,
python3,
systemd,
ubports-click,
validatePkgConfig,
zeitgeist,
withDocumentation ? true,
doxygen,
python3Packages,
sphinx,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-app-launch";
version = "0.1.12";
outputs = [
"out"
"dev"
]
++ lib.optionals withDocumentation [
"doc"
];
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-app-launch";
tag = finalAttrs.version;
hash = "sha256-vlSlQJysKmoGNmRtJ34FCI3p5bL7GDc8TjOljnKSiAE=";
};
patches = [
# Use /run/current-system/sw/bin fallback for desktop file Exec= lookups, propagate to launched applications
./2001-Inject-current-system-PATH.patch
];
postPatch = ''
patchShebangs tests/{desktop-hook-test.sh.in,repeat-until-pass.sh}
# used pkg_get_variable, cannot replace prefix
substituteInPlace data/CMakeLists.txt \
--replace-fail 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})'
substituteInPlace tests/jobs-systemd.cpp \
--replace-fail '^(/usr)?' '^(/nix/store/\\w+-bash-.+)?'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
dpkg # for setting LOMIRI_APP_LAUNCH_ARCH
gobject-introspection
lttng-ust
pkg-config
validatePkgConfig
]
++ lib.optionals withDocumentation [
doxygen
python3Packages.breathe
sphinx
];
buildInputs = [
cmake-extras
curl
dbus
json-glib
libxkbcommon
lomiri-api
lttng-ust
properties-cpp
systemd
ubports-click
zeitgeist
];
nativeCheckInputs = [
dbus
(python3.withPackages (
ps: with ps; [
python-dbusmock
]
))
];
checkInputs = [
dbus-test-runner
gtest
];
cmakeFlags = [
(lib.cmakeBool "ENABLE_MIRCLIENT" false)
(lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (
lib.concatStringsSep ";" [
# Exclude tests
"-E"
(lib.strings.escapeShellArg "(${
lib.concatStringsSep "|" [
# Flaky, randomly hangs
# https://gitlab.com/ubports/development/core/lomiri-app-launch/-/issues/19
"^helper-handshake-test"
]
})")
]
))
];
postBuild = lib.optionalString withDocumentation ''
make -C ../docs html
'';
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
postInstall = lib.optionalString withDocumentation ''
mkdir -p $doc/share/doc/lomiri-app-launch
mv ../docs/_build/html $doc/share/doc/lomiri-app-launch/
'';
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = {
description = "System and associated utilities to launch applications in a standard and confined way";
homepage = "https://gitlab.com/ubports/development/core/lomiri-app-launch";
changelog = "https://gitlab.com/ubports/development/core/lomiri-app-launch/-/blob/${finalAttrs.version}/ChangeLog";
license = lib.licenses.gpl3Only;
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [
"lomiri-app-launch-0"
];
};
})

View File

@@ -0,0 +1,165 @@
{
stdenv,
lib,
fetchFromGitLab,
fetchpatch,
testers,
cmake,
cmake-extras,
pkg-config,
wrapQtAppsHook,
gsettings-qt,
gtest,
libqtdbustest,
libqtdbusmock,
libuuid,
lomiri-api,
lomiri-app-launch,
lomiri-url-dispatcher,
lttng-ust,
mir_2_15,
process-cpp,
qtbase,
qtdeclarative,
qtsensors,
valgrind,
protobuf,
glm,
boost,
properties-cpp,
glib,
validatePkgConfig,
wayland,
xwayland,
}:
stdenv.mkDerivation (finalAttrs: {
# Not regular qtmir, experimental support for Mir 2.x
# Currently following https://gitlab.com/ubports/development/core/qtmir/-/tree/personal/sunweaver/debian-upstream
pname = "qtmir-debian-upstream";
version = "0.8.0-unstable-2024-03-06";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/qtmir";
rev = "de639c3a482ac6c59b9be02abb839a8c96158041";
hash = "sha256-AKSzkGl6bAoR4I2lolNRUp67VS/PiZnrPpCYtTlKWKc=";
};
outputs = [
"out"
"dev"
];
patches = [
# Mir 2.15 compatibility patch
# Remove when https://gitlab.com/ubports/development/core/qtmir/-/merge_requests/70 merged into branch
(fetchpatch {
name = "0001-qtmir-Update-for-Mir-2.15-removals.patch";
url = "https://gitlab.com/ubports/development/core/qtmir/-/commit/ead5cacd4d69094ab956627f4dd94ecaff1fd69e.patch";
hash = "sha256-hUUUnYwhNH3gm76J21M8gA5okaRd/Go03ZFJ4qn0JUo=";
})
# Remove when https://gitlab.com/ubports/development/core/qtmir/-/merge_requests/72 merged in branch
(fetchpatch {
name = "0002-qtmir-Add-more-better-GNUInstallDirs-variables-usage.patch";
url = "https://gitlab.com/ubports/development/core/qtmir/-/commit/87e2cd31052ce15e9625c1327807a320ee5d12af.patch";
hash = "sha256-MTE9tHw+xJhraEO1up7dLg0UIcmfHXgWOeuyYrVu2wc=";
})
# Remove when https://gitlab.com/ubports/development/core/qtmir/-/merge_requests/73 merged in branch
(fetchpatch {
name = "0003-qtmir-CMakeLists-Only-require-test-dependencies-when-building-tests.patch";
url = "https://gitlab.com/ubports/development/core/qtmir/-/commit/b7144e67bcbb4cfbd2283d5d05146fb22b7d8cd4.patch";
hash = "sha256-Afbj40MopztchDnk6fphTYk86YrQkiK8L1e/oXiL1Mw=";
})
# Remove when https://gitlab.com/ubports/development/core/qtmir/-/merge_requests/74 merged in branch
(fetchpatch {
name = "0004-qtmir-CMakeLists-Drop-call-of-Qt-internal-macro.patch";
url = "https://gitlab.com/ubports/development/core/qtmir/-/commit/8f9c599a4dbc4cf35e289157fd0c82df55b9f8d9.patch";
hash = "sha256-SMAErXnlMtVleWRPgO4xuUI7gAAy6W18LxtgXgetRA4=";
})
];
postPatch = ''
# 10s timeout for Mir startup is too tight for VM tests on weaker hardwre (aarch64)
substituteInPlace src/platforms/mirserver/qmirserver_p.cpp \
--replace-fail 'const int timeout = RUNNING_ON_VALGRIND ? 100 : 10' 'const int timeout = RUNNING_ON_VALGRIND ? 900 : 90' \
--replace-fail 'const int timeout = 10' 'const int timeout = 90'
substituteInPlace CMakeLists.txt \
--replace-fail "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" \
--replace-fail "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt5/plugins/platforms" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtPluginPrefix}/platforms" \
substituteInPlace data/xwayland.qtmir.desktop \
--replace-fail '/usr/bin/Xwayland' 'Xwayland'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
glib # glib-compile-schemas
lttng-ust
pkg-config
validatePkgConfig
wrapQtAppsHook
];
buildInputs = [
cmake-extras
boost
gsettings-qt
libuuid
lomiri-api
lomiri-app-launch
lomiri-url-dispatcher
lttng-ust
mir_2_15
process-cpp
protobuf
qtbase
qtdeclarative
qtsensors
valgrind
glm # included by mir header
wayland # mirwayland asks for this
properties-cpp # included by l-a-l header
];
propagatedBuildInputs = [
# Needs Xwayland on PATH for desktop file, else launching X11 applications crashes qtmir
xwayland
];
checkInputs = [
gtest
libqtdbustest
libqtdbusmock
];
cmakeFlags = [
(lib.cmakeBool "NO_TESTS" (!finalAttrs.finalPackage.doCheck))
(lib.cmakeBool "WITH_MIR2" true)
];
postInstall = ''
glib-compile-schemas $out/share/glib-2.0/schemas
'';
# Tests currently unavailable when building with Mir2
doCheck = false;
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
description = "QPA plugin to make Qt a Mir server";
homepage = "https://gitlab.com/ubports/development/core/qtmir";
license = licenses.lgpl3Only;
teams = [ teams.lomiri ];
platforms = platforms.linux;
pkgConfigModules = [ "qtmirserver" ];
};
})

View File

@@ -0,0 +1,57 @@
From dbd44fbdc580a83ce7fb67fe8d2c87acee087cb0 Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Mon, 20 Jan 2025 19:25:00 +0100
Subject: [PATCH] treewide: Switch to glog CMake module
---
CMakeLists.txt | 5 ++---
src/CMakeLists.txt | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f03c1c..b58d8ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,8 +38,9 @@ IF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage -fprofile-arcs" )
ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
-find_package(PkgConfig)
+find_package(PkgConfig REQUIRED)
find_package(Boost COMPONENTS filesystem program_options system REQUIRED)
+find_package(glog REQUIRED)
add_subdirectory(3rd_party/xdg)
@@ -56,7 +57,6 @@ if (TRUST_STORE_MIR_AGENT_ENABLED)
)
endif()
-pkg_check_modules(GLOG libglog REQUIRED)
pkg_check_modules(PROCESS_CPP process-cpp REQUIRED)
include(CTest)
@@ -66,7 +66,6 @@ include_directories(
3rd_party/xdg
${GFLAGS_INCLUDE_DIRS}
- ${GLOG_INCLUDE_DIRS}
${PROCESS_CPP_INCLUDE_DIRS}
)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ac87e7f..416549c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -211,7 +211,7 @@ target_link_libraries(
${Boost_LIBRARIES}
${DBUS_LIBRARIES}
${GFLAGS_LDFLAGS}
- ${GLOG_LDFLAGS}
+ glog::glog
${GLIB_LDFLAGS}
${GOBJECT_LDFLAGS}
${LIBAPPARMOR_LDFLAGS}
--
2.47.1

View File

@@ -0,0 +1,147 @@
{
stdenv,
lib,
fetchFromGitLab,
fetchpatch,
gitUpdater,
testers,
# dbus-cpp not compatible with Boost 1.87
# https://gitlab.com/ubports/development/core/lib-cpp/dbus-cpp/-/issues/8
boost186,
cmake,
cmake-extras,
dbus,
dbus-cpp,
doxygen,
gettext,
glog,
graphviz,
gtest,
libapparmor,
newt,
pkg-config,
process-cpp,
properties-cpp,
qtbase,
qtdeclarative,
validatePkgConfig,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "trust-store";
version = "2.0.2";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/trust-store";
rev = finalAttrs.version;
hash = "sha256-tVwqBu4py8kdydyKECZfLvcLijpZSQszeo8ytTDagy0=";
};
outputs = [
"out"
"dev"
"doc"
"bin"
];
patches = [
# Remove when version > 2.0.2
(fetchpatch {
name = "0001-trust-store-Fix-boost-184-compat.patch";
url = "https://gitlab.com/ubports/development/core/trust-store/-/commit/569f6b35d8bcdb2ae5ff84549cd92cfc0899675b.patch";
hash = "sha256-3lrdVIzscXGiLKwftC5oECICVv3sBoS4UedfRHx7uOs=";
})
# Fix compatibility with glog 0.7.x
# Remove when https://gitlab.com/ubports/development/core/trust-store/-/merge_requests/18 merged & in release
./1001-treewide-Switch-to-glog-CMake-module.patch
];
postPatch = ''
# pkg-config patching hook expects prefix variable
substituteInPlace data/trust-store.pc.in \
--replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \
--replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}'
substituteInPlace src/core/trust/terminal_agent.h \
--replace-fail '/bin/whiptail' '${lib.getExe' newt "whiptail"}'
''
+ lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
substituteInPlace CMakeLists.txt \
--replace-fail 'add_subdirectory(tests)' ""
'';
strictDeps = true;
nativeBuildInputs = [
cmake
doxygen
gettext
graphviz
pkg-config
validatePkgConfig
];
buildInputs = [
boost186
cmake-extras
dbus-cpp
glog
libapparmor
newt
process-cpp
properties-cpp
qtbase
qtdeclarative
];
nativeCheckInputs = [
dbus
];
checkInputs = [
gtest
];
dontWrapQtApps = true;
cmakeFlags = [
# Requires mirclient API, unavailable in Mir 2.x
# https://gitlab.com/ubports/development/core/trust-store/-/issues/2
(lib.cmakeBool "TRUST_STORE_MIR_AGENT_ENABLED" false)
(lib.cmakeBool "TRUST_STORE_ENABLE_DOC_GENERATION" true)
# error: moving a temporary object prevents copy elision
(lib.cmakeBool "ENABLE_WERROR" false)
];
# Not working
# - remote_agent_test cases using unix domain socket fail to do *something*, with std::system_error "Invalid argument" + follow-up "No such file or directory".
# potentially something broken/missing on our end
# - dbus_test hangs indefinitely waiting for a std::future, not provicient enough to debug this.
# same hang on upstream CI
doCheck = false;
preCheck = ''
export XDG_DATA_HOME=$TMPDIR
'';
# Starts & talks to DBus
enableParallelChecking = false;
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = with lib; {
description = "Common implementation of a trust store to be used by trusted helpers";
homepage = "https://gitlab.com/ubports/development/core/trust-store";
license = licenses.lgpl3Only;
teams = [ teams.lomiri ];
platforms = platforms.linux;
pkgConfigModules = [
"trust-store"
];
};
})

View File

@@ -0,0 +1,112 @@
{
stdenv,
lib,
fetchFromGitLab,
fetchpatch,
gitUpdater,
testers,
cmake,
dbus-test-runner,
pkg-config,
qtbase,
qtdeclarative,
qttools,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "u1db-qt";
version = "0.1.8";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/u1db-qt";
rev = finalAttrs.version;
hash = "sha256-KmAEgnWHY0cDKJqRhZpY0fzVjNlEU67e559XEbAPpJI=";
};
outputs = [
"out"
"dev"
"doc"
"examples"
];
patches = [
# Remove when https://gitlab.com/ubports/development/core/u1db-qt/-/merge_requests/8 merged & in release
(fetchpatch {
name = "0001-u1db-qt-Use-BUILD_TESTING.patch";
url = "https://gitlab.com/ubports/development/core/u1db-qt/-/commit/df5d526df26c056d54bfa532a3a3fa025d655690.patch";
hash = "sha256-CILMcvqXrTbEL/N2Tic4IsKLnTtmFJ2QbV3r4PsQ5t0=";
})
];
postPatch = ''
patchShebangs tests/strict-qmltestrunner.sh
# QMake query response is broken, just hardcode the expected location
substituteInPlace modules/U1db/CMakeLists.txt \
--replace-fail 'exec_program(''${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_QML"' 'exec_program(echo ARGS "''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"'
# For our automatic pkg-config output patcher to work, prefix must be used here
substituteInPlace libu1db-qt.pc.in \
--replace-fail 'libdir=''${exec_prefix}/lib' 'libdir=''${prefix}/lib'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
qtdeclarative # qmlplugindump
qttools # qdoc
];
buildInputs = [
qtbase
qtdeclarative
];
nativeCheckInputs = [ dbus-test-runner ];
cmakeFlags = [
(lib.cmakeBool "BUILD_DOCS" true)
];
dontWrapQtApps = true;
preBuild = ''
# Executes qmlplugindump
export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
'';
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
preCheck = ''
export QT_QPA_PLATFORM=minimal
'';
postInstall = ''
# Example seems unmaintained & depends on old things
# (unity-icon-theme, QtWebKit, Ubuntu namespace compat in LUITK)
# With an uneducated attempt at porting it to QtWebView, only displays blank window. Just throw it away.
rm -r $out/share/applications
moveToOutput share/u1db-qt/qtcreator $dev
moveToOutput share/u1db-qt/examples $examples
'';
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = {
description = "Qt5 binding and QtQuick2 plugin for U1DB";
homepage = "https://gitlab.com/ubports/development/core/u1db-qt";
changelog = "https://gitlab.com/ubports/development/core/u1db-qt/-/blob/${finalAttrs.version}/ChangeLog";
license = lib.licenses.lgpl3Only;
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [ "libu1db-qt5" ];
};
})