diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/geoclue')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch | 72 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/geoclue/default.nix | 64 |
2 files changed, 136 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch b/nixpkgs/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch new file mode 100644 index 000000000000..feb46021f8c7 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch @@ -0,0 +1,72 @@ +diff --git a/data/meson.build b/data/meson.build +index f826864..8b8a25e 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -7,7 +7,7 @@ if get_option('enable-backend') + conf.set('demo_agent', '') + endif + +- conf_dir = join_paths(sysconfdir, 'geoclue') ++ conf_dir = join_paths(sysconfdir_install, 'geoclue') + configure_file(output: 'geoclue.conf', + input: 'geoclue.conf.in', + configuration: conf, +@@ -26,7 +26,7 @@ if get_option('enable-backend') + # DBus Service policy file + dbus_service_dir = get_option('dbus-sys-dir') + if dbus_service_dir == '' +- dbus_service_dir = join_paths(sysconfdir, 'dbus-1', 'system.d') ++ dbus_service_dir = join_paths(sysconfdir_install, 'dbus-1', 'system.d') + endif + configure_file(output: 'org.freedesktop.GeoClue2.conf', + input: 'org.freedesktop.GeoClue2.conf.in', +diff --git a/demo/meson.build b/demo/meson.build +index 99c094f..a29ca96 100644 +--- a/demo/meson.build ++++ b/demo/meson.build +@@ -56,7 +56,7 @@ if get_option('demo-agent') + install_dir: desktop_dir) + + # Also install in the autostart directory. +- autostart_dir = join_paths(sysconfdir, 'xdg', 'autostart') ++ autostart_dir = join_paths(sysconfdir_install, 'xdg', 'autostart') + meson.add_install_script('install-file.py', + desktop_file.full_path(), + autostart_dir) +diff --git a/meson.build b/meson.build +index d738ef6..c794a1d 100644 +--- a/meson.build ++++ b/meson.build +@@ -12,7 +12,11 @@ gclue_api_version='2.0' + datadir = join_paths(get_option('prefix'), get_option('datadir')) + includedir = join_paths(get_option('prefix'), get_option('includedir')) + libexecdir = join_paths(get_option('prefix'), get_option('libexecdir')) +-sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir')) ++if get_option('sysconfdir_install') != '' ++ sysconfdir_install = join_paths(get_option('prefix'), get_option('sysconfdir_install')) ++else ++ sysconfdir_install = get_option('sysconfdir') ++endif + localedir = join_paths(datadir, 'locale') + + header_dir = 'libgeoclue-' + gclue_api_version +@@ -29,7 +33,7 @@ conf.set_quoted('PACKAGE_URL', 'http://www.freedesktop.org/wiki/Software/GeoClue + conf.set_quoted('PACKAGE_BUGREPORT', 'http://bugs.freedesktop.org/enter_bug.cgi?product=GeoClue') + conf.set_quoted('TEST_SRCDIR', meson.source_root() + '/data/') + conf.set_quoted('LOCALEDIR', localedir) +-conf.set_quoted('SYSCONFDIR', sysconfdir) ++conf.set_quoted('SYSCONFDIR', get_option('sysconfdir')) + conf.set10('GCLUE_USE_3G_SOURCE', get_option('3g-source')) + conf.set10('GCLUE_USE_CDMA_SOURCE', get_option('cdma-source')) + conf.set10('GCLUE_USE_MODEM_GPS_SOURCE', get_option('modem-gps-source')) +diff --git a/meson_options.txt b/meson_options.txt +index 83bc60e..b726329 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -34,3 +34,6 @@ option('systemd-system-unit-dir', + option('dbus-srv-user', + type: 'string', value: 'root', + description: 'The user (existing) as which the service will run') ++option('sysconfdir_install', ++ type: 'string', value: '', ++ description: 'sysconfdir to use during installation') diff --git a/nixpkgs/pkgs/development/libraries/geoclue/default.nix b/nixpkgs/pkgs/development/libraries/geoclue/default.nix new file mode 100644 index 000000000000..5b8951cb3e07 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/geoclue/default.nix @@ -0,0 +1,64 @@ +{ stdenv, fetchFromGitLab, intltool, meson, ninja, pkgconfig, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, json-glib, libsoup, libnotify, gdk_pixbuf +, modemmanager, avahi, glib-networking, python3, wrapGAppsHook, gobject-introspection, vala +, withDemoAgent ? false +}: + +with stdenv.lib; + +stdenv.mkDerivation rec { + pname = "geoclue"; + version = "2.5.2"; + + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = pname; + repo = pname; + rev = version; + sha256 = "1zk6n28q030a9v03whad928b9zwq16d30ch369qv2c0994axdr5p"; + }; + + patches = [ + ./add-option-for-installation-sysconfdir.patch + ]; + + outputs = [ "out" "dev" "devdoc" ]; + + nativeBuildInputs = [ + pkgconfig intltool meson ninja wrapGAppsHook python3 vala gobject-introspection + # devdoc + gtk-doc docbook_xsl docbook_xml_dtd_412 + ]; + + buildInputs = [ + glib json-glib libsoup avahi + ] ++ optionals withDemoAgent [ + libnotify gdk_pixbuf + ] ++ optionals (!stdenv.isDarwin) [ modemmanager ]; + + propagatedBuildInputs = [ glib glib-networking ]; + + mesonFlags = [ + "-Dsystemd-system-unit-dir=${placeholder "out"}/etc/systemd/system" + "-Ddemo-agent=${if withDemoAgent then "true" else "false"}" + "--sysconfdir=/etc" + "-Dsysconfdir_install=${placeholder "out"}/etc" + ] ++ optionals stdenv.isDarwin [ + "-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 + ''; + + meta = with stdenv.lib; { + description = "Geolocation framework and some data providers"; + homepage = https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home; + maintainers = with maintainers; [ raskin garbas ]; + platforms = with platforms; linux ++ darwin; + license = licenses.lgpl2; + }; +} |