Unverified Commit 55781585 authored by ajs124's avatar ajs124 Committed by GitHub
Browse files

Merge pull request #181659 from t184256/rpm-compile-with-cap

rpm: compile --with-cap
parents 8d665874 b4a0bdcf
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 {