2024-01-02 11:29:13 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitLab
|
|
|
|
, fetchpatch
|
|
|
|
, gitUpdater
|
|
|
|
, testers
|
|
|
|
, boost
|
|
|
|
, cmake
|
|
|
|
, cmake-extras
|
|
|
|
, dbus
|
|
|
|
, dbus-cpp
|
|
|
|
, gtest
|
|
|
|
, libapparmor
|
|
|
|
, libelf
|
|
|
|
, pkg-config
|
|
|
|
, process-cpp
|
|
|
|
, properties-cpp
|
|
|
|
, qtbase
|
|
|
|
, qtdeclarative
|
|
|
|
, sqlite
|
2024-02-07 01:22:34 +00:00
|
|
|
, validatePkgConfig
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "biometryd";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "0.3.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "ubports";
|
|
|
|
repo = "development/core/biometryd";
|
|
|
|
rev = finalAttrs.version;
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-derU7pKdNf6pwhskaW7gCLcU9ixBG3U0EI/qtANmmTs=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
# Substitute systemd's prefix in pkg-config call
|
2024-02-07 01:22:34 +00:00
|
|
|
substituteInPlace data/CMakeLists.txt \
|
2024-04-21 15:54:59 +00:00
|
|
|
--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})'
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
substituteInPlace src/biometry/qml/Biometryd/CMakeLists.txt \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "\''${CMAKE_INSTALL_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}' \
|
2024-01-02 11:29:13 +00:00
|
|
|
'' + lib.optionalString (!finalAttrs.doCheck) ''
|
|
|
|
sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
qtdeclarative # qmlplugindump
|
2024-02-07 01:22:34 +00:00
|
|
|
validatePkgConfig
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
cmake-extras
|
|
|
|
dbus
|
|
|
|
dbus-cpp
|
|
|
|
libapparmor
|
|
|
|
libelf
|
|
|
|
process-cpp
|
|
|
|
properties-cpp
|
|
|
|
qtbase
|
|
|
|
qtdeclarative
|
|
|
|
sqlite
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
gtest
|
|
|
|
];
|
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2024-02-07 01:22:34 +00:00
|
|
|
# maybe-uninitialized warnings
|
|
|
|
(lib.cmakeBool "ENABLE_WERROR" false)
|
|
|
|
(lib.cmakeBool "WITH_HYBRIS" false)
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
# Generating plugins.qmltypes (also used in checkPhase?)
|
|
|
|
export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
passthru = {
|
|
|
|
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
updateScript = gitUpdater { };
|
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = with lib; {
|
|
|
|
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";
|
2024-02-07 01:22:34 +00:00
|
|
|
changelog = "https://gitlab.com/ubports/development/core/biometryd/-/${finalAttrs.version}/ChangeLog";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = licenses.lgpl3Only;
|
|
|
|
maintainers = teams.lomiri.members;
|
|
|
|
mainProgram = "biometryd";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
pkgConfigModules = [
|
|
|
|
"biometryd"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
})
|