libcap-ng: 0.7.3 -> 0.7.7

Also support swig + python bindings

+31 -9
+26 -8
pkgs/os-specific/linux/libcap-ng/default.nix
··· 1 - { stdenv, fetchurl, python }: 1 + { stdenv, fetchurl, swig ? null, python2 ? null, python3 ? null }: 2 2 3 - assert stdenv.isLinux; 3 + assert python2 != null || python3 != null -> swig != null; 4 4 5 5 stdenv.mkDerivation rec { 6 6 name = "libcap-ng-${version}"; 7 - version = "0.7.3"; 7 + # When updating make sure to test that the version with 8 + # all of the python bindings still works 9 + version = "0.7.7"; 8 10 9 11 src = fetchurl { 10 12 url = "${meta.homepage}/${name}.tar.gz"; 11 - sha256 = "1cavlcrpqi4imkmagjhw65br8rv2fsbhf68mm3lczr51sg44392w"; 13 + sha256 = "0syhyrixk7fqvwis3k7iddn75g0qxysc1q5fifvzccxk7774jmb1"; 12 14 }; 13 15 14 - buildInputs = [ python ]; # ToDo? optional swig for python bindings 16 + nativeBuildInputs = [ swig ]; 17 + buildInputs = [ python2 python3 ]; 15 18 16 - meta = { 19 + postPatch = '' 20 + function get_header() { 21 + echo -e "#include <$1>" | gcc -M -xc - | tr ' ' '\n' | grep "$1" | head -n 1 22 + } 23 + 24 + # Fix some hardcoding of header paths 25 + sed -i "s,/usr/include/linux/capability.h,$(get_header linux/capability.h),g" bindings/python{,3}/Makefile.in 26 + ''; 27 + 28 + configureFlags = [ 29 + (if python2 != null then "--with-python" else "--without-python") 30 + (if python3 != null then "--with-python3" else "--without-python3") 31 + ]; 32 + 33 + meta = let inherit (stdenv.lib) platforms licenses maintainers; in { 17 34 description = "Library for working with POSIX capabilities"; 18 35 homepage = http://people.redhat.com/sgrubb/libcap-ng/; 19 - platforms = stdenv.lib.platforms.linux; 20 - license = stdenv.lib.licenses.lgpl21; 36 + platforms = platforms.linux; 37 + license = licenses.lgpl21; 38 + maintainers = with maintainers; [ wkennington ]; 21 39 }; 22 40 }
+5 -1
pkgs/top-level/all-packages.nix
··· 9921 9921 9922 9922 libcap_manpages = callPackage ../os-specific/linux/libcap/man.nix { }; 9923 9923 9924 - libcap_ng = callPackage ../os-specific/linux/libcap-ng { }; 9924 + libcap_ng = callPackage ../os-specific/linux/libcap-ng { 9925 + swig = null; # Currently not using the python2/3 bindings 9926 + python2 = null; # Currently not using the python2 bindings 9927 + python3 = null; # Currently not using the python3 bindings 9928 + }; 9925 9929 9926 9930 libnscd = callPackage ../os-specific/linux/libnscd { }; 9927 9931