summary refs log tree commit diff
path: root/pkgs/development/libraries/polkit
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2019-10-26 17:53:52 +0200
committerNiklas Hambüchen <mail@nh2.me>2019-10-31 16:47:00 +0100
commit1ca49b80cb97daa053fb48d6751a5cb591a09f75 (patch)
tree3ec7ce221d8bfe8c7b609701c6134bdb631b1188 /pkgs/development/libraries/polkit
parent3f4bd0e04b31c64b789e7d5b6bdb7f113d3c4641 (diff)
downloadnixpkgs-1ca49b80cb97daa053fb48d6751a5cb591a09f75.tar
nixpkgs-1ca49b80cb97daa053fb48d6751a5cb591a09f75.tar.gz
nixpkgs-1ca49b80cb97daa053fb48d6751a5cb591a09f75.tar.bz2
nixpkgs-1ca49b80cb97daa053fb48d6751a5cb591a09f75.tar.lz
nixpkgs-1ca49b80cb97daa053fb48d6751a5cb591a09f75.tar.xz
nixpkgs-1ca49b80cb97daa053fb48d6751a5cb591a09f75.tar.zst
nixpkgs-1ca49b80cb97daa053fb48d6751a5cb591a09f75.zip
polkit: Disable systemd support on musl, it needs elogind there
Diffstat (limited to 'pkgs/development/libraries/polkit')
-rw-r--r--pkgs/development/libraries/polkit/default.nix19
1 files changed, 16 insertions, 3 deletions
diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix
index a04e67e0fd1..b22aa1c153f 100644
--- a/pkgs/development/libraries/polkit/default.nix
+++ b/pkgs/development/libraries/polkit/default.nix
@@ -1,9 +1,13 @@
 { stdenv, fetchurl, pkgconfig, glib, expat, pam, perl, fetchpatch
 , intltool, spidermonkey_60 , gobject-introspection, libxslt, docbook_xsl, dbus
 , docbook_xml_dtd_412, gtk-doc, coreutils
-, useSystemd ? stdenv.isLinux, systemd
+, useSystemd ? (stdenv.isLinux && !stdenv.hostPlatform.isMusl), systemd, elogind
 , withGnome ? true
-, doCheck ? stdenv.isLinux
+# A few tests currently fail on musl (polkitunixusertest, polkitunixgrouptest, polkitidentitytest segfault).
+# Not yet investigated; it may be due to the "Make netgroup support optional"
+# patch not updating the tests correctly yet, or doing something wrong,
+# or being unrelated to that.
+, doCheck ? (stdenv.isLinux && !stdenv.hostPlatform.isMusl)
 }:
 
 let
@@ -28,6 +32,15 @@ stdenv.mkDerivation rec {
       url = "https://gitlab.freedesktop.org/polkit/polkit/merge_requests/11.patch";
       sha256 = "17lv7xj5ksa27iv4zpm4zwd4iy8zbwjj4ximslfq3sasiz9kxhlp";
     })
+  ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+    # Make netgroup support optional (musl does not have it)
+    # Upstream MR: https://gitlab.freedesktop.org/polkit/polkit/merge_requests/10
+    # We use the version of the patch that Alpine uses successfully.
+    (fetchpatch {
+      name = "make-innetgr-optional.patch";
+      url = "https://git.alpinelinux.org/aports/plain/main/polkit/make-innetgr-optional.patch?id=391e7de6ced1a96c2dac812e0b12f1d7e0ea705e";
+      sha256 = "1p9qqqhnrfyjvvd50qh6vpl256kyfblm1qnhz5pm09klrl1bh1n4";
+    })
   ];
 
   postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
@@ -41,7 +54,7 @@ stdenv.mkDerivation rec {
     ++ [ libxslt docbook_xsl docbook_xml_dtd_412 ]; # man pages
   buildInputs =
     [ expat pam spidermonkey_60 ]
-    ++ stdenv.lib.optional useSystemd systemd
+    ++ (if useSystemd then [systemd] else [elogind])
     ++ stdenv.lib.optional withGnome gobject-introspection;
 
   propagatedBuildInputs = [