Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman: includes missing edk2-aarch64-code.fd on aarch64-darwin #163015

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be done by adding it to the symlinkJoin in the wrapper anyway.

'';

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)