2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-26 15:44:20 +00:00

Merge pull request from SuperSandro2000/libcap-ng

This commit is contained in:
Sandro 2022-09-04 21:02:29 +02:00 committed by GitHub
commit 7419a3a676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 26 deletions
pkgs
os-specific/linux/libcap-ng
top-level

View File

@ -1,36 +1,19 @@
{ lib, stdenv, fetchurl, swig ? null, python2 ? null, python3 ? null }:
assert python2 != null || python3 != null -> swig != null;
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "libcap-ng";
# When updating make sure to test that the version with
# all of the python bindings still works
version = "0.8.3";
src = fetchurl {
url = "${meta.homepage}/${pname}-${version}.tar.gz";
url = "https://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${version}.tar.gz";
sha256 = "sha256-vtb2hI4iuy+Dtfdksq7w7TkwVOgDqOOocRyyo55rSS0=";
};
nativeBuildInputs = [ swig ];
buildInputs = [ python2 python3 ];
postPatch = ''
function get_header() {
echo -e "#include <$1>" | gcc -M -xc - | tr ' ' '\n' | grep "$1" | head -n 1
}
# Fix some hardcoding of header paths
sed -i "s,/usr/include/linux/capability.h,$(get_header linux/capability.h),g" bindings/python{,3}/Makefile.in
'';
configureFlags = [
(if python2 != null then "--with-python" else "--without-python")
(if python3 != null then "--with-python3" else "--without-python3")
"--without-python"
];
meta = let inherit (lib) platforms licenses; in {
meta = with lib; {
description = "Library for working with POSIX capabilities";
homepage = "https://people.redhat.com/sgrubb/libcap-ng/";
platforms = platforms.linux;

View File

@ -24465,11 +24465,7 @@ with pkgs;
libcap = callPackage ../os-specific/linux/libcap { };
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
python3 = null; # Currently not using the python3 bindings
};
libcap_ng = callPackage ../os-specific/linux/libcap-ng { };
libnotify = callPackage ../development/libraries/libnotify { };