1- { stdenv
2- , lib
3- , fetchFromGitLab
4- , gitUpdater
5- , testers
6- , cmake
7- , cmake-extras
8- , dbus
9- , doxygen
10- , gsettings-qt
11- , gtest
12- , intltool
13- , json-glib
14- , libapparmor
15- , libqtdbustest
16- , pkg-config
17- , qdjango
18- , qtbase
19- , qtdeclarative
20- , qtxmlpatterns
21- , ubports-click
22- , validatePkgConfig
23- , wrapQtAppsHook
1+ {
2+ stdenv ,
3+ lib ,
4+ fetchFromGitLab ,
5+ fetchpatch ,
6+ gitUpdater ,
7+ testers ,
8+ cmake ,
9+ cmake-extras ,
10+ dbus ,
11+ doxygen ,
12+ glibcLocales ,
13+ gsettings-qt ,
14+ gtest ,
15+ intltool ,
16+ json-glib ,
17+ libapparmor ,
18+ libqtdbustest ,
19+ pkg-config ,
20+ qdjango ,
21+ qtbase ,
22+ qtdeclarative ,
23+ qtxmlpatterns ,
24+ ubports-click ,
25+ validatePkgConfig ,
26+ wrapQtAppsHook ,
2427} :
2528
2629stdenv . mkDerivation ( finalAttrs : {
2730 pname = "libusermetrics" ;
28- version = "1.3.2 " ;
31+ version = "1.3.3 " ;
2932
3033 src = fetchFromGitLab {
3134 owner = "ubports" ;
3235 repo = "development/core/libusermetrics" ;
3336 rev = finalAttrs . version ;
34- hash = "sha256-jmJH5vByBnBqgQfyb7HNVe+eS/jHcU64R2dnvuLbqss =" ;
37+ hash = "sha256-V4vxNyHMs2YYBILkpco79FN9xnooULgB+z2Kf3V0790 =" ;
3538 } ;
3639
3740 outputs = [
@@ -41,21 +44,21 @@ stdenv.mkDerivation (finalAttrs: {
4144 ] ;
4245
4346 patches = [
44- # Not submitted yet, waiting for decision on how CMake testing should be handled
45- ./2001-Remove-custom-check-target.patch
46-
47- # Due to https://gitlab.com/ubports/development/core/libusermetrics/-/issues/8, we require knowledge about AppArmor availability at launch time
48- # Custom patch to launch a module-defined service that can handle this
49- ./2002-Launch-module-created-systemd-service.patch
47+ # Remove when https://gitlab.com/ubports/development/core/libusermetrics/-/merge_requests/17 merged & in release
48+ ( fetchpatch {
49+ name = "0001-libusermetrics-BUILD_TESTING.patch" ;
50+ url = " https://gitlab.com/ubports/development/core/libusermetrics/-/commit/c1e4847601cc4522034a766755ce491d48132d77.patch" ;
51+ hash = "sha256-UWc9/ngpuiSm0Rd6eBK/R3N/NwDRtMxie78seN3+y/8=" ;
52+ } )
5053 ] ;
5154
5255 postPatch = ''
5356 # Tries to query QMake for QT_INSTALL_QML variable, would return broken paths into /build/qtbase-<commit> even if qmake was available
5457 substituteInPlace src/modules/UserMetrics/CMakeLists.txt \
55- --replace 'query_qmake(QT_INSTALL_QML QT_IMPORTS_DIR)' 'set(QT_IMPORTS_DIR "'' ${CMAKE_INSTALL_PREFIX}/${ qtbase . qtQmlPrefix } ")'
58+ --replace-fail 'query_qmake(QT_INSTALL_QML QT_IMPORTS_DIR)' 'set(QT_IMPORTS_DIR "'' ${CMAKE_INSTALL_PREFIX}/${ qtbase . qtQmlPrefix } ")'
5659
5760 substituteInPlace doc/CMakeLists.txt \
58- --replace "\'' ${CMAKE_INSTALL_DATAROOTDIR }/doc/libusermetrics-doc" "\'' ${CMAKE_INSTALL_DOCDIR}"
61+ --replace-fail "\'' ${CMAKE_INSTALL_FULL_DATAROOTDIR }/doc/libusermetrics-doc" "\'' ${CMAKE_INSTALL_DOCDIR}"
5962 '' ;
6063
6164 strictDeps = true ;
@@ -82,8 +85,12 @@ stdenv.mkDerivation (finalAttrs: {
8285 qtbase
8386 ] ;
8487
88+ # Tests need to be able to check locale
89+ LC_ALL = lib . optionalString finalAttrs . finalPackage . doCheck "en_US.UTF-8" ;
90+
8591 nativeCheckInputs = [
8692 dbus
93+ glibcLocales
8794 ] ;
8895
8996 checkInputs = [
@@ -96,14 +103,6 @@ stdenv.mkDerivation (finalAttrs: {
96103 ( lib . cmakeBool "GSETTINGS_LOCALINSTALL" true )
97104 ( lib . cmakeBool "GSETTINGS_COMPILE" true )
98105 ( lib . cmakeBool "ENABLE_CLICK" true )
99- ( lib . cmakeBool "ENABLE_TESTS" finalAttrs . finalPackage . doCheck )
100- ( lib . cmakeFeature "CMAKE_CTEST_ARGUMENTS" ( lib . concatStringsSep ";" [
101- # Exclude tests
102- "-E" ( lib . strings . escapeShellArg "(${ lib . concatStringsSep "|" [
103- # Flaky, randomly failing in UserMetricsImplTest.AddTranslatedData (data not ready when signal is emitted?)
104- "^usermetricsoutput-unit-tests"
105- ] } )")
106- ] ) )
107106 ] ;
108107
109108 doCheck = stdenv . buildPlatform . canExecute stdenv . hostPlatform ;
@@ -118,13 +117,13 @@ stdenv.mkDerivation (finalAttrs: {
118117 updateScript = gitUpdater { } ;
119118 } ;
120119
121- meta = with lib ; {
120+ meta = {
122121 description = "Enables apps to locally store interesting numerical data for later presentation" ;
123122 homepage = "https://gitlab.com/ubports/development/core/libusermetrics" ;
124123 changelog = "https://gitlab.com/ubports/development/core/libusermetrics/-/blob/${ finalAttrs . version } /ChangeLog" ;
125- license = licenses . lgpl3Only ;
126- maintainers = teams . lomiri . members ;
127- platforms = platforms . linux ;
124+ license = lib . licenses . lgpl3Only ;
125+ maintainers = lib . teams . lomiri . members ;
126+ platforms = lib . platforms . linux ;
128127 mainProgram = "usermetricsinput" ;
129128 pkgConfigModules = [
130129 "libusermetricsinput-1"
0 commit comments