rpm: fix build for darwin aarch64

This contribution uses an upstream fix rpm-software-management/rpm#1775
To limit the chances of breaking other architectures or systems the
patch is only used when we target darwin aarch64.
main
Thomas Gerbet 2 years ago committed by Thomas Gerbet
parent 86a6c0c4af
commit 3504c23b78
  1. 9
      pkgs/tools/package-management/rpm/default.nix

@ -1,7 +1,7 @@
{ stdenv, lib
, pkg-config, autoreconfHook
, fetchurl, cpio, zlib, bzip2, file, elfutils, libbfd, libgcrypt, libarchive, nspr, nss, popt, db, xz, python, lua, llvmPackages
, sqlite, zstd
, sqlite, zstd, fetchpatch
}:
stdenv.mkDerivation rec {
@ -37,6 +37,13 @@ stdenv.mkDerivation rec {
"--sharedstatedir=/com"
];
patches = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ # Fix build for macOS aarch64
(fetchpatch {
url = "https://github.com/rpm-software-management/rpm/commit/ad87ced3990c7e14b6b593fa411505e99412e248.patch";
hash = "sha256-WYlxPGcPB5lGQmkyJ/IpGoqVfAKtMxKzlr5flTqn638=";
})
];
postPatch = ''
substituteInPlace Makefile.am --replace '@$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp' ""
'';

Loading…
Cancel
Save