2021-05-03 20:48:10 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, fetchpatch
|
|
|
|
, intltool
|
|
|
|
, meson
|
2022-08-12 12:06:08 +00:00
|
|
|
, mesonEmulatorHook
|
2021-05-03 20:48:10 +00:00
|
|
|
, 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
|
2020-04-24 23:36:52 +00:00
|
|
|
, withDemoAgent ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "geoclue";
|
2021-05-03 20:48:10 +00:00
|
|
|
version = "2.5.7";
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-05-03 20:48:10 +00:00
|
|
|
sha256 = "1mv1vs4q94bqkmgkj53jcsw1x31kczwydyy3r27a7fycgzmii1pj";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-10-17 02:12:59 +00:00
|
|
|
# Fix for falling back to GeoIP when WiFi devices are not found
|
|
|
|
# https://gitlab.freedesktop.org/geoclue/geoclue/-/commit/2de651b6590087a2df2defe8f3d85b3cf6b91494
|
|
|
|
# NOTE: this should be removed when the next version is released
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.freedesktop.org/geoclue/geoclue/commit/2de651b6590087a2df2defe8f3d85b3cf6b91494.patch";
|
|
|
|
sha256 = "hv7t2Hmpv2oDXiPWA7JpYD9q+cuuk+En/lJJickvFII=";
|
|
|
|
})
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
# 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=";
|
|
|
|
})
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
./add-option-for-installation-sysconfdir.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-05-03 20:48:10 +00:00
|
|
|
pkg-config
|
|
|
|
intltool
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
wrapGAppsHook
|
|
|
|
python3
|
|
|
|
vala
|
|
|
|
gobject-introspection
|
2020-04-24 23:36:52 +00:00
|
|
|
# devdoc
|
2021-05-03 20:48:10 +00:00
|
|
|
gtk-doc
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_412
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
mesonEmulatorHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-05-03 20:48:10 +00:00
|
|
|
glib
|
|
|
|
json-glib
|
|
|
|
libsoup
|
|
|
|
avahi
|
2022-08-12 12:06:08 +00:00
|
|
|
gobject-introspection
|
2021-05-03 20:48:10 +00:00
|
|
|
] ++ lib.optionals withDemoAgent [
|
2020-04-24 23:36:52 +00:00
|
|
|
libnotify gdk-pixbuf
|
2021-05-03 20:48:10 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
|
|
|
modemmanager
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
glib-networking
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dsystemd-system-unit-dir=${placeholder "out"}/etc/systemd/system"
|
2021-05-03 20:48:10 +00:00
|
|
|
"-Ddemo-agent=${lib.boolToString withDemoAgent}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"-Dsysconfdir_install=${placeholder "out"}/etc"
|
2021-05-03 20:48:10 +00:00
|
|
|
"-Dmozilla-api-key=5c28d1f4-9511-47ff-b11a-2bef80fc177c"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Ddbus-srv-user=geoclue"
|
|
|
|
"-Ddbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d"
|
2021-05-03 20:48:10 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2020-04-24 23:36:52 +00:00
|
|
|
"-D3g-source=false"
|
|
|
|
"-Dcdma-source=false"
|
|
|
|
"-Dmodem-gps-source=false"
|
|
|
|
"-Dnmea-source=false"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
chmod +x demo/install-file.py
|
|
|
|
patchShebangs demo/install-file.py
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2022-08-12 12:06:08 +00:00
|
|
|
broken = stdenv.isDarwin && withDemoAgent;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Geolocation framework and some data providers";
|
|
|
|
homepage = "https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home";
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
license = licenses.lgpl2;
|
|
|
|
};
|
|
|
|
}
|