_86Box: darwin support

This commit is contained in:
Matteo Pacini 2024-08-17 15:19:00 +01:00
parent 2e7880b2d0
commit 04d72f3b80
2 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,15 @@
diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp
index 824f71023..1f38e4b5f 100644
--- a/src/qt/qt_platform.cpp
+++ b/src/qt/qt_platform.cpp
@@ -673,6 +673,10 @@ plat_init_rom_paths(void)
rom_add_path(QDir(path).filePath("86Box/roms").toUtf8().constData());
#endif
}
+
+ #ifdef __APPLE__
+ rom_add_path("@out@/share/86Box/roms/");
+ #endif
}
void

View File

@ -1,5 +1,6 @@
{ {
stdenv, stdenv,
darwin,
lib, lib,
fetchFromGitHub, fetchFromGitHub,
cmake, cmake,
@ -42,6 +43,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-ioE0EVIXv/biXXvLqwhmtZ/RJM0nLqcE+i+CU+WXBY4="; hash = "sha256-ioE0EVIXv/biXXvLqwhmtZ/RJM0nLqcE+i+CU+WXBY4=";
}; };
patches = [ ./darwin.patch ];
postPatch = ''
substituteAllInPlace src/qt/qt_platform.cpp
'';
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
pkg-config pkg-config
@ -64,7 +71,8 @@ stdenv.mkDerivation (finalAttrs: {
qt5.qttools qt5.qttools
] ++ lib.optional stdenv.isLinux alsa-lib ] ++ lib.optional stdenv.isLinux alsa-lib
++ lib.optional enableWayland wayland ++ lib.optional enableWayland wayland
++ lib.optional enableVncRenderer libvncserver; ++ lib.optional enableVncRenderer libvncserver
++ lib.optional stdenv.isDarwin darwin.apple_sdk_11_0.libs.xpc;
cmakeFlags = cmakeFlags =
lib.optional stdenv.isDarwin "-DCMAKE_MACOSX_BUNDLE=OFF" lib.optional stdenv.isDarwin "-DCMAKE_MACOSX_BUNDLE=OFF"
@ -114,6 +122,6 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://86box.net/"; homepage = "https://86box.net/";
license = with licenses; [ gpl2Only ] ++ optional (unfreeEnableDiscord || unfreeEnableRoms) unfree; license = with licenses; [ gpl2Only ] ++ optional (unfreeEnableDiscord || unfreeEnableRoms) unfree;
maintainers = [ maintainers.jchw ]; maintainers = [ maintainers.jchw ];
platforms = platforms.linux; platforms = platforms.linux ++ platforms.darwin;
}; };
}) })