Commit b4a0bdcf authored by Alexander Sosedkin's avatar Alexander Sosedkin
Browse files

rpm: compile --with-cap

Without that, RPM is unable to handle packages that require `rpmlib(FileCaps)`;
example error message trying to install Fedora 36 shadow-utils:
`rpmlib(FileCaps) <= 4.6.1-1 is needed by shadow-utils`.
parent 1fc760e9
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
{ stdenv, lib
, pkg-config, autoreconfHook
, fetchurl, cpio, zlib, bzip2, file, elfutils, libbfd, libgcrypt, libarchive, nspr, nss, popt, db, xz, python, lua, llvmPackages
, sqlite, zstd, fetchpatch
, sqlite, zstd, fetchpatch, libcap
}:

stdenv.mkDerivation rec {
@@ -18,7 +18,8 @@ stdenv.mkDerivation rec {

  nativeBuildInputs = [ autoreconfHook pkg-config ];
  buildInputs = [ cpio zlib zstd bzip2 file libarchive libgcrypt nspr nss db xz python lua sqlite ]
                ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
                ++ lib.optional stdenv.cc.isClang llvmPackages.openmp
                ++ lib.optional stdenv.isLinux libcap;

  # rpm/rpmlib.h includes popt.h, and then the pkg-config file mentions these as linkage requirements
  propagatedBuildInputs = [ popt nss db bzip2 libarchive libbfd ]
@@ -35,7 +36,7 @@ stdenv.mkDerivation rec {
    "--enable-zstd"
    "--localstatedir=/var"
    "--sharedstatedir=/com"
  ];
  ] ++ lib.optional stdenv.isLinux "--with-cap";

  patches = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ # Fix build for macOS aarch64
    (fetchpatch {