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