xemu: darwin support
This commit is contained in:
@@ -28,6 +28,9 @@
|
||||
which,
|
||||
wrapGAppsHook3,
|
||||
cacert,
|
||||
darwin,
|
||||
apple-sdk_12,
|
||||
desktopToDarwinBundle,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
@@ -66,6 +69,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
which
|
||||
wrapGAppsHook3
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
darwin.sigtool
|
||||
desktopToDarwinBundle
|
||||
]
|
||||
++ (with python3Packages; [
|
||||
python
|
||||
pyyaml
|
||||
@@ -79,22 +86,34 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
glib
|
||||
gtk3
|
||||
curl
|
||||
libdrm
|
||||
libepoxy
|
||||
libpcap
|
||||
libsamplerate
|
||||
libslirp
|
||||
libgbm
|
||||
openssl
|
||||
vte
|
||||
vulkan-headers
|
||||
vulkan-loader
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
libdrm
|
||||
libgbm
|
||||
vte
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
apple-sdk_12
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--disable-strip"
|
||||
"--target-list=i386-softmmu"
|
||||
"--disable-werror"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
# As seen in the official build script ($src/build.sh)
|
||||
"--disable-cocoa"
|
||||
]
|
||||
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
|
||||
"--enable-hvf"
|
||||
];
|
||||
|
||||
buildFlags = [ "qemu-system-i386" ];
|
||||
@@ -117,6 +136,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
preConfigure = ''
|
||||
configureFlagsArray+=("--extra-cflags=-DXBOX=1 -Wno-error=redundant-decls")
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
configureFlagsArray+=("-Wno-implicit-function-declaration")
|
||||
''
|
||||
+ ''
|
||||
# When the data below can't be obtained through git, the build process tries
|
||||
# to run `XEMU_COMMIT=$(cat XEMU_COMMIT)` (and similar)
|
||||
echo '${finalAttrs.version}' > XEMU_VERSION
|
||||
@@ -127,6 +151,15 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
substituteInPlace ./build.ninja --replace /usr/bin/env $(which env)
|
||||
'';
|
||||
|
||||
postBuild =
|
||||
lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
|
||||
# Needed for HVF acceleration
|
||||
codesign --entitlements $src/accel/hvf/entitlements.plist -f -s - qemu-system-i386-unsigned
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
mv qemu-system-i386-unsigned qemu-system-i386
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
@@ -155,6 +188,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
license = lib.licenses.gpl2Plus;
|
||||
mainProgram = "xemu";
|
||||
maintainers = with lib.maintainers; [ marcin-serwin ];
|
||||
platforms = lib.platforms.linux;
|
||||
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user