2011-07-07 19:16:03 +01:00
|
|
|
|
{ stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, gettext
|
|
|
|
|
, gobjectIntrospection }:
|
2009-08-13 08:55:11 +01:00
|
|
|
|
|
2010-05-15 10:55:31 +01:00
|
|
|
|
let
|
2011-07-07 19:16:03 +01:00
|
|
|
|
|
|
|
|
|
system = "/var/run/current-system/sw";
|
|
|
|
|
|
2010-05-15 10:55:31 +01:00
|
|
|
|
foolVars = {
|
|
|
|
|
LOCALSTATE = "/var";
|
|
|
|
|
SYSCONF = "/etc";
|
|
|
|
|
LIB = "${system}/lib";
|
|
|
|
|
DATA = "${system}/share";
|
|
|
|
|
};
|
2011-07-07 19:16:03 +01:00
|
|
|
|
|
2010-05-15 10:55:31 +01:00
|
|
|
|
in
|
|
|
|
|
|
2009-08-13 08:55:11 +01:00
|
|
|
|
stdenv.mkDerivation rec {
|
2012-01-07 20:29:08 +00:00
|
|
|
|
name = "polkit-0.102";
|
2010-05-15 10:55:31 +01:00
|
|
|
|
|
2009-08-13 08:55:11 +01:00
|
|
|
|
src = fetchurl {
|
2010-05-15 10:54:56 +01:00
|
|
|
|
url = "http://hal.freedesktop.org/releases/${name}.tar.gz";
|
2012-01-07 20:29:08 +00:00
|
|
|
|
sha256 = "0hc60nwqnmixavgg0alk4w0llwj5xmm4bw8qh915qvqwhkd76r8a";
|
2009-08-13 08:55:11 +01:00
|
|
|
|
};
|
2010-05-15 10:55:31 +01:00
|
|
|
|
|
2011-07-07 19:16:03 +01:00
|
|
|
|
buildInputs =
|
|
|
|
|
[ pkgconfig glib expat pam intltool gobjectIntrospection ];
|
2009-08-13 08:55:11 +01:00
|
|
|
|
|
2011-07-07 19:16:03 +01:00
|
|
|
|
configureFlags = "--libexecdir=$(out)/libexec/polkit-1";
|
2010-05-18 17:40:17 +01:00
|
|
|
|
|
2010-05-15 10:55:31 +01:00
|
|
|
|
# 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}"\"'')
|
2011-07-07 19:16:03 +01:00
|
|
|
|
(builtins.attrNames foolVars) );
|
2009-08-16 22:47:51 +01:00
|
|
|
|
|
2011-08-22 12:45:51 +01:00
|
|
|
|
preBuild =
|
|
|
|
|
''
|
|
|
|
|
# ‘libpolkit-agent-1.so’ should call the setuid wrapper on
|
|
|
|
|
# NixOS. Hard-coding the path is kinda ugly. Maybe we can just
|
|
|
|
|
# call through $PATH, but that might have security implications.
|
|
|
|
|
substituteInPlace src/polkitagent/polkitagentsession.c \
|
|
|
|
|
--replace PACKAGE_LIBEXEC_DIR '"/var/setuid-wrappers"'
|
|
|
|
|
'';
|
|
|
|
|
|
2011-07-07 19:16:03 +01:00
|
|
|
|
makeFlags =
|
|
|
|
|
''
|
|
|
|
|
INTROSPECTION_GIRDIR=$(out)/share/gir-1.0
|
|
|
|
|
INTROSPECTION_TYPELIBDIR=$(out)lib/girepository-1.0
|
|
|
|
|
'';
|
|
|
|
|
|
2009-08-16 22:47:51 +01:00
|
|
|
|
postInstall =
|
|
|
|
|
''
|
|
|
|
|
# Allow some files with paranoid permissions to be stripped in
|
|
|
|
|
# the fixup phase.
|
|
|
|
|
chmod a+rX -R $out
|
|
|
|
|
'';
|
2009-08-16 13:03:45 +01:00
|
|
|
|
|
2010-05-15 10:54:56 +01:00
|
|
|
|
meta = with stdenv.lib; {
|
2009-08-13 08:55:11 +01:00
|
|
|
|
homepage = http://www.freedesktop.org/wiki/Software/PolicyKit;
|
|
|
|
|
description = "A toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes";
|
2010-05-15 10:54:56 +01:00
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
maintainers = [ maintainers.urkud ];
|
2009-08-13 08:55:11 +01:00
|
|
|
|
};
|
|
|
|
|
}
|