2011-07-07 18:16:03 +00:00
|
|
|
|
{ stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, gettext
|
2012-08-21 12:34:59 +00:00
|
|
|
|
, gobjectIntrospection
|
2012-11-06 12:01:44 +00:00
|
|
|
|
, useSystemd ? true, systemd }:
|
2009-08-13 07:55:11 +00:00
|
|
|
|
|
2010-05-15 09:55:31 +00:00
|
|
|
|
let
|
2011-07-07 18:16:03 +00:00
|
|
|
|
|
|
|
|
|
system = "/var/run/current-system/sw";
|
2012-08-21 12:34:59 +00:00
|
|
|
|
|
2010-05-15 09:55:31 +00:00
|
|
|
|
foolVars = {
|
|
|
|
|
LOCALSTATE = "/var";
|
|
|
|
|
SYSCONF = "/etc";
|
|
|
|
|
LIB = "${system}/lib";
|
|
|
|
|
DATA = "${system}/share";
|
|
|
|
|
};
|
2012-08-21 12:34:59 +00:00
|
|
|
|
|
2010-05-15 09:55:31 +00:00
|
|
|
|
in
|
|
|
|
|
|
2009-08-13 07:55:11 +00:00
|
|
|
|
stdenv.mkDerivation rec {
|
2012-08-21 12:34:59 +00:00
|
|
|
|
name = "polkit-0.105";
|
2010-05-15 09:55:31 +00:00
|
|
|
|
|
2009-08-13 07:55:11 +00:00
|
|
|
|
src = fetchurl {
|
2012-08-21 12:34:59 +00:00
|
|
|
|
url = "http://www.freedesktop.org/software/polkit/releases/${name}.tar.gz";
|
|
|
|
|
sha256 = "1pz1hn4z0f1wk4f7w8q1g6ygwan1b6kxmfad3b7gql27pb47rp4g";
|
2009-08-13 07:55:11 +00:00
|
|
|
|
};
|
2010-05-15 09:55:31 +00:00
|
|
|
|
|
2011-07-07 18:16:03 +00:00
|
|
|
|
buildInputs =
|
2012-08-21 12:34:59 +00:00
|
|
|
|
[ pkgconfig glib expat pam intltool gobjectIntrospection ]
|
|
|
|
|
++ stdenv.lib.optional useSystemd systemd;
|
2009-08-13 07:55:11 +00:00
|
|
|
|
|
2011-07-07 18:16:03 +00:00
|
|
|
|
configureFlags = "--libexecdir=$(out)/libexec/polkit-1";
|
2010-05-18 16:40:17 +00:00
|
|
|
|
|
2010-05-15 09:55:31 +00: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 18:16:03 +00:00
|
|
|
|
(builtins.attrNames foolVars) );
|
2009-08-16 21:47:51 +00:00
|
|
|
|
|
2011-08-22 11:45:51 +00: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 18:16:03 +00:00
|
|
|
|
makeFlags =
|
|
|
|
|
''
|
|
|
|
|
INTROSPECTION_GIRDIR=$(out)/share/gir-1.0
|
|
|
|
|
INTROSPECTION_TYPELIBDIR=$(out)lib/girepository-1.0
|
|
|
|
|
'';
|
2012-08-21 12:34:59 +00:00
|
|
|
|
|
2009-08-16 21:47:51 +00:00
|
|
|
|
postInstall =
|
|
|
|
|
''
|
|
|
|
|
# Allow some files with paranoid permissions to be stripped in
|
|
|
|
|
# the fixup phase.
|
|
|
|
|
chmod a+rX -R $out
|
|
|
|
|
'';
|
2009-08-16 12:03:45 +00:00
|
|
|
|
|
2010-05-15 09:54:56 +00:00
|
|
|
|
meta = with stdenv.lib; {
|
2012-08-21 12:34:59 +00:00
|
|
|
|
homepage = http://www.freedesktop.org/wiki/Software/polkit;
|
2009-08-13 07:55:11 +00:00
|
|
|
|
description = "A toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes";
|
2010-05-15 09:54:56 +00:00
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
maintainers = [ maintainers.urkud ];
|
2009-08-13 07:55:11 +00:00
|
|
|
|
};
|
|
|
|
|
}
|