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,124 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
testers,
# https://gitlab.com/ubports/development/core/biometryd/-/issues/8
boost186,
cmake,
cmake-extras,
dbus,
dbus-cpp,
gtest,
libapparmor,
libelf,
nlohmann_json,
pkg-config,
process-cpp,
properties-cpp,
qtbase,
qtdeclarative,
sqlite,
validatePkgConfig,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "biometryd";
version = "0.3.2";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/biometryd";
rev = finalAttrs.version;
hash = "sha256-OTK+JAm8MnlQGZwcKJPh+N1OfUOko24G+IU9GUBjOjI=";
};
outputs = [
"out"
"dev"
];
postPatch = ''
# Substitute systemd's prefix in pkg-config call
substituteInPlace data/CMakeLists.txt \
--replace-fail 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir)' 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})'
substituteInPlace src/biometry/qml/Biometryd/CMakeLists.txt \
--replace-fail "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
# For our automatic pkg-config output patcher to work, prefix must be used here
substituteInPlace data/biometryd.pc.in \
--replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \
--replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' \
''
+ lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
qtdeclarative # qmlplugindump
validatePkgConfig
];
buildInputs = [
boost186
cmake-extras
dbus
dbus-cpp
libapparmor
libelf
nlohmann_json
process-cpp
properties-cpp
qtbase
qtdeclarative
sqlite
];
checkInputs = [
gtest
];
dontWrapQtApps = true;
cmakeFlags = [
# maybe-uninitialized warnings
(lib.cmakeBool "ENABLE_WERROR" false)
(lib.cmakeBool "WITH_HYBRIS" false)
];
preBuild = ''
# Generating plugins.qmltypes (also used in checkPhase?)
export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
'';
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = {
description = "Mediates/multiplexes access to biometric devices";
longDescription = ''
biometryd mediates and multiplexes access to biometric devices present
on the system, enabling applications and system components to leverage
them for identification and verification of users.
'';
homepage = "https://gitlab.com/ubports/development/core/biometryd";
changelog = "https://gitlab.com/ubports/development/core/biometryd/-/blob/${finalAttrs.version}/ChangeLog";
license = lib.licenses.lgpl3Only;
teams = [ lib.teams.lomiri ];
mainProgram = "biometryd";
platforms = lib.platforms.linux;
pkgConfigModules = [
"biometryd"
];
};
})

View File

@@ -0,0 +1,79 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
accountsservice,
cmake,
cmake-extras,
deviceinfo,
libgbinder,
libglibutil,
pkg-config,
qtbase,
qtdeclarative,
qtfeedback,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hfd-service";
version = "0.2.3";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/hfd-service";
rev = finalAttrs.version;
hash = "sha256-PvZPdisqpKl9OSuQXIJW1y6EJ5moesJiEAQjpQjzyWQ=";
};
postPatch = ''
substituteInPlace qt/feedback-plugin/CMakeLists.txt \
--replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/plugins" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtPluginPrefix}"
# Queries pkg-config via pkg_get_variable, can't override prefix
substituteInPlace init/CMakeLists.txt \
--replace 'pkg_get_variable(SYSTEMD_SYSTEM_DIR systemd systemdsystemunitdir)' 'set(SYSTEMD_SYSTEM_DIR ''${CMAKE_INSTALL_PREFIX}/lib/systemd/system)'
substituteInPlace CMakeLists.txt \
--replace 'pkg_get_variable(AS_INTERFACES_DIR accountsservice interfacesdir)' 'set(AS_INTERFACES_DIR "''${CMAKE_INSTALL_FULL_DATADIR}/accountsservice/interfaces")' \
--replace '../../dbus-1/interfaces' "\''${CMAKE_INSTALL_PREFIX}/\''${DBUS_INTERFACES_DIR}" \
--replace 'DESTINATION ''${DBUS_INTERFACES_DIR}' 'DESTINATION ''${CMAKE_INSTALL_PREFIX}/''${DBUS_INTERFACES_DIR}'
substituteInPlace src/CMakeLists.txt \
--replace "\''${DBUS_INTERFACES_DIR}/org.freedesktop.Accounts.xml" '${accountsservice}/share/dbus-1/interfaces/org.freedesktop.Accounts.xml'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
qtdeclarative
];
buildInputs = [
accountsservice
cmake-extras
deviceinfo
libgbinder
libglibutil
qtbase
qtdeclarative
qtfeedback
];
cmakeFlags = [
(lib.cmakeBool "ENABLE_LIBHYBRIS" false)
];
dontWrapQtApps = true;
passthru.updateScript = gitUpdater { };
meta = with lib; {
description = "DBus-activated service that manages human feedback devices such as LEDs and vibrators on mobile devices";
homepage = "https://gitlab.com/ubports/development/core/hfd-service";
changelog = "https://gitlab.com/ubports/development/core/hfd-service/-/blob/${finalAttrs.version}/ChangeLog";
license = licenses.lgpl3Only;
teams = [ teams.lomiri ];
platforms = platforms.linux;
};
})

View File

