biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / desktops / lomiri / services / lomiri-indicator-network / default.nix
blob41d5e81611e4f92e5ac7c988ed324a1e3d1f3a73
2   stdenv,
3   lib,
4   fetchFromGitLab,
5   fetchpatch,
6   gitUpdater,
7   nixosTests,
8   testers,
9   cmake,
10   cmake-extras,
11   coreutils,
12   dbus,
13   doxygen,
14   gettext,
15   glib,
16   gmenuharness,
17   gtest,
18   intltool,
19   libsecret,
20   libqofono,
21   libqtdbusmock,
22   libqtdbustest,
23   lomiri-api,
24   lomiri-url-dispatcher,
25   networkmanager,
26   ofono,
27   pkg-config,
28   python3,
29   qtdeclarative,
30   qtbase,
31   validatePkgConfig,
34 stdenv.mkDerivation (finalAttrs: {
35   pname = "lomiri-indicator-network";
36   version = "1.0.2";
38   src = fetchFromGitLab {
39     owner = "ubports";
40     repo = "development/core/lomiri-indicator-network";
41     rev = finalAttrs.version;
42     hash = "sha256-9AQCWCZFbt4XcmKsjoTXJlWOm02/kBhpPxbHRtftNFM=";
43   };
45   outputs = [
46     "out"
47     "dev"
48     "doc"
49   ];
51   patches = [
52     # Move to new lomiri-indicators target
53     # Remove when version > 1.0.2
54     (fetchpatch {
55       name = "0001-lomiri-indicator-network-lomiri-indicators-target.patch";
56       url = "https://gitlab.com/ubports/development/core/lomiri-indicator-network/-/commit/b1e1f7da4b298964eba3caea37b1dace7a6182e9.patch";
57       hash = "sha256-pZKpEn2OJtB1pG/U+6IjtPGiOchRDhdbBHEZbTW7Lx0=";
58     })
59   ];
61   postPatch = ''
62     # Override original prefixes
63     substituteInPlace data/CMakeLists.txt \
64       --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})' \
65       --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})'
66   '';
68   strictDeps = true;
70   nativeBuildInputs = [
71     cmake
72     doxygen
73     gettext
74     intltool
75     pkg-config
76     qtdeclarative
77     validatePkgConfig
78   ];
80   buildInputs = [
81     cmake-extras
82     dbus
83     glib
84     libqofono
85     libsecret
86     lomiri-api
87     lomiri-url-dispatcher
88     networkmanager
89     ofono
90     qtbase
91   ];
93   nativeCheckInputs = [ (python3.withPackages (ps: with ps; [ python-dbusmock ])) ];
95   checkInputs = [
96     gmenuharness
97     gtest
98     libqtdbusmock
99     libqtdbustest
100   ];
102   dontWrapQtApps = true;
104   cmakeFlags = [
105     (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
106     (lib.cmakeBool "GSETTINGS_COMPILE" true)
107     (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
108     (lib.cmakeBool "ENABLE_UBUNTU_COMPAT" true) # just in case something needs it
109     (lib.cmakeBool "BUILD_DOC" true) # lacks QML docs, needs qdoc: https://github.com/NixOS/nixpkgs/pull/245379
110   ];
112   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
114   postInstall = ''
115     substituteInPlace $out/etc/dbus-1/services/com.lomiri.connectivity1.service \
116       --replace '/bin/false' '${lib.getExe' coreutils "false"}'
117   '';
119   passthru = {
120     ayatana-indicators = {
121       lomiri-indicator-network = [ "lomiri" ];
122     };
123     tests = {
124       pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
125       vm = nixosTests.ayatana-indicators;
126     };
127     updateScript = gitUpdater { };
128   };
130   meta = {
131     description = "Ayatana indiator exporting the network settings menu through D-Bus";
132     homepage = "https://gitlab.com/ubports/development/core/lomiri-indicator-network";
133     changelog = "https://gitlab.com/ubports/development/core/lomiri-indicator-network/-/blob/${finalAttrs.version}/ChangeLog";
134     license = lib.licenses.gpl3Only;
135     maintainers = lib.teams.lomiri.members;
136     platforms = lib.platforms.linux;
137     pkgConfigModules = [ "lomiri-connectivity-qt1" ];
138   };