nixpkgs-suyu/pkgs/development/libraries/geoclue/default.nix

115 lines
2.6 KiB
Nix
Raw Normal View History

2021-04-14 02:11:08 +02:00
{ lib
, stdenv
, fetchFromGitLab
, fetchpatch
2021-04-14 02:11:08 +02:00
, intltool
, meson
, ninja
, pkg-config
, gtk-doc
, docbook-xsl-nons
, docbook_xml_dtd_412
, glib
, json-glib
, libsoup
, libnotify
, gdk-pixbuf
, modemmanager
, avahi
, glib-networking
, python3
, wrapGAppsHook
, gobject-introspection
, vala
2018-07-21 02:44:15 +02:00
, withDemoAgent ? false
}:
stdenv.mkDerivation rec {
pname = "geoclue";
version = "2.5.7";
2018-11-30 23:14:39 +01:00
2021-04-14 02:11:08 +02:00
outputs = [ "out" "dev" "devdoc" ];
2018-11-30 23:14:39 +01:00
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = pname;
repo = pname;
2018-11-30 23:14:39 +01:00
rev = version;
sha256 = "1mv1vs4q94bqkmgkj53jcsw1x31kczwydyy3r27a7fycgzmii1pj";
};
2018-12-20 18:46:05 +01:00
patches = [
# Make the Mozilla API key configurable
# https://gitlab.freedesktop.org/geoclue/geoclue/merge_requests/54 (only partially backported)
(fetchpatch {
url = "https://gitlab.freedesktop.org/geoclue/geoclue/commit/95c9ad4dc176860c85a07d0db4cb4179929bdb54.patch";
sha256 = "/lq/dLBJl2vf16tt7emYoTtXY6iUw+4s2XcABUHp3Kc=";
})
(fetchpatch {
url = "https://gitlab.freedesktop.org/geoclue/geoclue/commit/1a00809a0d89b0849a57647c878d192354247a33.patch";
sha256 = "6FuiukgFWg2cEKt8LlKP4E0rfSH/ZQgk6Ip1mGJpNFQ=";
})
2018-12-20 18:46:05 +01:00
./add-option-for-installation-sysconfdir.patch
];
nativeBuildInputs = [
2021-04-14 02:11:08 +02:00
pkg-config
intltool
meson
ninja
wrapGAppsHook
python3
vala
gobject-introspection
2018-08-09 16:20:28 +02:00
# devdoc
2021-04-14 02:11:08 +02:00
gtk-doc
docbook-xsl-nons
docbook_xml_dtd_412
];
2018-07-21 02:44:15 +02:00
buildInputs = [
2021-04-14 02:11:08 +02:00
glib
json-glib
libsoup
avahi
] ++ lib.optionals withDemoAgent [
2019-05-22 13:03:39 +02:00
libnotify gdk-pixbuf
2021-04-14 02:11:08 +02:00
] ++ lib.optionals (!stdenv.isDarwin) [
modemmanager
];
2018-07-21 02:44:15 +02:00
2021-04-14 02:11:08 +02:00
propagatedBuildInputs = [
glib
glib-networking
];
2018-07-21 02:44:15 +02:00
2018-11-30 23:14:39 +01:00
mesonFlags = [
"-Dsystemd-system-unit-dir=${placeholder "out"}/etc/systemd/system"
2021-04-14 02:11:08 +02:00
"-Ddemo-agent=${lib.boolToString withDemoAgent}"
2018-12-20 18:46:05 +01:00
"--sysconfdir=/etc"
"-Dsysconfdir_install=${placeholder "out"}/etc"
"-Dmozilla-api-key=5c28d1f4-9511-47ff-b11a-2bef80fc177c"
2019-05-20 00:53:18 +02:00
"-Ddbus-srv-user=geoclue"
"-Ddbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d"
2021-04-14 02:11:08 +02:00
] ++ lib.optionals stdenv.isDarwin [
2018-11-30 23:14:39 +01:00
"-D3g-source=false"
"-Dcdma-source=false"
"-Dmodem-gps-source=false"
"-Dnmea-source=false"
2018-07-21 02:44:15 +02:00
];
2017-04-01 02:10:32 +02:00
2018-11-30 23:14:39 +01:00
postPatch = ''
chmod +x demo/install-file.py
patchShebangs demo/install-file.py
'';
meta = with lib; {
description = "Geolocation framework and some data providers";
2020-02-28 18:47:30 +01:00
homepage = "https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home";
maintainers = with maintainers; [ raskin ];
2017-04-01 02:10:32 +02:00
platforms = with platforms; linux ++ darwin;
2016-03-09 04:17:17 +01:00
license = licenses.lgpl2;
};
}