From 64ef643833de573ccec8bb0d923b5d6807ef81b0 Mon Sep 17 00:00:00 2001 From: Alexander Ried Date: Tue, 19 Apr 2016 23:12:09 +0200 Subject: [PATCH 1/4] libcap: 2.24 -> 2.25 --- pkgs/os-specific/linux/libcap/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix index c8484babcdf8..411044c1b925 100644 --- a/pkgs/os-specific/linux/libcap/default.nix +++ b/pkgs/os-specific/linux/libcap/default.nix @@ -2,11 +2,11 @@ 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" ]; From 7382afac40c23841e5d6a491bd4a9412d766ecab Mon Sep 17 00:00:00 2001 From: Alexander Ried Date: Tue, 19 Apr 2016 23:12:45 +0200 Subject: [PATCH 2/4] libcap: replace old split with multi-output --- pkgs/os-specific/linux/libcap/default.nix | 42 +++++++++++++++++++---- pkgs/os-specific/linux/libcap/man.nix | 13 ------- pkgs/os-specific/linux/libcap/pam.nix | 15 -------- pkgs/os-specific/linux/libcap/progs.nix | 28 --------------- pkgs/top-level/all-packages.nix | 6 ++-- 5 files changed, 38 insertions(+), 66 deletions(-) delete mode 100644 pkgs/os-specific/linux/libcap/man.nix delete mode 100644 pkgs/os-specific/linux/libcap/pam.nix delete mode 100644 pkgs/os-specific/linux/libcap/progs.nix diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix index 411044c1b925..13d2fb7f5c5a 100644 --- a/pkgs/os-specific/linux/libcap/default.nix +++ b/pkgs/os-specific/linux/libcap/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, attr, perl }: +{ stdenv, fetchurl, attr, perl, pam ? null }: +assert pam != null -> stdenv.isLinux; stdenv.mkDerivation rec { name = "libcap-${version}"; @@ -9,19 +10,46 @@ stdenv.mkDerivation rec { 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 = { diff --git a/pkgs/os-specific/linux/libcap/man.nix b/pkgs/os-specific/linux/libcap/man.nix deleted file mode 100644 index eeb780f095bd..000000000000 --- a/pkgs/os-specific/linux/libcap/man.nix +++ /dev/null @@ -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"; -} diff --git a/pkgs/os-specific/linux/libcap/pam.nix b/pkgs/os-specific/linux/libcap/pam.nix deleted file mode 100644 index 3dd7cd947af2..000000000000 --- a/pkgs/os-specific/linux/libcap/pam.nix +++ /dev/null @@ -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"; -} diff --git a/pkgs/os-specific/linux/libcap/progs.nix b/pkgs/os-specific/linux/libcap/progs.nix deleted file mode 100644 index e3871f15f885..000000000000 --- a/pkgs/os-specific/linux/libcap/progs.nix +++ /dev/null @@ -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}/" - ''; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 446501c094b6..911326d023eb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10913,11 +10913,11 @@ in libcap = callPackage ../os-specific/linux/libcap { }; - libcap_progs = callPackage ../os-specific/linux/libcap/progs.nix { }; + libcap_progs = libcap.out; - libcap_pam = callPackage ../os-specific/linux/libcap/pam.nix { }; + libcap_pam = if stdenv.isLinux then libcap.pam else null; - libcap_manpages = callPackage ../os-specific/linux/libcap/man.nix { }; + libcap_manpages = libcap.doc; libcap_ng = callPackage ../os-specific/linux/libcap-ng { swig = null; # Currently not using the python2/3 bindings From 5c295a4925fed2095fbdf80d8ae85da815652f0a Mon Sep 17 00:00:00 2001 From: Alexander Ried Date: Tue, 19 Apr 2016 23:25:26 +0200 Subject: [PATCH 3/4] libcap: Replace occurences of libcap_progs with libcap.out --- pkgs/desktops/kde-5/frameworks-5.19/kinit/default.nix | 3 +-- pkgs/tools/misc/xfstests/default.nix | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/desktops/kde-5/frameworks-5.19/kinit/default.nix b/pkgs/desktops/kde-5/frameworks-5.19/kinit/default.nix index 64210ca76051..90dbf96972fa 100644 --- a/pkgs/desktops/kde-5/frameworks-5.19/kinit/default.nix +++ b/pkgs/desktops/kde-5/frameworks-5.19/kinit/default.nix @@ -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); diff --git a/pkgs/tools/misc/xfstests/default.nix b/pkgs/tools/misc/xfstests/default.nix index 957582a3687f..5269955ebdf9 100644 --- a/pkgs/tools/misc/xfstests/default.nix +++ b/pkgs/tools/misc/xfstests/default.nix @@ -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 "$@" ''; From a0a6a3df88e6d1d3542dee0e8d7c8f71fb8293b9 Mon Sep 17 00:00:00 2001 From: Alexander Ried Date: Fri, 29 Apr 2016 04:42:30 +0200 Subject: [PATCH 4/4] libcap: Move old libcap_* aliases to aliases.nix --- pkgs/top-level/aliases.nix | 3 +++ pkgs/top-level/all-packages.nix | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 266313c81e10..964e78413441 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 911326d023eb..66a60a9cfa46 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10913,12 +10913,6 @@ in libcap = callPackage ../os-specific/linux/libcap { }; - libcap_progs = libcap.out; - - libcap_pam = if stdenv.isLinux then libcap.pam else null; - - libcap_manpages = libcap.doc; - 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