Skip to content

Commit

Permalink
podman: includes missing edk2-aarch64-code.fd on aarch64-darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
tricktron committed Mar 6, 2022
1 parent a13a62d commit 24d04d8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkgs/applications/virtualization/podman/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
, systemd
, go-md2man
, nixosTests
, qemu
}:

buildGoModule rec {
Expand Down Expand Up @@ -44,6 +45,14 @@ buildGoModule rec {
systemd
];

patches = lib.optional (stdenv.isDarwin && stdenv.isAarch64) [
./fix-edk2-aarch64-darwin.patch
];

postPatch = lib.optional (stdenv.isDarwin && stdenv.isAarch64) ''
substituteAllInPlace pkg/machine/qemu/options_darwin_arm64.go;
'';

buildPhase = ''
runHook preBuild
patchShebangs .
Expand Down Expand Up @@ -74,6 +83,9 @@ buildGoModule rec {
PREFIX=$out make install.completions
MANDIR=$man/share/man make install.man
runHook postInstall
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
mkdir $out/share/qemu
ln -s ${qemu}/share/qemu/edk2-aarch64-code.fd $out/share/qemu
'';

postFixup = lib.optionalString stdenv.isLinux ''
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/pkg/machine/qemu/options_darwin_arm64.go b/pkg/machine/qemu/options_darwin_arm64.go
--- a/pkg/machine/qemu/options_darwin_arm64.go
+++ b/pkg/machine/qemu/options_darwin_arm64.go
@@ -45,8 +45,7 @@ func getOvmfDir(imagePath, vmName string) string {
*/
func getEdk2CodeFd(name string) string {
dirs := []string{
- "/usr/local/share/qemu",
- "/opt/homebrew/share/qemu",
+ "@out@/share/qemu",
}
for _, dir := range dirs {
fullpath := filepath.Join(dir, name)

0 comments on commit 24d04d8

Please sign in to comment.