2011-07-07 20:16:03 +02:00
|
|
|
|
{ stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, gettext
|
|
|
|
|
, gobjectIntrospection }:
|
2009-08-13 09:55:11 +02:00
|
|
|
|
|
2010-05-15 11:55:31 +02:00
|
|
|
|
let
|
2011-07-07 20:16:03 +02:00
|
|
|
|
|
|
|
|
|
system = "/var/run/current-system/sw";
|
|
|
|
|
|
2010-05-15 11:55:31 +02:00
|
|
|
|
foolVars = {
|
|
|
|
|
LOCALSTATE = "/var";
|
|
|
|
|
SYSCONF = "/etc";
|
|
|
|
|
LIB = "${system}/lib";
|
|
|
|
|
DATA = "${system}/share";
|
|
|
|
|
};
|
2011-07-07 20:16:03 +02:00
|
|
|
|
|
2010-05-15 11:55:31 +02:00
|
|
|
|
in
|
|
|
|
|
|
2009-08-13 09:55:11 +02:00
|
|
|
|
stdenv.mkDerivation rec {
|
2012-03-09 07:13:10 +01:00
|
|
|
|
name = "polkit-0.104";
|
2010-05-15 11:55:31 +02:00
|
|
|
|
|
2009-08-13 09:55:11 +02:00
|
|
|
|
src = fetchurl {
|
2010-05-15 11:54:56 +02:00
|
|
|
|
url = "http://hal.freedesktop.org/releases/${name}.tar.gz";
|
2012-03-09 07:13:10 +01:00
|
|
|
|
sha256 = "1yf7307svs8qk76qdlgww1bhgdcia5cm92n16xz7njhy73c162kb";
|
2009-08-13 09:55:11 +02:00
|
|
|
|
};
|
2010-05-15 11:55:31 +02:00
|
|
|
|
|
2011-07-07 20:16:03 +02:00
|
|
|
|
buildInputs =
|
|
|
|
|
[ pkgconfig glib expat pam intltool gobjectIntrospection ];
|
2009-08-13 09:55:11 +02:00
|
|
|
|
|
2011-07-07 20:16:03 +02:00
|
|
|
|
configureFlags = "--libexecdir=$(out)/libexec/polkit-1";
|
2010-05-18 18:40:17 +02:00
|
|
|
|
|
2010-05-15 11:55:31 +02: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 20:16:03 +02:00
|
|
|
|
(builtins.attrNames foolVars) );
|
2009-08-16 23:47:51 +02:00
|
|
|
|
|
2011-08-22 13:45:51 +02: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 20:16:03 +02:00
|
|
|
|
makeFlags =
|
|
|
|
|
''
|
|
|
|
|
INTROSPECTION_GIRDIR=$(out)/share/gir-1.0
|
|
|
|
|
INTROSPECTION_TYPELIBDIR=$(out)lib/girepository-1.0
|
|
|
|
|
'';
|
|
|
|
|
|
2009-08-16 23:47:51 +02:00
|
|
|
|
postInstall =
|
|
|
|
|
''
|
|
|
|
|
# Allow some files with paranoid permissions to be stripped in
|
|
|
|
|
# the fixup phase.
|
|
|
|
|
chmod a+rX -R $out
|
|
|
|
|
'';
|
2009-08-16 14:03:45 +02:00
|
|
|
|
|
2010-05-15 11:54:56 +02:00
|
|
|
|
meta = with stdenv.lib; {
|
2009-08-13 09:55:11 +02: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 11:54:56 +02:00
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
maintainers = [ maintainers.urkud ];
|
2009-08-13 09:55:11 +02:00
|
|
|
|
};
|
|
|
|
|
}
|