1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 gitUpdater,
6 testers,
7 cmake,
8 glib,
9 gobject-introspection,
10 gtest,
11 intltool,
12 lomiri,
13 pkg-config,
14 systemd,
15 vala,
16}:
17
18stdenv.mkDerivation (finalAttrs: {
19 pname = "libayatana-common";
20 version = "0.9.11";
21
22 src = fetchFromGitHub {
23 owner = "AyatanaIndicators";
24 repo = "libayatana-common";
25 tag = finalAttrs.version;
26 hash = "sha256-o5datBxGaGnvNvz8hvPY14DvjiFJdB7k93MumXuol0I=";
27 };
28
29 postPatch = ''
30 # Queries via pkg_get_variable, can't override prefix
31 substituteInPlace data/CMakeLists.txt \
32 --replace 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemd_user_unit_dir)' 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemd_user_unit_dir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})'
33 '';
34
35 strictDeps = true;
36
37 nativeBuildInputs = [
38 cmake
39 gobject-introspection
40 intltool
41 pkg-config
42 vala
43 ];
44
45 buildInputs = [
46 lomiri.cmake-extras
47 glib
48 lomiri.lomiri-url-dispatcher
49 systemd
50 ];
51
52 checkInputs = [
53 gtest
54 ];
55
56 cmakeFlags = [
57 (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
58 (lib.cmakeBool "ENABLE_LOMIRI_FEATURES" true)
59 (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
60 (lib.cmakeBool "GSETTINGS_COMPILE" true)
61 ];
62
63 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
64
65 passthru = {
66 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
67 updateScript = gitUpdater { };
68 };
69
70 meta = {
71 description = "Common functions for Ayatana System Indicators";
72 homepage = "https://github.com/AyatanaIndicators/libayatana-common";
73 changelog = "https://github.com/AyatanaIndicators/libayatana-common/blob/${finalAttrs.version}/ChangeLog";
74 license = lib.licenses.gpl3Only;
75 maintainers = with lib.maintainers; [ OPNA2608 ];
76 platforms = lib.platforms.linux;
77 pkgConfigModules = [
78 "libayatana-common"
79 ];
80 };
81})