Skip to content

Commit

Permalink
rpm: fix build for darwin aarch64
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LeSuisse committed Feb 3, 2022
1 parent 86a6c0c commit 3504c23
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 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 {
Expand Down Expand Up @@ -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' ""
'';
Expand Down

0 comments on commit 3504c23

Please sign in to comment.