diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix index 00ebad9a931..bbd37f0b8e5 100644 --- a/pkgs/development/libraries/polkit/default.nix +++ b/pkgs/development/libraries/polkit/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, spidermonkey , gobjectIntrospection -, useSystemd ? true, systemd }: +, useSystemd ? stdenv.isLinux, systemd }: let @@ -27,18 +27,18 @@ stdenv.mkDerivation rec { [ pkgconfig glib expat pam intltool spidermonkey gobjectIntrospection ] ++ stdenv.lib.optional useSystemd systemd; + preConfigure = '' + patchShebangs . + '' + stdenv.lib.optionalString useSystemd /* bogus chroot detection */ '' + sed '/libsystemd-login autoconfigured, but system does not appear to use systemd/s/.*/:/' -i configure + ''; + # TODO: Distro/OS detection is impure configureFlags = [ "--libexecdir=$(out)/libexec/polkit-1" "--with-systemdsystemunitdir=$(out)/etc/systemd/system" ]; - # Ugly hack to overwrite hardcoded directories - # TODO: investigate a proper patch which will be accepted upstream - CFLAGS = stdenv.lib.concatStringsSep " " - ( map (var: ''-DPACKAGE_${var}_DIR=\""${builtins.getAttr var foolVars}"\"'') - (builtins.attrNames foolVars) ); - preBuild = '' # ‘libpolkit-agent-1.so’ should call the setuid wrapper on