photoqt: 4.6 -> 4.7 (#361171)
[NixPkgs.git] / pkgs / desktops / lomiri / services / lomiri-indicator-network / default.nix
blob58ca6d208779a4cfb6575176e5dcffc23cb031af
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   qttools,
32   validatePkgConfig,
35 stdenv.mkDerivation (finalAttrs: {
36   pname = "lomiri-indicator-network";
37   version = "1.0.2";
39   src = fetchFromGitLab {
40     owner = "ubports";
41     repo = "development/core/lomiri-indicator-network";
42     rev = finalAttrs.version;
43     hash = "sha256-9AQCWCZFbt4XcmKsjoTXJlWOm02/kBhpPxbHRtftNFM=";
44   };
46   outputs = [
47     "out"
48     "dev"
49     "doc"
50   ];
52   patches = [
53     # Move to new lomiri-indicators target
54     # Remove when version > 1.0.2
55     (fetchpatch {
56       name = "0001-lomiri-indicator-network-lomiri-indicators-target.patch";
57       url = "https://gitlab.com/ubports/development/core/lomiri-indicator-network/-/commit/b1e1f7da4b298964eba3caea37b1dace7a6182e9.patch";
58       hash = "sha256-pZKpEn2OJtB1pG/U+6IjtPGiOchRDhdbBHEZbTW7Lx0=";
59     })
60   ];
62   postPatch = ''
63     # Override original prefixes
64     substituteInPlace data/CMakeLists.txt \
65       --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})' \
66       --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})'
67   '';
69   strictDeps = true;
71   nativeBuildInputs = [
72     cmake
73     doxygen
74     gettext
75     intltool
76     pkg-config
77     qtdeclarative
78     qttools # qdoc
79     validatePkgConfig
80   ];
82   buildInputs = [
83     cmake-extras
84     dbus
85     glib
86     libqofono
87     libsecret
88     lomiri-api
89     lomiri-url-dispatcher
90     networkmanager
91     ofono
92     qtbase
93   ];
95   nativeCheckInputs = [ (python3.withPackages (ps: with ps; [ python-dbusmock ])) ];
97   checkInputs = [
98     gmenuharness
99     gtest
100     libqtdbusmock
101     libqtdbustest
102   ];
104   dontWrapQtApps = true;
106   cmakeFlags = [
107     (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
108     (lib.cmakeBool "GSETTINGS_COMPILE" true)
109     (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
110     (lib.cmakeBool "ENABLE_UBUNTU_COMPAT" true) # just in case something needs it
111     (lib.cmakeBool "BUILD_DOC" true)
112   ];
114   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
116   postInstall = ''
117     substituteInPlace $out/etc/dbus-1/services/com.lomiri.connectivity1.service \
118       --replace '/bin/false' '${lib.getExe' coreutils "false"}'
119   '';
121   passthru = {
122     ayatana-indicators = {
123       lomiri-indicator-network = [ "lomiri" ];
124     };
125     tests = {
126       pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
127       vm = nixosTests.ayatana-indicators;
128     };
129     updateScript = gitUpdater { };
130   };
132   meta = {
133     description = "Ayatana indiator exporting the network settings menu through D-Bus";
134     homepage = "https://gitlab.com/ubports/development/core/lomiri-indicator-network";
135     changelog = "https://gitlab.com/ubports/development/core/lomiri-indicator-network/-/blob/${finalAttrs.version}/ChangeLog";
136     license = lib.licenses.gpl3Only;
137     maintainers = lib.teams.lomiri.members;
138     platforms = lib.platforms.linux;
139     pkgConfigModules = [ "lomiri-connectivity-qt1" ];
140   };