3
0
Fork 0
forked from mirrors/nixpkgs

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`.
This commit is contained in:
Alexander Sosedkin 2022-07-16 01:22:28 +02:00
parent 1fc760e913
commit b4a0bdcf92

View file

@ -1,7 +1,7 @@
{ stdenv, lib { stdenv, lib
, pkg-config, autoreconfHook , pkg-config, autoreconfHook
, fetchurl, cpio, zlib, bzip2, file, elfutils, libbfd, libgcrypt, libarchive, nspr, nss, popt, db, xz, python, lua, llvmPackages , 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 { stdenv.mkDerivation rec {
@ -18,7 +18,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook pkg-config ]; nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ cpio zlib zstd bzip2 file libarchive libgcrypt nspr nss db xz python lua sqlite ] 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 # rpm/rpmlib.h includes popt.h, and then the pkg-config file mentions these as linkage requirements
propagatedBuildInputs = [ popt nss db bzip2 libarchive libbfd ] propagatedBuildInputs = [ popt nss db bzip2 libarchive libbfd ]
@ -35,7 +36,7 @@ stdenv.mkDerivation rec {
"--enable-zstd" "--enable-zstd"
"--localstatedir=/var" "--localstatedir=/var"
"--sharedstatedir=/com" "--sharedstatedir=/com"
]; ] ++ lib.optional stdenv.isLinux "--with-cap";
patches = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ # Fix build for macOS aarch64 patches = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ # Fix build for macOS aarch64
(fetchpatch { (fetchpatch {