biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / desktops / lomiri / qml / lomiri-notifications / default.nix
blob56b86eaa39185e834910bd0be1e210b6c37c5b09
1 { stdenv
2 , lib
3 , fetchFromGitLab
4 , fetchpatch
5 , gitUpdater
6 , cmake
7 , dbus
8 , libqtdbustest
9 , lomiri-api
10 , pkg-config
11 , qtbase
12 , qtdeclarative
15 stdenv.mkDerivation (finalAttrs: {
16   pname = "lomiri-notifications";
17   version = "1.3.0";
19   src = fetchFromGitLab {
20     owner = "ubports";
21     repo = "development/core/lomiri-notifications";
22     rev = finalAttrs.version;
23     hash = "sha256-EGslfTgfADrmVGhNLG7HWqcDKhu52H/r41j7fxoliko=";
24   };
26   patches = [
27     # Drop use of deprecated qt5_use_modules
28     # Remove when https://gitlab.com/ubports/development/core/lomiri-notifications/-/merge_requests/11 merged & in release
29     (fetchpatch {
30       url = "https://gitlab.com/OPNA2608/lomiri-notifications/-/commit/5d164d6d8d68efe1d14154eca4d0d736ce2a1265.patch";
31       hash = "sha256-nUg0zUft1n4AlotOaZgDqWbiVDvWvMizdlClavwygoI=";
32     })
33   ];
35   postPatch = ''
36     substituteInPlace CMakeLists.txt \
37       --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
39     # Need to replace prefix to not try to install into lomiri-api prefix
40     substituteInPlace src/CMakeLists.txt \
41       --replace '--variable=plugindir' '--define-variable=prefix=''${CMAKE_INSTALL_PREFIX} --variable=plugindir'
42   '' + lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
43     sed -i CMakeLists.txt -e '/add_subdirectory(test)/d'
44   '';
46   strictDeps = true;
48   nativeBuildInputs = [
49     cmake
50     pkg-config
51   ];
53   buildInputs = [
54     lomiri-api
55     qtbase
56     qtdeclarative
57   ];
59   nativeCheckInputs = [
60     dbus
61   ];
63   checkInputs = [
64     libqtdbustest
65   ];
67   dontWrapQtApps = true;
69   cmakeFlags = [
70     # In case anything still depends on deprecated hints
71     "-DENABLE_UBUNTU_COMPAT=ON"
72   ];
74   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
76   # Deals with DBus
77   enableParallelChecking = false;
79   preCheck = ''
80     export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
81   '';
83   passthru.updateScript = gitUpdater { };
85   meta = with lib; {
86     description = "Free Desktop Notification server QML implementation for Lomiri";
87     homepage = "https://gitlab.com/ubports/development/core/lomiri-notifications";
88     license = licenses.gpl3Only;
89     maintainers = teams.lomiri.members;
90     platforms = platforms.linux;
91   };