Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / geoclue / default.nix
blobc2bf28d7104528707976db2a8a31ca141412a69b
1 { lib
2 , stdenv
3 , fetchFromGitLab
4 , fetchpatch
5 , intltool
6 , meson
7 , mesonEmulatorHook
8 , ninja
9 , pkg-config
10 , gtk-doc
11 , docbook-xsl-nons
12 , docbook_xml_dtd_412
13 , glib
14 , json-glib
15 , libsoup_3
16 , libnotify
17 , gdk-pixbuf
18 , modemmanager
19 , avahi
20 , glib-networking
21 , python3
22 , wrapGAppsHook
23 , gobject-introspection
24 , vala
25 , withDemoAgent ? false
28 stdenv.mkDerivation rec {
29   pname = "geoclue";
30   version = "2.7.0";
32   outputs = [ "out" "dev" "devdoc" ];
34   src = fetchFromGitLab {
35     domain = "gitlab.freedesktop.org";
36     owner = "geoclue";
37     repo = "geoclue";
38     rev = version;
39     hash = "sha256-vzarUg4lBEXYkH+n9SY8SYr0gHUX94PSTDmKd957gyc=";
40   };
42   patches = [
43     ./add-option-for-installation-sysconfdir.patch
44   ];
46   nativeBuildInputs = [
47     pkg-config
48     intltool
49     meson
50     ninja
51     wrapGAppsHook
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.isDarwin) [
71     modemmanager
72   ];
74   propagatedBuildInputs = [
75     glib
76     glib-networking
77   ];
79   mesonFlags = [
80     "-Dsystemd-system-unit-dir=${placeholder "out"}/etc/systemd/system"
81     "-Ddemo-agent=${lib.boolToString withDemoAgent}"
82     "--sysconfdir=/etc"
83     "-Dsysconfdir_install=${placeholder "out"}/etc"
84     "-Dmozilla-api-key=5c28d1f4-9511-47ff-b11a-2bef80fc177c"
85     "-Ddbus-srv-user=geoclue"
86     "-Ddbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d"
87   ] ++ lib.optionals stdenv.isDarwin [
88     "-D3g-source=false"
89     "-Dcdma-source=false"
90     "-Dmodem-gps-source=false"
91     "-Dnmea-source=false"
92   ];
94   postPatch = ''
95     chmod +x demo/install-file.py
96     patchShebangs demo/install-file.py
97   '';
99   meta = with lib; {
100     broken = stdenv.isDarwin && withDemoAgent;
101     description = "Geolocation framework and some data providers";
102     homepage = "https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home";
103     maintainers = with maintainers; [ raskin mimame ];
104     platforms = with platforms; linux ++ darwin;
105     license = licenses.lgpl2Plus;
106   };