@@ -0,0 +1,189 @@
{
stdenv,
lib,
fetchFromGitLab,
fetchpatch,
gitUpdater,
nixosTests,
testers,
cmake,
cmake-extras,
dbus-test-runner,
gettext,
glib,
gsettings-qt,
gtest,
libapparmor,
libnotify,
lomiri-api,
lomiri-app-launch,
lomiri-download-manager,
lomiri-ui-toolkit,
pkg-config,
properties-cpp,
qtbase,
qtdeclarative,
qtfeedback,
qtgraphicaleffects,
qttools,
validatePkgConfig,
wrapGAppsHook3,
xvfb-run,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-content-hub";
version = "2.1.0";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-content-hub";
rev = finalAttrs.version;
hash = "sha256-S/idjDdcRvqZqKmflkYJyQckz4/9k/8JY6eRDACk9Ag=";
};
outputs = [
"out"
"dev"
"doc"
"examples"
];
patches = [
# Remove when version > 2.1.0
(fetchpatch {
name = "0001-lomiri-content-hub-treewide-Add-missing-LDM-include-dirs.patch";
url = "https://gitlab.com/ubports/development/core/lomiri-content-hub/-/commit/cdd3371714c183d4caf166157082288c022bb98d.patch";
hash = "sha256-Uubd425T+0KxPR9lJW6+ejO2fFzcDwEIpJATSZ9jYD4=";
})
];
postPatch = ''
substituteInPlace import/*/Content/CMakeLists.txt \
--replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt\''${QT_VERSION_MAJOR}/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
# Look for peer files in running system
substituteInPlace src/com/lomiri/content/service/registry-updater.cpp \
--replace-fail '/usr' '/run/current-system/sw'
# Don't override default theme search path (which honours XDG_DATA_DIRS) with a FHS assumption
substituteInPlace import/Lomiri/Content/contenthubplugin.cpp \
--replace-fail 'QIcon::setThemeSearchPaths(QStringList() << ("/usr/share/icons/"));' ""
'';
strictDeps = true;
nativeBuildInputs = [
cmake
gettext
pkg-config
qtdeclarative # qmlplugindump
qttools # qdoc
validatePkgConfig
wrapGAppsHook3
];
buildInputs = [
cmake-extras
glib
gsettings-qt
libapparmor
libnotify
lomiri-api
lomiri-app-launch
lomiri-download-manager
lomiri-ui-toolkit
properties-cpp
qtbase
qtdeclarative
qtfeedback
qtgraphicaleffects
];
nativeCheckInputs = [
dbus-test-runner
xvfb-run
];
checkInputs = [ gtest ];
dontWrapQtApps = true;
cmakeFlags = [
(lib.cmakeBool "GSETTINGS_COMPILE" true)
(lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
(lib.cmakeBool "ENABLE_QT6" (lib.strings.versionAtLeast qtbase.version "6"))
(lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "ENABLE_DOC" true)
(lib.cmakeBool "ENABLE_UBUNTU_COMPAT" true) # in case something still depends on it
];
preBuild =
let
listToQtVar =
list: suffix: lib.strings.concatMapStringsSep ":" (drv: "${lib.getBin drv}/${suffix}") list;
in
''
# Executes qmlplugindump
export QT_PLUGIN_PATH=${listToQtVar [ qtbase ] qtbase.qtPluginPrefix}
export QML2_IMPORT_PATH=${
listToQtVar [
qtdeclarative
lomiri-ui-toolkit
qtfeedback
qtgraphicaleffects
] qtbase.qtQmlPrefix
}
'';
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# Starts & talks to D-Bus services, breaks under parallelism
enableParallelChecking = false;
preFixup = ''
for exampleExe in lomiri-content-hub-test-{importer,exporter,sharer}; do
moveToOutput bin/$exampleExe $examples
moveToOutput share/applications/$exampleExe.desktop $examples
done
moveToOutput share/icons $examples
moveToOutput share/lomiri-content-hub/peers $examples
'';
postFixup = ''
for exampleBin in $examples/bin/*; do
wrapGApp $exampleBin
done
'';
passthru = {
tests = {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
# Tests content-hub functionality, up to the point where one app receives a content exchange request
# from another and changes into a mode to pick the content to send
vm = nixosTests.lomiri.desktop-appinteractions;
};
updateScript = gitUpdater { };
};
meta = {
description = "Content sharing/picking service for the Lomiri desktop";
longDescription = ''
lomiri-content-hub is a mediation service to let applications share content between them,
even if they are not running at the same time.
'';
homepage = "https://gitlab.com/ubports/development/core/lomiri-content-hub";
changelog = "https://gitlab.com/ubports/development/core/lomiri-content-hub/-/blob/${finalAttrs.version}/ChangeLog";
license = with lib.licenses; [
gpl3Only
lgpl3Only
];
mainProgram = "lomiri-content-hub-service";
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [
"liblomiri-content-hub"
"liblomiri-content-hub-glib"
];
};
})

View File

@@ -0,0 +1,139 @@
{
stdenv,
lib,
fetchFromGitLab,
fetchpatch,
gitUpdater,
testers,
boost,
cmake,
cmake-extras,
dbus,
dbus-test-runner,
withDocumentation ? true,
doxygen,
glog,
graphviz,
gtest,
libapparmor,
lomiri-api,
pkg-config,
python3,
qtbase,
qtdeclarative,
qttools,
validatePkgConfig,
wrapQtAppsHook,
xvfb-run,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-download-manager";
version = "0.2.1";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-download-manager";
tag = finalAttrs.version;
hash = "sha256-dVyel4NL5LFORNTQzOyeTFkt9Wn23+4uwHsKcj+/0rk=";
};
outputs = [
"out"
"dev"
]
++ lib.optionals withDocumentation [ "doc" ];
patches = [
# Remove when version > 0.2.1
(fetchpatch {
name = "0001-lomiri-download-manager-treewide-Make-pkg-config-includedir-values-reasonable.patch";
url = "https://gitlab.com/ubports/development/core/lomiri-download-manager/-/commit/230aa1965917f90d235f55477a257eca1f5eaf46.patch";
hash = "sha256-Kdmu4U98Yc213pHS0o4DjpG8T5p50Q5hijRgdvscA/c=";
})
];
postPatch = ''
# Substitute systemd's prefix in pkg-config call
substituteInPlace CMakeLists.txt \
--replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \
--replace-fail "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt\''${QT_VERSION_MAJOR}/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
# Upstream code is to work around a bug, but it only seems to cause config issues for us
substituteInPlace tests/common/CMakeLists.txt \
--replace-fail 'add_dependencies(''${TARGET} GMock)' '# add_dependencies(''${TARGET} GMock)'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
validatePkgConfig
wrapQtAppsHook
]
++ lib.optionals withDocumentation [
doxygen
graphviz
qttools # qdoc
];
buildInputs = [
boost
cmake-extras
glog
libapparmor
lomiri-api
qtbase
qtdeclarative
];
nativeCheckInputs = [
dbus
dbus-test-runner
python3
xvfb-run
];
checkInputs = [ gtest ];
cmakeFlags = [
(lib.cmakeBool "ENABLE_QT6" (lib.strings.versionAtLeast qtbase.version "6"))
(lib.cmakeBool "ENABLE_DOC" withDocumentation)
(lib.cmakeBool "ENABLE_WERROR" true)
];
makeTargets = [ "all" ] ++ lib.optionals withDocumentation [ "doc" ];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# xvfb tests are flaky on xvfb shutdown when parallelised
enableParallelChecking = false;
preCheck = ''
export HOME=$TMPDIR # temp files in home
export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix} # xcb platform & sqlite driver
'';
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = {
description = "Performs uploads and downloads from a centralized location";
homepage = "https://gitlab.com/ubports/development/core/lomiri-download-manager";
changelog = "https://gitlab.com/ubports/development/core/lomiri-download-manager/-/blob/${
if (!isNull finalAttrs.src.tag) then finalAttrs.src.tag else finalAttrs.src.rev
}/ChangeLog";
license = lib.licenses.lgpl3Only;
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [
"ldm-common"
"lomiri-download-manager-client"
"lomiri-download-manager-common"
"lomiri-upload-manager-common"
];
};
})

View File

@@ -0,0 +1,168 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
testers,
cmake,
dbus,
dbus-test-runner,
dconf,
gnome-keyring,
libphonenumber,
libqtdbustest,
pkg-config,
protobuf,
qtbase,
qtdeclarative,
qtpim,
sqlite,
telepathy,
telepathy-mission-control,
validatePkgConfig,
wrapQtAppsHook,
xvfb-run,
}:
let
replaceDbusService =
pkg: name:
"--replace-fail \"\\\${DBUS_SERVICES_DIR}/${name}\" \"${pkg}/share/dbus-1/services/${name}\"";
in
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-history-service";
version = "0.6";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/history-service";
rev = finalAttrs.version;
hash = "sha256-pcTYuumywTarW+ZciwwvmmBQQH6aq4+FdVjV62VzSZU=";
};
outputs = [
"out"
"dev"
];
postPatch = ''
# Upstream's way of generating their schema doesn't work for us, don't quite understand why.
# (gdb) bt
# #0 QSQLiteResult::prepare (this=0x4a4650, query=...) at qsql_sqlite.cpp:406
# #1 0x00007ffff344bcf4 in QSQLiteResult::reset (this=0x4a4650, query=...) at qsql_sqlite.cpp:378
# #2 0x00007ffff7f95f39 in QSqlQuery::exec (this=this@entry=0x7fffffffaad8, query=...) at kernel/qsqlquery.cpp:406
# #3 0x00000000004084cb in SQLiteDatabase::dumpSchema (this=<optimized out>) at /build/source/plugins/sqlite/sqlitedatabase.cpp:148
# #4 0x0000000000406d70 in main (argc=<optimized out>, argv=<optimized out>)
# at /build/source/plugins/sqlite/schema/generate_schema.cpp:56
# (gdb) p lastError().driverText().toStdString()
# $17 = {_M_dataplus = {<std::allocator<char>> = {<std::__new_allocator<char>> = {<No data fields>}, <No data fields>},
# _M_p = 0x4880d0 "Unable to execute statement"}, _M_string_length = 27, {
# _M_local_buf = "\033\000\000\000\000\000\000\000+\344\371\367\377\177\000", _M_allocated_capacity = 27}}
# (gdb) p lastError().databaseText().toStdString()
# $18 = {_M_dataplus = {<std::allocator<char>> = {<std::__new_allocator<char>> = {<No data fields>}, <No data fields>},
# _M_p = 0x48c480 "no such column: rowid"}, _M_string_length = 21, {
# _M_local_buf = "\025\000\000\000\000\000\000\000A\344\371\367\377\177\000", _M_allocated_capacity = 21}}
#
# This makes the tests stall indefinitely and breaks history-service usage.
# This replacement script should hopefully achieve the same / a similar-enough result with just sqlite
cp ${./update_schema.sh.in} plugins/sqlite/schema/update_schema.sh.in
# Uses pkg_get_variable, cannot substitute prefix with that
substituteInPlace daemon/CMakeLists.txt \
--replace-fail 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir)' 'set(SYSTEMD_USER_UNIT_DIR "''${CMAKE_INSTALL_PREFIX}/lib/systemd/user")'
# Queries qmake for the QML installation path, which returns a reference to Qt5's build directory
substituteInPlace CMakeLists.txt \
--replace-fail "\''${QMAKE_EXECUTABLE} -query QT_INSTALL_QML" "echo $out/${qtbase.qtQmlPrefix}"
''
+ lib.optionalString finalAttrs.finalPackage.doCheck ''
# Tests launch these DBus services, fix paths related to them
substituteInPlace tests/common/dbus-services/CMakeLists.txt \
${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.MissionControl5.service"} \
${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.AccountManager.service"} \
${replaceDbusService dconf "ca.desrt.dconf.service"}
substituteInPlace cmake/modules/GenerateTest.cmake \
--replace-fail '/usr/lib/dconf' '${lib.getLib dconf}/libexec' \
--replace-fail '/usr/lib/telepathy' '${lib.getLib telepathy-mission-control}/libexec'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
sqlite
validatePkgConfig
wrapQtAppsHook
];
buildInputs = [
libphonenumber
protobuf
qtbase
qtdeclarative
qtpim
telepathy
];
nativeCheckInputs = [
dbus
dbus-test-runner
dconf
gnome-keyring
telepathy-mission-control
xvfb-run
];
cmakeFlags = [
# Many deprecation warnings with Qt 5.15
(lib.cmakeBool "ENABLE_WERROR" false)
(lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (
lib.concatStringsSep ";" [
# DaemonTest is flaky
# https://gitlab.com/ubports/development/core/history-service/-/issues/13
"-E"
"^DaemonTest"
]
))
];
preBuild = ''
# SQLiteDatabase is used on host to generate SQL schemas
# Tests also need this to use SQLiteDatabase for verifying correct behaviour
export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
'';
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# Starts & talks to D-Bus services, breaks with parallelism
enableParallelChecking = false;
preCheck = ''
export QT_PLUGIN_PATH=${lib.getBin qtpim}/${qtbase.qtPluginPrefix}:$QT_PLUGIN_PATH
export HOME=$PWD
'';
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = {
description = "Service that provides call log and conversation history";
longDescription = ''
History service provides the database and an API to store/retrieve the call log (used by dialer-app) and the sms/mms history (used by messaging-app).
See as well telepathy-ofono for incoming message events.
Database location: ~/.local/share/history-service/history.sqlite
'';
homepage = "https://gitlab.com/ubports/development/core/lomiri-history-service";
changelog = "https://gitlab.com/ubports/development/core/lomiri-history-service/-/blob/${finalAttrs.version}/ChangeLog";
license = lib.licenses.gpl3Only;
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [ "lomiri-history-service" ];
};
})

View File

@@ -0,0 +1,34 @@
#!/bin/sh
if [ $# -lt 3 ]; then
echo "Usage: $0 <source directory> <target file> <version info file>"
exit 1
fi
SOURCE_DIR=$1
TARGET_FILE=$2
VERSION_FILE=$3
VERSION="1"
LATEST_VERSION="1"
MERGED_COMMANDS="merged.sql"
[ -e $MERGED_COMMANDS ] && rm $MERGED_COMMANDS
SCHEMA_FILE="$SOURCE_DIR/v${VERSION}.sql"
while [ -e $SCHEMA_FILE ]; do
cat $SCHEMA_FILE >> $MERGED_COMMANDS
LATEST_VERSION=$VERSION
VERSION=$(($VERSION+1))
SCHEMA_FILE="$SOURCE_DIR/v${VERSION}.sql"
done
# To output the schema
echo ".fullschema" >> $MERGED_COMMANDS
# The schemas may use functions that lomiri-history-service defines in C which don't affect the generated schema in a meaningful way.
# sqlite will return an error after processing queries with such function calls, so remove them.
sed -i -e '/normalizeId(/d' $MERGED_COMMANDS
sqlite3 <$MERGED_COMMANDS >$TARGET_FILE
echo $LATEST_VERSION > $VERSION_FILE

View File

@@ -0,0 +1,136 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
nixosTests,
testers,
cmake,
cmake-extras,
coreutils,
dbus,
doxygen,
gettext,
glib,
gmenuharness,
gtest,
intltool,
libsecret,
libqofono,
libqtdbusmock,
libqtdbustest,
lomiri-api,
lomiri-url-dispatcher,
networkmanager,
ofono,
pkg-config,
python3,
qtdeclarative,
qtbase,
qttools,
validatePkgConfig,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-indicator-network";
version = "1.1.2";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-indicator-network";
tag = finalAttrs.version;
hash = "sha256-uLqPbbCBahUwj9ZG3Q7x+bXCl0yI6L7jBpg09DTrrpk=";
};
outputs = [
"out"
"dev"
"doc"
];
postPatch = ''
# Override original prefixes
substituteInPlace data/CMakeLists.txt \
--replace-fail 'pkg_get_variable(DBUS_SESSION_BUS_SERVICES_DIR dbus-1 session_bus_services_dir)' 'pkg_get_variable(DBUS_SESSION_BUS_SERVICES_DIR dbus-1 session_bus_services_dir DEFINE_VARIABLES datadir=''${CMAKE_INSTALL_FULL_SYSCONFDIR})' \
--replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
doxygen
gettext
intltool
pkg-config
qtdeclarative
qttools # qdoc
validatePkgConfig
];
buildInputs = [
cmake-extras
dbus
glib
libqofono
libsecret
lomiri-api
lomiri-url-dispatcher
networkmanager
ofono
qtbase
];
nativeCheckInputs = [ (python3.withPackages (ps: with ps; [ python-dbusmock ])) ];
checkInputs = [
gmenuharness
gtest
libqtdbusmock
libqtdbustest
];
dontWrapQtApps = true;
cmakeFlags = [
(lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
(lib.cmakeBool "GSETTINGS_COMPILE" true)
(lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "ENABLE_UBUNTU_COMPAT" true) # just in case something needs it
(lib.cmakeBool "BUILD_DOC" true)
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# Multiple tests spin up & speak to D-Bus, avoid cross-talk causing failures
enableParallelChecking = false;
postInstall = ''
substituteInPlace $out/etc/dbus-1/services/com.lomiri.connectivity1.service \
--replace-fail '/bin/false' '${lib.getExe' coreutils "false"}'
'';
passthru = {
ayatana-indicators = {
lomiri-indicator-network = [ "lomiri" ];
};
tests = {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
startup = nixosTests.ayatana-indicators;
lomiri = nixosTests.lomiri.desktop-ayatana-indicator-network;
};
updateScript = gitUpdater { };
};
meta = {
description = "Ayatana indiator exporting the network settings menu through D-Bus";
homepage = "https://gitlab.com/ubports/development/core/lomiri-indicator-network";
changelog = "https://gitlab.com/ubports/development/core/lomiri-indicator-network/-/blob/${
if (!isNull finalAttrs.src.tag) then finalAttrs.src.tag else finalAttrs.src.rev
}/ChangeLog";
license = lib.licenses.gpl3Only;
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [ "lomiri-connectivity-qt1" ];
};
})

View File

@@ -0,0 +1,84 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
nixosTests,
cmake,
cmake-extras,
dbus,
dbus-test-runner,
gtest,
libnotify,
pkg-config,
polkit,
properties-cpp,
python3,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-polkit-agent";
version = "0.3.1";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-polkit-agent";
tag = finalAttrs.version;
hash = "sha256-6n/NIUstXODq1fGPF6ioXOWR39kTlzKWdAdW1LbnFy0=";
};
strictDeps = true;
postPatch = ''
# CMake 4 compat
# Remove when https://gitlab.com/ubports/development/core/lomiri-polkit-agent/-/commit/cb81d853ce6dd3bb11030f5a23b6a13f926779a1 in release
substituteInPlace CMakeLists.txt \
--replace-fail 'VERSION 3.5' 'VERSION 3.10'
'';
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
cmake-extras
libnotify
polkit
properties-cpp
];
nativeCheckInputs = [
dbus
(python3.withPackages (ps: with ps; [ python-dbusmock ]))
];
checkInputs = [
dbus-test-runner
gtest
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# Parallelism breaks dbus during tests
enableParallelChecking = false;
passthru = {
# Involves a test to check polkit agent functionality.
# The pop-up dialogue times out after awhile, and OCR can't find it in time.
# Please check the screenshots after running that test, to verify that the pop-up actually happened!
tests.vm = nixosTests.lomiri.desktop-appinteractions;
updateScript = gitUpdater { };
};
meta = {
description = "Policy kit agent for the Lomiri desktop";
homepage = "https://gitlab.com/ubports/development/core/lomiri-polkit-agent";
changelog = "https://gitlab.com/ubports/development/core/lomiri-polkit-agent/-/blob/${
if (!isNull finalAttrs.src.tag) then finalAttrs.src.tag else finalAttrs.src.rev
}/ChangeLog";
license = lib.licenses.gpl3Only;
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,220 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
nixosTests,
runCommand,
ayatana-indicator-messages,
bash,
cmake,
dbus,
dbus-glib,
dbus-test-runner,
dconf,
gettext,
glib,
gnome-keyring,
libnotify,
libphonenumber,
libpulseaudio,
libusermetrics,
lomiri-history-service,
lomiri-url-dispatcher,
makeWrapper,
pkg-config,
protobuf,
python3,
qtbase,
qtdeclarative,
qtfeedback,
qtmultimedia,
qtpim,
telepathy,
telepathy-glib,
telepathy-mission-control,
xvfb-run,
}:
let
replaceDbusService =
pkg: name:
"--replace-fail \"\\\${DBUS_SERVICES_DIR}/${name}\" \"${pkg}/share/dbus-1/services/${name}\"";
in
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-telephony-service";
version = "0.6.1";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-telephony-service";
tag = finalAttrs.version;
hash = "sha256-7WKKRUEEF3NL8S1xg8E1WcD3dGasrw49pydeC4CyL+c=";
};
postPatch = ''
# Queries qmake for the QML installation path, which returns a reference to Qt5's build directory
# Patch out failure if QMake is not found, since we don't use it
substituteInPlace CMakeLists.txt \
--replace-fail "\''${QMAKE_EXECUTABLE} -query QT_INSTALL_QML" "echo $out/${qtbase.qtQmlPrefix}" \
--replace-fail 'QMAKE_EXECUTABLE STREQUAL "QMAKE_EXECUTABLE-NOTFOUND"' 'FALSE'
''
+ lib.optionalString finalAttrs.finalPackage.doCheck ''
substituteInPlace tests/common/dbus-services/CMakeLists.txt \
${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.MissionControl5.service"} \
${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.AccountManager.service"} \
${replaceDbusService dconf "ca.desrt.dconf.service"}
substituteInPlace cmake/modules/GenerateTest.cmake \
--replace-fail '/usr/lib/dconf' '${lib.getLib dconf}/libexec' \
--replace-fail '/usr/lib/telepathy' '${lib.getLib telepathy-mission-control}/libexec'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
makeWrapper
];
buildInputs = [
ayatana-indicator-messages
bash
dbus-glib
dbus
dconf
gettext
glib
libnotify
libphonenumber
libpulseaudio
libusermetrics
lomiri-history-service
lomiri-url-dispatcher
protobuf
(python3.withPackages (
ps: with ps; [
dbus-python
pygobject3
]
))
qtbase
qtdeclarative
qtfeedback
qtmultimedia
qtpim
telepathy
telepathy-glib
telepathy-mission-control
];
nativeCheckInputs = [
dbus-test-runner
dconf
gnome-keyring
telepathy-mission-control
xvfb-run
];
dontWrapQtApps = true;
cmakeFlags = [
# These rely on libphonenumber reformatting inputs to certain results
# Seem to be broken for a small amount of numbers, maybe libphonenumber version change?
(lib.cmakeBool "SKIP_QML_TESTS" true)
(lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (
lib.concatStringsSep ";" [
# Exclude tests
"-E"
(lib.strings.escapeShellArg "(${
lib.concatStringsSep "|" [
# Flaky, randomly failing to launch properly & stuck until test timeout
# https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/issues/70
"^HandlerTest"
"^OfonoAccountEntryTest"
"^TelepathyHelperSetupTest"
"^AuthHandlerTest"
"^ChatManagerTest"
"^AccountEntryTest"
"^AccountEntryFactoryTest"
"^PresenceRequestTest"
"^CallEntryTest"
]
})")
]
))
];
env.NIX_CFLAGS_COMPILE = toString [
"-I${lib.getDev telepathy-glib}/include/telepathy-1.0" # it's in telepathy-farstream's Requires.private, so it & its dependencies don't get pulled in
"-I${lib.getDev dbus-glib}/include/dbus-1.0" # telepathy-glib dependency
"-I${lib.getDev dbus}/include/dbus-1.0" # telepathy-glib dependency
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# Starts & talks to D-Bus services, breaks with parallelism
enableParallelChecking = false;
preCheck = ''
export QT_QPA_PLATFORM=minimal
export QT_PLUGIN_PATH=${
lib.makeSearchPathOutput "bin" qtbase.qtPluginPrefix [
qtbase
qtpim
]
}
'';
postInstall = ''
patchShebangs $out/bin/{ofono-setup,phone-gsettings-migration.py}
# Still missing getprop from libhybris, we don't have it packaged (yet?)
wrapProgram $out/bin/ofono-setup \
--prefix PATH : ${
lib.makeBinPath [
dbus
dconf
gettext
glib
telepathy-mission-control
]
}
# These SystemD services are referenced by the installed D-Bus services, but not part of the installation. Why?
for service in lomiri-telephony-service-approver lomiri-indicator-telephony-service; do
install -Dm644 ../debian/lomiri-telephony-service."$service".user.service $out/lib/systemd/user/"$service".service
# ofono-setup.service would be provided by ubuntu-touch-session, we don't plan to package it
# Doesn't make sense to provide on non-Lomiri
substituteInPlace $out/lib/systemd/user/"$service".service \
--replace-fail '/usr' "$out" \
--replace-warn 'Requires=ofono-setup.service' "" \
--replace-warn 'After=ofono-setup.service' "" \
--replace-warn 'ayatana-indicators.target' 'lomiri-indicators.target'
done
# Parses the call & SMS indicator desktop files & tries to find its own executable in PATH
wrapProgram $out/bin/lomiri-indicator-telephony-service \
--prefix PATH : "$out/bin"
'';
passthru = {
ayatana-indicators = {
lomiri-indicator-telephony-service = [ "lomiri" ];
};
tests.vm = nixosTests.ayatana-indicators;
updateScript = gitUpdater { };
};
meta = {
description = "Backend dispatcher service for various mobile phone related operations";
homepage = "https://gitlab.com/ubports/development/core/lomiri-telephony-service";
changelog = "https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/blob/${finalAttrs.version}/ChangeLog";
license = lib.licenses.gpl3Only;
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,25 @@
From e8893fcae7e732c9e15ccd6d54a62b5b3862e445 Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Thu, 16 Jan 2025 17:12:36 +0100
Subject: [PATCH 1/5] doc/liblomiri-thumbnailer-qt: Honour CMAKE_INSTALL_DOCDIR
---
doc/liblomiri-thumbnailer-qt/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/liblomiri-thumbnailer-qt/CMakeLists.txt b/doc/liblomiri-thumbnailer-qt/CMakeLists.txt
index 91e12a0..3e96f80 100644
--- a/doc/liblomiri-thumbnailer-qt/CMakeLists.txt
+++ b/doc/liblomiri-thumbnailer-qt/CMakeLists.txt
@@ -28,7 +28,7 @@ add_doxygen(
)
install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/liblomiri-thumbnailer-qt/html
- DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/doc/liblomiri-thumbnailer-qt)
+ DESTINATION ${CMAKE_INSTALL_DOCDIR})
add_subdirectory(examples)
--
2.47.0

View File

@@ -0,0 +1,97 @@
From 37687a195052186432923276bc2c2358b3622ab1 Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Thu, 16 Jan 2025 17:12:44 +0100
Subject: [PATCH 2/5] Re-enable documentation
---
CMakeLists.txt | 6 +++++-
debian/liblomiri-thumbnailer-qt-doc.install | 1 +
...lomiri-thumbnailer-qt-doc.install.disabled | 1 -
doc/liblomiri-thumbnailer-qt/CMakeLists.txt | 21 ++++++++-----------
4 files changed, 15 insertions(+), 14 deletions(-)
create mode 100644 debian/liblomiri-thumbnailer-qt-doc.install
delete mode 100644 debian/liblomiri-thumbnailer-qt-doc.install.disabled
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 464ac70..cade10f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -184,7 +184,11 @@ if (${BUILD_TESTING})
endif()
add_subdirectory(include)
add_subdirectory(man)
-#add_subdirectory(doc)
+
+option(ENABLE_DOC "Build documentation" ON)
+if(ENABLE_DOC)
+ add_subdirectory(doc)
+endif()
#enable_coverage_report(
# TARGETS
diff --git a/debian/liblomiri-thumbnailer-qt-doc.install b/debian/liblomiri-thumbnailer-qt-doc.install
new file mode 100644
index 0000000..ff56aee
--- /dev/null
+++ b/debian/liblomiri-thumbnailer-qt-doc.install
@@ -0,0 +1 @@
+usr/share/doc/lomiri-thumbnailer/*
diff --git a/debian/liblomiri-thumbnailer-qt-doc.install.disabled b/debian/liblomiri-thumbnailer-qt-doc.install.disabled
deleted file mode 100644
index db055cf..0000000
--- a/debian/liblomiri-thumbnailer-qt-doc.install.disabled
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/doc/liblomiri-thumbnailer-qt/*
diff --git a/doc/liblomiri-thumbnailer-qt/CMakeLists.txt b/doc/liblomiri-thumbnailer-qt/CMakeLists.txt
index 3e96f80..fe98e4c 100644
--- a/doc/liblomiri-thumbnailer-qt/CMakeLists.txt
+++ b/doc/liblomiri-thumbnailer-qt/CMakeLists.txt
@@ -1,35 +1,32 @@
-include(UseDoxygen OPTIONAL)
+find_package(DoxygenBuilder REQUIRED)
file(GLOB libthumbnailer_headers "${PROJECT_SOURCE_DIR}/include/lomiri/thumbnailer/qt/*.h")
add_doxygen(
liblomiri-thumbnailer-qt-doc
+ PROJECT_NAME
+ "Thumbnailer Qt API"
INPUT
${CMAKE_CURRENT_SOURCE_DIR}/tutorial.dox
${libthumbnailer_headers}
- OUTPUT_DIRECTORY
- ${CMAKE_BINARY_DIR}/doc/liblomiri-thumbnailer-qt
+ EXAMPLE_PATH
+ ${CMAKE_CURRENT_SOURCE_DIR}
STRIP_FROM_PATH
"${CMAKE_SOURCE_DIR}/src"
STRIP_FROM_INC_PATH
"${CMAKE_SOURCE_DIR}/include"
+ DOXYFILE_IN
+ ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
EXCLUDE_PATTERNS
*/internal/*
EXCLUDE_SYMBOLS
*::internal*
*::Priv
- EXAMPLE_PATH
- ${CMAKE_CURRENT_SOURCE_DIR}
- DOXYFILE_IN
- ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
- PROJECT_NAME
- "Thumbnailer Qt API"
+ INSTALL
+ ${CMAKE_INSTALL_DOCDIR}
ALL
)
-install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/liblomiri-thumbnailer-qt/html
- DESTINATION ${CMAKE_INSTALL_DOCDIR})
-
add_subdirectory(examples)
list(APPEND UNIT_TEST_TARGETS qt_example_test)
--
2.47.0

View File

@@ -0,0 +1,25 @@
From 010d19f85f4f8d73f96f054e5d293951fae1f9de Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Thu, 16 Jan 2025 17:12:45 +0100
Subject: [PATCH 3/5] doc/liblomiri-thumbnailer-qt/examples: Drop
qt5_use_modules usage
Leftover from a0d81863f3f48717507cfa181030a8ffb0c4e881
---
doc/liblomiri-thumbnailer-qt/examples/CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/doc/liblomiri-thumbnailer-qt/examples/CMakeLists.txt b/doc/liblomiri-thumbnailer-qt/examples/CMakeLists.txt
index db8139f..825a821 100644
--- a/doc/liblomiri-thumbnailer-qt/examples/CMakeLists.txt
+++ b/doc/liblomiri-thumbnailer-qt/examples/CMakeLists.txt
@@ -1,6 +1,5 @@
include_directories(${CMAKE_BINARY_DIR}/tests ${CMAKE_SOURCE_DIR}/tests)
add_executable(qt_example_test qt_example_test.cpp)
-qt5_use_modules(qt_example_test Core Gui Network Test)
target_link_libraries(qt_example_test
gtest
Qt5::Core
--
2.47.0

View File

@@ -0,0 +1,131 @@
From ffec02835aa44e93c96c48b7a33be3f51a3571a1 Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Thu, 16 Jan 2025 17:12:46 +0100
Subject: [PATCH 4/5] Re-enable coverge reporting
---
CMakeLists.txt | 51 +++++++++++++--------
doc/CMakeLists.txt | 6 ++-
doc/liblomiri-thumbnailer-qt/CMakeLists.txt | 8 ++--
tests/CMakeLists.txt | 2 -
4 files changed, 40 insertions(+), 27 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cade10f..cbfd9c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -134,7 +134,14 @@ endif()
include(CTest)
-#include(EnableCoverageReport)
+if (cmake_build_type_lower MATCHES coverage)
+ find_package(CoverageReport REQUIRED)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs" )
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs" )
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -coverage" )
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -coverage" )
+endif()
+
include(cmake/UseGSettings.cmake)
@@ -169,6 +176,8 @@ include_directories(${TAGLIB_DEPS_INCLUDE_DIRS})
include_directories(include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
+set(UNIT_TEST_TARGETS "")
+
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(plugins/Lomiri/Thumbnailer.0.1)
@@ -190,22 +199,24 @@ if(ENABLE_DOC)
add_subdirectory(doc)
endif()
-#enable_coverage_report(
-# TARGETS
-# recovery_test # Need to turn on coverage for this, to get the helper template instrumented.
-# testutils
-# test-seq
-# thumbnailer-admin
-# thumbnailer-qml
-# thumbnailer-qml-static
-# lomiri-thumbnailer-qt
-# thumbnailer-service
-# thumbnailer-static
-# vs-thumb
-# vs-thumb-static
-# FILTER
-# ${CMAKE_SOURCE_DIR}/tests/*
-# ${CMAKE_BINARY_DIR}/*
-# TESTS
-# ${UNIT_TEST_TARGETS}
-#)
+if (cmake_build_type_lower MATCHES coverage)
+ enable_coverage_report(
+ TARGETS
+ recovery_test # Need to turn on coverage for this, to get the helper template instrumented.
+ testutils
+ test-seq
+ lomiri-thumbnailer-admin
+ LomiriThumbnailer-qml
+ thumbnailer-qml-static
+ lomiri-thumbnailer-qt
+ thumbnailer-service
+ thumbnailer-static
+ vs-thumb
+ vs-thumb-static
+ FILTER
+ ${CMAKE_SOURCE_DIR}/tests/*
+ ${CMAKE_BINARY_DIR}/*
+ TESTS
+ ${UNIT_TEST_TARGETS}
+ )
+endif()
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 11f4449..249f5e0 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,4 +1,6 @@
add_subdirectory(liblomiri-thumbnailer-qt)
-list(APPEND UNIT_TEST_TARGETS qt_example_test)
-set(UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} PARENT_SCOPE)
+if(BUILD_TESTING)
+ list(APPEND UNIT_TEST_TARGETS qt_example_test)
+ set(UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} PARENT_SCOPE)
+endif()
diff --git a/doc/liblomiri-thumbnailer-qt/CMakeLists.txt b/doc/liblomiri-thumbnailer-qt/CMakeLists.txt
index fe98e4c..078be07 100644
--- a/doc/liblomiri-thumbnailer-qt/CMakeLists.txt
+++ b/doc/liblomiri-thumbnailer-qt/CMakeLists.txt
@@ -27,7 +27,9 @@ add_doxygen(
ALL
)
-add_subdirectory(examples)
+if(BUILD_TESTING)
+ add_subdirectory(examples)
-list(APPEND UNIT_TEST_TARGETS qt_example_test)
-set(UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} PARENT_SCOPE)
+ list(APPEND UNIT_TEST_TARGETS qt_example_test)
+ set(UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} PARENT_SCOPE)
+endif()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 03a4900..97cb3a1 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -42,8 +42,6 @@ set(slow_test_dirs
stress
)
-set(UNIT_TEST_TARGETS "")
-
foreach(dir ${unit_test_dirs})
add_subdirectory(${dir})
list(APPEND UNIT_TEST_TARGETS "${dir}_test")
--
2.47.0

View File

@@ -0,0 +1,38 @@
From d9152f5e1f77a6c3bbc759eec58811410de7b85a Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Thu, 16 Jan 2025 17:12:49 +0100
Subject: [PATCH 5/5] Make GTest available to example test
---
CMakeLists.txt | 2 ++
tests/CMakeLists.txt | 1 -
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cbfd9c0..0663b44 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -189,6 +189,8 @@ if (${BUILD_TESTING})
find_package(Qt5QuickTest REQUIRED)
find_package(Qt5Network REQUIRED)
+ find_package(GMock REQUIRED)
+
add_subdirectory(tests)
endif()
add_subdirectory(include)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 97cb3a1..92eae14 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -3,7 +3,6 @@
set(old_cxx_flags ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wno-old-style-cast -Wno-missing-field-initializers")
-find_package(GMock)
set(CMAKE_CXX_FLAGS ${old_cxx_flags})
set(TESTDATADIR ${CMAKE_CURRENT_SOURCE_DIR}/media)
--
2.47.0

View File

@@ -0,0 +1,70 @@
From d2f977692f931faaad0972f8d121252ddea27501 Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Fri, 7 Feb 2025 19:13:13 +0100
Subject: [PATCH] data/com.lomiri.Thumbnailer.gschema.xml: Raise
extraction-timeout
---
data/com.lomiri.Thumbnailer.gschema.xml | 2 +-
.../liblomiri-thumbnailer-qt_test.cpp | 4 ++--
tests/settings/settings_test.cpp | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/data/com.lomiri.Thumbnailer.gschema.xml b/data/com.lomiri.Thumbnailer.gschema.xml
index 094f850..9de4ab0 100644
--- a/data/com.lomiri.Thumbnailer.gschema.xml
+++ b/data/com.lomiri.Thumbnailer.gschema.xml
@@ -66,7 +66,7 @@
</key>
<key type="i" name="extraction-timeout">
- <default>10</default>
+ <default>20</default>
<summary>Maximum amount of time to wait for an image extraction or download (in seconds)</summary>
<description>
This parameter sets the amount of time (in seconds) to wait for a remote image download or a thumbnail extraction before giving up.
diff --git a/tests/liblomiri-thumbnailer-qt/liblomiri-thumbnailer-qt_test.cpp b/tests/liblomiri-thumbnailer-qt/liblomiri-thumbnailer-qt_test.cpp
index 8fc06cf..278ebbb 100644
--- a/tests/liblomiri-thumbnailer-qt/liblomiri-thumbnailer-qt_test.cpp
+++ b/tests/liblomiri-thumbnailer-qt/liblomiri-thumbnailer-qt_test.cpp
@@ -467,13 +467,13 @@ TEST_F(LibThumbnailerTest, request_timeout)
}
Thumbnailer thumbnailer(dbus_->connection());
- auto reply = thumbnailer.getArtistArt("sleep", "12", QSize(256, 256));
+ auto reply = thumbnailer.getArtistArt("sleep", "22", QSize(256, 256));
reply->waitForFinished();
EXPECT_TRUE(reply->isFinished());
EXPECT_EQ("Thumbnailer: RequestImpl::dbusCallFinished(): D-Bus error: Handler::createFinished(): "
- "could not get thumbnail for artist: sleep/12 (256,256): TIMEOUT",
+ "could not get thumbnail for artist: sleep/22 (256,256): TIMEOUT",
reply->errorMessage());
EXPECT_FALSE(reply->isValid());
}
diff --git a/tests/settings/settings_test.cpp b/tests/settings/settings_test.cpp
index cd5931e..8a9a839 100644
--- a/tests/settings/settings_test.cpp
+++ b/tests/settings/settings_test.cpp
@@ -46,7 +46,7 @@ TEST(Settings, defaults_from_schema)
EXPECT_EQ(7200, settings.retry_error_max_seconds());
EXPECT_EQ(8, settings.max_downloads());
EXPECT_EQ(0, settings.max_extractions());
- EXPECT_EQ(10, settings.extraction_timeout());
+ EXPECT_EQ(20, settings.extraction_timeout());
EXPECT_EQ(10, settings.max_backlog());
EXPECT_FALSE(settings.trace_client());
EXPECT_EQ(1, settings.log_level());
@@ -69,7 +69,7 @@ TEST(Settings, missing_schema)
EXPECT_EQ(7200, settings.retry_error_max_seconds());
EXPECT_EQ(8, settings.max_downloads());
EXPECT_EQ(0, settings.max_extractions());
- EXPECT_EQ(10, settings.extraction_timeout());
+ EXPECT_EQ(20, settings.extraction_timeout());
EXPECT_EQ(10, settings.max_backlog());
EXPECT_FALSE(settings.trace_client());
EXPECT_EQ(1, settings.log_level());
--
2.47.1

View File

@@ -0,0 +1,221 @@
{
stdenv,
lib,
fetchFromGitLab,
fetchpatch,
gitUpdater,
nixosTests,
testers,
boost,
cmake,
cmake-extras,
doxygen,
gst_all_1,
gdk-pixbuf,
gtest,
makeFontsConf,
libapparmor,
libexif,
libqtdbustest,
librsvg,
lomiri-api,
persistent-cache-cpp,
pkg-config,
python3,
qtbase,
qtdeclarative,
shared-mime-info,
taglib,
validatePkgConfig,
wrapGAppsHook3,
xvfb-run,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-thumbnailer";
version = "3.0.4";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-thumbnailer";
tag = finalAttrs.version;
hash = "sha256-pf/bzpooCcoIGb5JtSnowePcobcfVSzHyBaEkb51IOg=";
};
outputs = [
"out"
"dev"
"doc"
];
patches = [
# Fix compat with taglib 2.x
# Remove when version > 3.0.4
(fetchpatch {
name = "0001-lomiri-thumbnailer-Fix-taglib-2.x-compat.patch";
url = "https://gitlab.com/ubports/development/core/lomiri-thumbnailer/-/commit/b7f1055e36cd6e33314bb9f6648f93e977a33267.patch";
hash = "sha256-9RHtxqsgdMkgIyswaeL5yS6+o/YvzT+HgRD8KL/RfNM=";
})
# Remove when https://gitlab.com/ubports/development/core/lomiri-thumbnailer/-/merge_requests/23 merged & in release
./1001-doc-liblomiri-thumbnailer-qt-Honour-CMAKE_INSTALL_DO.patch
./1002-Re-enable-documentation.patch
./1003-doc-liblomiri-thumbnailer-qt-examples-Drop-qt5_use_m.patch
./1004-Re-enable-coverge-reporting.patch
./1005-Make-GTest-available-to-example-test.patch
# In aarch64 lomiri-gallery-app VM tests, default 10s timeout for thumbnail extractor is often too tight
# Raise to 20s to work around this (too much more will run into D-Bus' call timeout)
./2001-Raise-default-extraction-timeout.patch
];
postPatch = ''
patchShebangs tools/{parse-settings.py,run-xvfb.sh} tests/{headers,whitespace,server}/*.py
substituteInPlace tests/thumbnailer-admin/thumbnailer-admin_test.cpp \
--replace-fail '/usr/bin/test' 'test'
substituteInPlace plugins/*/Thumbnailer*/CMakeLists.txt \
--replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
# I think this variable fails to be populated because of our toolchain, while upstream uses Debian / Ubuntu where this works fine
# https://cmake.org/cmake/help/v3.26/variable/CMAKE_LIBRARY_ARCHITECTURE.html
# > If the <LANG> compiler passes to the linker an architecture-specific system library search directory such as
# > <prefix>/lib/<arch> this variable contains the <arch> name if/as detected by CMake.
substituteInPlace tests/qml/CMakeLists.txt \
--replace-fail 'CMAKE_LIBRARY_ARCHITECTURE' 'CMAKE_SYSTEM_PROCESSOR' \
--replace-fail 'powerpc-linux-gnu' 'ppc' \
--replace-fail 's390x-linux-gnu' 's390x'
# Tests run in parallel to other builds, don't suck up cores
substituteInPlace tests/headers/compile_headers.py \
--replace-fail 'max_workers=multiprocessing.cpu_count()' "max_workers=1"
'';
strictDeps = true;
nativeBuildInputs = [
cmake
doxygen
gdk-pixbuf # setup hook
pkg-config
(python3.withPackages (
ps:
with ps;
lib.optionals finalAttrs.finalPackage.doCheck [
python-dbusmock
tornado
]
))
validatePkgConfig
wrapGAppsHook3
];
buildInputs = [
boost
cmake-extras
gdk-pixbuf
libapparmor
libexif
librsvg
lomiri-api
persistent-cache-cpp
qtbase
qtdeclarative
shared-mime-info
taglib
]
++ (with gst_all_1; [
gstreamer
gst-plugins-base
gst-plugins-good
gst-plugins-bad
# Something seems borked with bad's h264 decoder, add libav as a workaround
# https://github.com/NixOS/nixpkgs/issues/399599#issuecomment-2816268226
gst-libav
# maybe add ugly to cover all kinds of formats?
]);
nativeCheckInputs = [
shared-mime-info
xvfb-run
];
checkInputs = [
gtest
libqtdbustest
];
dontWrapQtApps = true;
cmakeFlags = [
(lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
(lib.cmakeBool "GSETTINGS_COMPILE" true)
# error: use of old-style cast to 'std::remove_reference<_GstElement*>::type' {aka 'struct _GstElement*'}
(lib.cmakeBool "Werror" false)
(lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (
lib.concatStringsSep ";" [
# QSignalSpy tests in QML suite always fail, pass when running interactively
"-E"
"^qml"
]
))
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
enableParallelChecking = false;
preCheck = ''
# Fontconfig warnings breaks some tests
export FONTCONFIG_FILE=${makeFontsConf { fontDirectories = [ ]; }}
export HOME=$TMPDIR
# Some tests need Qt plugins
export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
# QML tests need QML modules
export QML2_IMPORT_PATH=${lib.getBin qtdeclarative}/${qtbase.qtQmlPrefix}
'';
preFixup = ''
gappsWrapperArgs+=(
--prefix XDG_DATA_DIRS : ${lib.makeSearchPath "share" [ shared-mime-info ]}
)
'';
passthru = {
tests = {
# gallery app delegates to thumbnailer, tests various formats
inherit (nixosTests.lomiri-gallery-app)
format-mp4
format-gif
format-bmp
format-jpg
format-png
;
# music app relies on thumbnailer to extract embedded cover art
music-app = nixosTests.lomiri-music-app;
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
updateScript = gitUpdater { };
};
meta = {
description = "D-Bus service for out of process thumbnailing";
mainProgram = "lomiri-thumbnailer-admin";
homepage = "https://gitlab.com/ubports/development/core/lomiri-thumbnailer";
changelog = "https://gitlab.com/ubports/development/core/lomiri-thumbnailer/-/blob/${finalAttrs.version}/ChangeLog";
license = with lib.licenses; [
gpl3Only
lgpl3Only
];
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [
"liblomiri-thumbnailer-qt"
];
};
})

View File

@@ -0,0 +1,172 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
testers,
cmake,
cmake-extras,
dbus,
dbus-test-runner,
glib,
gtest,
intltool,
json-glib,
libapparmor,
libxkbcommon,
lomiri-app-launch,
lomiri-ui-toolkit,
makeWrapper,
pkg-config,
python3,
qtbase,
qtdeclarative,
qtwayland,
runtimeShell,
sqlite,
systemd,
wrapQtAppsHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lomiri-url-dispatcher";
version = "0.1.4";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-url-dispatcher";
tag = finalAttrs.version;
hash = "sha256-+3/C6z8wyiNSpt/eyMl+j/TGJW0gZ5T3Vd1NmghK67k=";
};
outputs = [
"out"
"dev"
"lib"
];
postPatch = ''
substituteInPlace 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 gui/lomiri-url-dispatcher-gui.desktop.in.in \
--replace-fail '@CMAKE_INSTALL_FULL_DATADIR@/lomiri-url-dispatcher/gui/lomiri-url-dispatcher-gui.svg' 'lomiri-url-dispatcher-gui'
substituteInPlace tests/url_dispatcher_testability/CMakeLists.txt \
--replace-fail "\''${PYTHON_PACKAGE_DIR}" "$out/${python3.sitePackages}"
# Update URI handler database whenever new url-handler is installed system-wide
substituteInPlace data/lomiri-url-dispatcher-update-system-dir.*.in \
--replace-fail '@CMAKE_INSTALL_FULL_DATAROOTDIR@' '/run/current-system/sw/share'
''
+ lib.optionalString finalAttrs.finalPackage.doCheck ''
patchShebangs tests/test-sql.sh
'';
strictDeps = true;
nativeBuildInputs = [
cmake
glib # for gdbus-codegen
intltool
makeWrapper
pkg-config
(python3.withPackages (
ps:
with ps;
[
setuptools
]
++ lib.optionals finalAttrs.finalPackage.doCheck [
python-dbusmock
]
))
wrapQtAppsHook
];
buildInputs = [
cmake-extras
dbus-test-runner
glib
gtest
json-glib
libapparmor
lomiri-app-launch
lomiri-ui-toolkit
qtdeclarative
sqlite
systemd
libxkbcommon
];
nativeCheckInputs = [
dbus
sqlite
];
cmakeFlags = [
(lib.cmakeBool "LOCAL_INSTALL" true)
(lib.cmakeBool "enable_mirclient" false)
# libexec has binaries that services will run
# To reduce size for non-Lomiri situations that pull this package in (i.e. ayatana indicators)
# we want only the solib in lib output
# But service files have LIBEXECDIR path hardcoded, which would need manual fixing if using moveToOutput in fixup
# Just tell it to put libexec stuff into other output
(lib.cmakeFeature "CMAKE_INSTALL_LIBEXECDIR" "${placeholder "out"}/libexec")
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# Tests work with an sqlite db, cannot handle >1 test at the same time
enableParallelChecking = false;
dontWrapQtApps = true;
preFixup = ''
substituteInPlace $out/bin/lomiri-url-dispatcher-{dump,gui} \
--replace-fail '/bin/sh' '${runtimeShell}'
wrapProgram $out/bin/lomiri-url-dispatcher-dump \
--prefix PATH : ${lib.makeBinPath [ sqlite ]}
mkdir -p $out/share/icons/hicolor/scalable/apps
ln -s $out/share/lomiri-url-dispatcher/gui/lomiri-url-dispatcher-gui.svg $out/share/icons/hicolor/scalable/apps/
# Calls qmlscene from PATH, needs Qt plugins & QML components
qtWrapperArgs+=(
--prefix PATH : ${lib.makeBinPath [ qtdeclarative.dev ]}
)
wrapQtApp $out/bin/lomiri-url-dispatcher-gui
'';
postFixup = ''
moveToOutput share $out
'';
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater { };
};
meta = {
description = "Lomiri operating environment service for requesting URLs to be opened";
longDescription = ''
Allows applications to request a URL to be opened and handled by another
process without seeing the list of other applications on the system or
starting them inside its own Application Confinement.
'';
homepage = "https://gitlab.com/ubports/development/core/lomiri-url-dispatcher";
changelog = "https://gitlab.com/ubports/development/core/lomiri-url-dispatcher/-/blob/${
if (!isNull finalAttrs.src.tag) then finalAttrs.src.tag else finalAttrs.src.rev
}/ChangeLog";
license = with lib.licenses; [
lgpl3Only
gpl3Only
];
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [
"lomiri-url-dispatcher"
];
};
})

