2011-07-07 20:16:03 +02:00
|
|
|
|
{ stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, gettext
|
2012-08-21 14:34:59 +02:00
|
|
|
|
, gobjectIntrospection
|
2013-10-06 00:20:34 +02:00
|
|
|
|
, useSystemd ? stdenv.isLinux, systemd }:
|
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";
|
2012-08-21 14:34:59 +02:00
|
|
|
|
|
2010-05-15 11:55:31 +02:00
|
|
|
|
foolVars = {
|
|
|
|
|
LOCALSTATE = "/var";
|
|
|
|
|
SYSCONF = "/etc";
|
|
|
|
|
LIB = "${system}/lib";
|
|
|
|
|
DATA = "${system}/share";
|
|
|
|
|
};
|
2012-08-21 14:34:59 +02:00
|
|
|
|
|
2010-05-15 11:55:31 +02:00
|
|
|
|
in
|
|
|
|
|
|
2009-08-13 09:55:11 +02:00
|
|
|
|
stdenv.mkDerivation rec {
|
2012-08-21 14:34:59 +02:00
|
|
|
|
name = "polkit-0.105";
|
2010-05-15 11:55:31 +02:00
|
|
|
|
|
2009-08-13 09:55:11 +02:00
|
|
|
|
src = fetchurl {
|
2012-08-21 14:34:59 +02:00
|
|
|
|
url = "http://www.freedesktop.org/software/polkit/releases/${name}.tar.gz";
|
|
|
|
|
sha256 = "1pz1hn4z0f1wk4f7w8q1g6ygwan1b6kxmfad3b7gql27pb47rp4g";
|
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 =
|
2012-08-21 14:34:59 +02:00
|
|
|
|
[ pkgconfig glib expat pam intltool gobjectIntrospection ]
|
|
|
|
|
++ stdenv.lib.optional useSystemd systemd;
|
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
|
|
|
|
|
'';
|
2012-08-21 14:34:59 +02:00
|
|
|
|
|
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; {
|
2012-08-21 14:34:59 +02:00
|
|
|
|
homepage = http://www.freedesktop.org/wiki/Software/polkit;
|
2009-08-13 09:55:11 +02:00
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
}
|