base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / ge / geoclue2 / package.nix
blob2b1e203c780890a85404c7dc06e91435ae13ba8b
1 { lib
2 , stdenv
3 , fetchFromGitLab
4 , intltool
5 , meson
6 , mesonEmulatorHook
7 , ninja
8 , pkg-config
9 , gtk-doc
10 , docbook-xsl-nons
11 , docbook_xml_dtd_412
12 , glib
13 , json-glib
14 , libsoup_3
15 , libnotify
16 , gdk-pixbuf
17 , modemmanager
18 , avahi
19 , glib-networking
20 , python3
21 , wrapGAppsHook3
22 , gobject-introspection
23 , vala
24 , withDemoAgent ? false
25 , nix-update-script
28 stdenv.mkDerivation (finalAttrs: {
29   pname = "geoclue";
30   version = "2.7.2";
32   outputs = [ "out" "dev" "devdoc" ];
34   src = fetchFromGitLab {
35     domain = "gitlab.freedesktop.org";
36     owner = "geoclue";
37     repo = "geoclue";
38     rev = "refs/tags/${finalAttrs.version}";
39     hash = "sha256-LwL1WtCdHb/NwPr3/OLISwaAwplhJwiZT9vUdX29Bbs=";
40   };
42   patches = [
43     ./add-option-for-installation-sysconfdir.patch
44   ];
46   nativeBuildInputs = [
47     pkg-config
48     intltool
49     meson
50     ninja
51     wrapGAppsHook3
52     python3
53     vala
54     gobject-introspection
55     # devdoc
56     gtk-doc
57     docbook-xsl-nons
58     docbook_xml_dtd_412
59   ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
60     mesonEmulatorHook
61   ];
63   buildInputs = [
64     glib
65     json-glib
66     libsoup_3
67     avahi
68   ] ++ lib.optionals withDemoAgent [
69     libnotify gdk-pixbuf
70   ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
71     modemmanager
72   ];
74   propagatedBuildInputs = [
75     glib
76     glib-networking
77   ];
79   mesonFlags = [
80     "-Dsystemd-system-unit-dir=${placeholder "out"}/lib/systemd/system"
81     "-Ddemo-agent=${lib.boolToString withDemoAgent}"
82     "--sysconfdir=/etc"
83     "-Dsysconfdir_install=${placeholder "out"}/etc"
84     "-Ddbus-srv-user=geoclue"
85   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
86     "-D3g-source=false"
87     "-Dcdma-source=false"
88     "-Dmodem-gps-source=false"
89     "-Dnmea-source=false"
90   ];
92   postPatch = ''
93     chmod +x demo/install-file.py
94     patchShebangs demo/install-file.py
95   '';
97   passthru.updateScript = nix-update-script {};
99   meta = with lib; {
100     broken = stdenv.hostPlatform.isDarwin && withDemoAgent;
101     description = "Geolocation framework and some data providers";
102     homepage = "https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home";
103     changelog = "https://gitlab.freedesktop.org/geoclue/geoclue/-/blob/${finalAttrs.version}/NEWS";
104     maintainers = with maintainers; [ raskin mimame ];
105     platforms = with platforms; linux ++ darwin;
106     license = licenses.lgpl2Plus;
107   };