Skip to content

Commit

Permalink
lomiri.libusermetrics: 1.3.0 -> 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
OPNA2608 committed Feb 1, 2024
1 parent fd30907 commit 79edea7
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions pkgs/desktops/lomiri/development/libusermetrics/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@
, qtdeclarative
, qtxmlpatterns
, ubports-click
, validatePkgConfig
, wrapQtAppsHook
}:

stdenv.mkDerivation (finalAttrs: {
pname = "libusermetrics";
version = "1.3.0";
version = "1.3.2";

src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/libusermetrics";
rev = finalAttrs.version;
hash = "sha256-yO9wZcXJBKt1HZ1GKoQ1flqYuwW9PlXiWLE3bl21PSQ=";
hash = "sha256-jmJH5vByBnBqgQfyb7HNVe+eS/jHcU64R2dnvuLbqss=";
};

outputs = [
Expand All @@ -40,21 +41,12 @@ stdenv.mkDerivation (finalAttrs: {
];

postPatch = ''
substituteInPlace data/CMakeLists.txt \
--replace '/etc' "$out/etc"
# 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 "\''${QT_IMPORTS_DIR}/UserMetrics" '${placeholder "out"}/${qtbase.qtQmlPrefix}/UserMetrics'
substituteInPlace src/libusermetricsinput/CMakeLists.txt \
--replace 'RUNTIME DESTINATION bin' 'RUNTIME DESTINATION ''${CMAKE_INSTALL_BINDIR}'
--replace 'query_qmake(QT_INSTALL_QML QT_IMPORTS_DIR)' 'set(QT_IMPORTS_DIR "''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}")'
substituteInPlace doc/CMakeLists.txt \
--replace "\''${CMAKE_INSTALL_DATAROOTDIR}/doc/libusermetrics-doc" "\''${CMAKE_INSTALL_DOCDIR}"
'' + lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
# Only needed by tests
sed -i -e '/QTDBUSTEST/d' CMakeLists.txt
'';

strictDeps = true;
Expand All @@ -64,6 +56,7 @@ stdenv.mkDerivation (finalAttrs: {
doxygen
intltool
pkg-config
validatePkgConfig
wrapQtAppsHook
];

Expand Down Expand Up @@ -91,22 +84,16 @@ stdenv.mkDerivation (finalAttrs: {
];

cmakeFlags = [
"-DGSETTINGS_LOCALINSTALL=ON"
"-DGSETTINGS_COMPILE=ON"
"-DENABLE_TESTS=${lib.boolToString finalAttrs.finalPackage.doCheck}"
(lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
(lib.cmakeBool "GSETTINGS_COMPILE" true)
(lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
];

doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;

checkPhase = ''
runHook preCheck
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/
dbus-run-session --config-file=${dbus}/share/dbus-1/session.conf -- \
make test "''${enableParallelChecking:+-j $NIX_BUILD_CORES}"
runHook postCheck
'';

passthru = {
Expand All @@ -117,6 +104,7 @@ stdenv.mkDerivation (finalAttrs: {
meta = with lib; {
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 = licenses.lgpl3Only;
maintainers = teams.lomiri.members;
platforms = platforms.linux;
Expand Down

0 comments on commit 79edea7

Please sign in to comment.