polkit: remove hacks, fix chroot builds

This commit is contained in:
Vladimír Čunát 2013-10-06 23:54:47 +02:00
parent 5bcdc3efd2
commit f445474d33

View File

@ -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