Merge pull request #14835 from groxxda/libcap

libcap: 2.24 -> 2.25, replace old split with multi-output
This commit is contained in:
Franz Pletz 2016-05-06 03:15:16 +02:00
commit e478b63b27
8 changed files with 43 additions and 75 deletions

View File

@ -1,13 +1,12 @@
{ kdeFramework, lib, copyPathsToStore, extra-cmake-modules, kconfig, kcrash
, kdoctools, ki18n, kio, kservice, kwindowsystem, libcap
, libcap_progs
}:
# TODO: setuid wrapper
kdeFramework {
name = "kinit";
nativeBuildInputs = [ extra-cmake-modules kdoctools libcap_progs ];
nativeBuildInputs = [ extra-cmake-modules kdoctools libcap.out ];
buildInputs = [ kconfig kcrash kservice libcap ];
propagatedBuildInputs = [ ki18n kio kwindowsystem ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);

View File

@ -1,27 +1,55 @@
{ stdenv, fetchurl, attr, perl }:
{ stdenv, fetchurl, attr, perl, pam ? null }:
assert pam != null -> stdenv.isLinux;
stdenv.mkDerivation rec {
name = "libcap-${version}";
version = "2.24";
version = "2.25";
src = fetchurl {
url = "mirror://kernel/linux/libs/security/linux-privs/libcap2/${name}.tar.xz";
sha256 = "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f";
sha256 = "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39";
};
outputs = [ "dev" "out" ];
outputs = [ "dev" "lib" "doc" "out" ]
++ stdenv.lib.optional (pam != null) "pam";
nativeBuildInputs = [ perl ];
buildInputs = [ pam ];
propagatedBuildInputs = [ attr ];
preConfigure = "cd libcap";
makeFlags = [
"lib=lib"
(stdenv.lib.optional (pam != null) "PAM_CAP=yes")
];
makeFlags = "lib=lib prefix=$(out)";
prePatch = ''
# use relative bash path
substituteInPlace progs/capsh.c --replace "/bin/bash" "bash"
# ensure capsh can find bash in $PATH
substituteInPlace progs/capsh.c --replace execve execvpe
'';
preInstall = ''
substituteInPlace Make.Rules \
--replace 'prefix=/usr' "prefix=$lib" \
--replace 'exec_prefix=' "exec_prefix=$out" \
--replace 'lib_prefix=$(exec_prefix)' "lib_prefix=$lib" \
--replace 'inc_prefix=$(prefix)' "inc_prefix=$dev" \
--replace 'man_prefix=$(prefix)' "man_prefix=$doc"
'';
installFlags = "RAISE_SETFCAP=no";
postInstall = ''
rm "$out"/lib/*.a
mkdir -p "$dev/share/doc/${name}"
cp ../License "$dev/share/doc/${name}/License"
rm "$lib"/lib/*.a
mkdir -p "$doc/share/doc/${name}"
cp License "$doc/share/doc/${name}/"
'' + stdenv.lib.optionalString (pam != null) ''
mkdir -p "$pam/lib/security"
mv "$lib"/lib/security "$pam/lib"
'';
meta = {

View File

@ -1,13 +0,0 @@
{stdenv, libcap}:
assert stdenv.isLinux;
stdenv.mkDerivation rec {
name = "libcap-docs-${libcap.version}";
inherit (libcap) src;
makeFlags = "MANDIR=$(out)/share/man";
preConfigure = "cd doc";
}

View File

@ -1,15 +0,0 @@
{stdenv, pam, libcap}:
assert stdenv.isLinux;
stdenv.mkDerivation rec {
name = "libcap-pam-${libcap.version}";
inherit (libcap) src;
buildInputs = [ libcap pam ];
preConfigure = "cd pam_cap";
makeFlags = "${libcap.makeFlags} PAM_CAP=yes";
}

View File

@ -1,28 +0,0 @@
{stdenv, libcap}:
assert stdenv.isLinux;
stdenv.mkDerivation rec {
name = "libcap-progs-${libcap.version}";
inherit (libcap) src makeFlags;
buildInputs = [ libcap ];
prePatch = ''
# use relative bash path
substituteInPlace progs/capsh.c --replace "/bin/bash" "bash"
# ensure capsh can find bash in $PATH
substituteInPlace progs/capsh.c --replace execve execvpe
'';
preConfigure = "cd progs";
installFlags = "RAISE_SETFCAP=no";
postInstall = ''
mkdir -p "$out/share/doc/${name}"
cp ../License "$out/share/doc/${name}/"
'';
}

View File

@ -1,5 +1,5 @@
{ stdenv, acl, attr, autoreconfHook, bash, bc, coreutils, e2fsprogs, fetchgit, fio, gawk
, lib, libaio, libcap_progs, libuuid, libxfs, lvm2, openssl, perl, procps, psmisc, su
, lib, libaio, libcap, libuuid, libxfs, lvm2, openssl, perl, procps, psmisc, su
, time, utillinux, which, writeScript, xfsprogs }:
stdenv.mkDerivation {
@ -72,7 +72,7 @@ stdenv.mkDerivation {
ln -s @out@/lib/xfstests/$f $f
done
export PATH=${lib.makeBinPath [acl attr bc e2fsprogs fio gawk libcap_progs lvm2 perl procps psmisc su utillinux which xfsprogs]}:$PATH
export PATH=${lib.makeBinPath [acl attr bc e2fsprogs fio gawk libcap lvm2 perl procps psmisc su utillinux which xfsprogs]}:$PATH
exec ./check "$@"
'';

View File

@ -54,6 +54,9 @@ doNotDisplayTwice rec {
joseki = apache-jena-fuseki; # added 2016-02-28
jquery_ui = jquery-ui; # added 2014-09-07
libdbusmenu_qt5 = qt5.libdbusmenu; # added 2015-12-19
libcap_manpages = libcap.doc; # added 2016-04-29
libcap_pam = if stdenv.isLinux then libcap.pam else null; # added 2016-04-29
libcap_progs = libcap.out; # added 2016-04-29
libtidy = html-tidy; # added 2014-12-21
links = links2; # added 2016-01-31
lttngTools = lttng-tools; # added 2014-07-31

View File

@ -10951,12 +10951,6 @@ in
libcap = callPackage ../os-specific/linux/libcap { };
libcap_progs = callPackage ../os-specific/linux/libcap/progs.nix { };
libcap_pam = callPackage ../os-specific/linux/libcap/pam.nix { };
libcap_manpages = callPackage ../os-specific/linux/libcap/man.nix { };
libcap_ng = callPackage ../os-specific/linux/libcap-ng {
swig = null; # Currently not using the python2/3 bindings
python2 = null; # Currently not using the python2 bindings