From 2c59b12503f70bf743f24424ac295abf3feb434e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 22 Aug 2022 11:18:18 +0200 Subject: [PATCH] libcap_ng: remove unused code for python bindings The code was introduced way back in 2015 and is unused since then. https://github.com/NixOS/nixpkgs/commit/2dc9cb1120cc172055601182e76ee4759cd22fe9 --- pkgs/os-specific/linux/libcap-ng/default.nix | 25 ++++---------------- pkgs/top-level/all-packages.nix | 6 +---- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/pkgs/os-specific/linux/libcap-ng/default.nix b/pkgs/os-specific/linux/libcap-ng/default.nix index ad01a83ac935..1ba14c5f4714 100644 --- a/pkgs/os-specific/linux/libcap-ng/default.nix +++ b/pkgs/os-specific/linux/libcap-ng/default.nix @@ -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; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3cf743a4a780..9adaa895ce78 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24184,11 +24184,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 { };