View File

@@ -0,0 +1,125 @@
{
stdenv,
lib,
fetchFromGitLab,
gitUpdater,
nixosTests,
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,
gdk-pixbuf,
glib,
gst_all_1,
gtest,
libapparmor,
libexif,
pkg-config,
properties-cpp,
qtbase,
qtdeclarative,
shared-mime-info,
sqlite,
taglib,
udisks,
wrapQtAppsHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mediascanner2";
version = "0.118";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/mediascanner2";
tag = finalAttrs.version;
hash = "sha256-ZJXJNDZUDor5EJ+rn7pQt7lLzoszZUQM3B+u1gBSMs8=";
};
outputs = [
"out"
"dev"
];
postPatch = ''
substituteInPlace src/qml/MediaScanner.*/CMakeLists.txt \
--replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
'';
strictDeps = true;
nativeBuildInputs = [
cmake
gst_all_1.gstreamer # GST_PLUGIN_SYSTEM_PATH_1_0 setup hook
pkg-config
wrapQtAppsHook
];
buildInputs = [
boost186
cmake-extras
dbus
dbus-cpp
gdk-pixbuf
glib
libapparmor
libexif
properties-cpp
qtbase
qtdeclarative
shared-mime-info
sqlite
taglib
udisks
]
++ (with gst_all_1; [
gstreamer
gst-plugins-base
gst-plugins-good
]);
checkInputs = [ gtest ];
cmakeFlags = [ (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck) ];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
preCheck = ''
export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
export XDG_DATA_DIRS=${shared-mime-info}/share:$XDG_DATA_DIRS
'';
preFixup = ''
qtWrapperArgs+=(
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
--prefix XDG_DATA_DIRS : ${shared-mime-info}/share
)
'';
passthru = {
tests = {
# music app needs mediascanner to work properly, so it can find files
music-app = nixosTests.lomiri-music-app;
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
updateScript = gitUpdater { };
};
meta = {
description = "Media scanner service & access library";
homepage = "https://gitlab.com/ubports/development/core/mediascanner2";
changelog = "https://gitlab.com/ubports/development/core/mediascanner2/-/blob/${
if (!isNull finalAttrs.src.tag) then finalAttrs.src.tag else finalAttrs.src.rev
}/ChangeLog";
license = lib.licenses.gpl3Only;
teams = [ lib.teams.lomiri ];
mainProgram = "mediascanner-service-2.0";
platforms = lib.platforms.linux;
pkgConfigModules = [ "mediascanner-2.0" ];
};
})