Merge pull request #208061 from wegank/ares-darwin

ares: add darwin support

authored by

Anderson Torres and committed by
GitHub
0ad5b197 374cfcfa

+85 -5
+39
pkgs/applications/emulators/bsnes/ares/002-sips-to-png2icns.patch
··· 1 + diff --git a/desktop-ui/GNUmakefile b/desktop-ui/GNUmakefile 2 + index 4515610d3..916c8fcd8 100644 3 + --- a/desktop-ui/GNUmakefile 4 + +++ b/desktop-ui/GNUmakefile 5 + @@ -91,7 +91,7 @@ endif 6 + cp resource/$(name).plist $(output.path)/$(name).app/Contents/Info.plist 7 + cp -R $(ares.path)/Shaders $(output.path)/$(name).app/Contents/Resources/ 8 + cp -R $(mia.path)/Database $(output.path)/$(name).app/Contents/Resources/ 9 + - sips -s format icns resource/$(name).png --out $(output.path)/$(name).app/Contents/Resources/$(name).icns 10 + + png2icns $(output.path)/$(name).app/Contents/Resources/$(name).icns resource/$(name).png 11 + codesign --force --deep --options runtime --entitlements resource/$(name).selfsigned.entitlements --sign - $(output.path)/$(name).app 12 + else ifeq ($(platform),windows) 13 + $(call mkdir,$(output.path)/Shaders/) 14 + diff --git a/genius/GNUmakefile b/genius/GNUmakefile 15 + index 5287309a8..8d80f9306 100644 16 + --- a/genius/GNUmakefile 17 + +++ b/genius/GNUmakefile 18 + @@ -24,7 +24,7 @@ ifeq ($(platform),macos) 19 + mkdir -p $(output.path)/$(name).app/Contents/Resources/ 20 + mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name) 21 + cp data/$(name).plist $(output.path)/$(name).app/Contents/Info.plist 22 + - sips -s format icns data/$(name).png --$(output.path) $(output.path)/$(name).app/Contents/Resources/$(name).icns 23 + + png2icns $(output.path)/$(name).app/Contents/Resources/$(name).icns data/$(name).png 24 + endif 25 + 26 + verbose: hiro.verbose nall.verbose all; 27 + diff --git a/mia/GNUmakefile b/mia/GNUmakefile 28 + index b6930b6df..7a51b5028 100644 29 + --- a/mia/GNUmakefile 30 + +++ b/mia/GNUmakefile 31 + @@ -32,7 +32,7 @@ ifeq ($(platform),macos) 32 + mkdir -p $(output.path)/$(name).app/Contents/Resources/ 33 + mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name) 34 + cp resource/$(name).plist $(output.path)/$(name).app/Contents/Info.plist 35 + - sips -s format icns resource/$(name).png --out $(output.path)/$(name).app/Contents/Resources/$(name).icns 36 + + png2icns $(output.path)/$(name).app/Contents/Resources/$(name).icns resource/$(name).png 37 + endif 38 + 39 + verbose: hiro.verbose nall.verbose all;
+23
pkgs/applications/emulators/bsnes/ares/003-fix-darwin-install.patch
··· 1 + diff --git a/desktop-ui/GNUmakefile b/desktop-ui/GNUmakefile 2 + index 916c8fcd8..b767c1335 100644 3 + --- a/desktop-ui/GNUmakefile 4 + +++ b/desktop-ui/GNUmakefile 5 + @@ -92,7 +92,6 @@ endif 6 + cp -R $(ares.path)/Shaders $(output.path)/$(name).app/Contents/Resources/ 7 + cp -R $(mia.path)/Database $(output.path)/$(name).app/Contents/Resources/ 8 + png2icns $(output.path)/$(name).app/Contents/Resources/$(name).icns resource/$(name).png 9 + - codesign --force --deep --options runtime --entitlements resource/$(name).selfsigned.entitlements --sign - $(output.path)/$(name).app 10 + else ifeq ($(platform),windows) 11 + $(call mkdir,$(output.path)/Shaders/) 12 + $(call mkdir,$(output.path)/Database/) 13 + @@ -115,8 +114,8 @@ ifeq ($(platform),windows) 14 + else ifeq ($(shell id -un),root) 15 + $(error "make install should not be run as root") 16 + else ifeq ($(platform),macos) 17 + - mkdir -p ~/Library/Application\ Support/$(name)/ 18 + - cp -R $(output.path)/$(name).app /Applications/$(name).app 19 + + mkdir -p $(prefix)/Applications/ 20 + + cp -R $(output.path)/$(name).app $(prefix)/Applications/$(name).app 21 + else ifneq ($(filter $(platform),linux bsd),) 22 + mkdir -p $(prefix)/bin/ 23 + mkdir -p $(prefix)/share/applications/
+22 -4
pkgs/applications/emulators/bsnes/ares/default.nix
··· 3 3 , fetchFromGitHub 4 4 , pkg-config 5 5 , wrapGAppsHook 6 + , libicns 6 7 , SDL2 7 8 , alsa-lib 8 9 , gtk3 ··· 15 16 , libpulseaudio 16 17 , openal 17 18 , udev 19 + , darwin 18 20 }: 19 21 22 + let 23 + inherit (darwin.apple_sdk_11_0.frameworks) Cocoa OpenAL; 24 + in 20 25 stdenv.mkDerivation (finalAttrs: { 21 26 pname = "ares"; 22 27 version = "130.1"; ··· 31 36 patches = [ 32 37 ./000-dont-rebuild-on-install.patch 33 38 ./001-fix-ruby.patch 39 + ./002-sips-to-png2icns.patch 40 + ./003-fix-darwin-install.patch 34 41 ]; 35 42 36 43 nativeBuildInputs = [ 37 44 pkg-config 38 45 wrapGAppsHook 46 + ] ++ lib.optionals stdenv.isDarwin [ 47 + libicns 39 48 ]; 40 49 41 50 buildInputs = [ 42 51 SDL2 52 + libao 53 + ] ++ lib.optionals stdenv.isLinux [ 43 54 alsa-lib 44 55 gtk3 45 56 gtksourceview3 ··· 47 58 libGLU 48 59 libX11 49 60 libXv 50 - libao 51 61 libpulseaudio 52 62 openal 53 63 udev 64 + ] ++ lib.optionals stdenv.isDarwin [ 65 + Cocoa 66 + OpenAL 54 67 ]; 55 68 56 69 enableParallelBuilding = true; 57 70 58 - makeFlags = [ 71 + makeFlags = lib.optionals stdenv.isLinux [ 59 72 "hiro=gtk3" 73 + ] ++ lib.optionals stdenv.isDarwin [ 74 + "hiro=cocoa" 75 + "vulkan=false" 76 + ] ++ [ 60 77 "local=false" 61 78 "openmp=true" 62 79 "prefix=$(out)" 63 80 "-C desktop-ui" 64 81 ]; 82 + 83 + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.14"; 65 84 66 85 meta = with lib; { 67 86 homepage = "https://ares-emu.net"; 68 87 description = "Open-source multi-system emulator with a focus on accuracy and preservation"; 69 88 license = licenses.isc; 70 89 maintainers = with maintainers; [ Madouura AndersonTorres ]; 71 - platforms = platforms.linux; 90 + platforms = platforms.unix; 72 91 }; 73 92 }) 74 93 # TODO: select between Qt, GTK2 and GTK3 75 - # TODO: support Darwin
+1 -1
pkgs/top-level/all-packages.nix
··· 2173 2173 2174 2174 ### APPLICATIONS/EMULATORS/BSNES 2175 2175 2176 - ares = callPackage ../applications/emulators/bsnes/ares { }; 2176 + ares = darwin.apple_sdk_11_0.callPackage ../applications/emulators/bsnes/ares { }; 2177 2177 2178 2178 bsnes-hd = callPackage ../applications/emulators/bsnes/bsnes-hd { 2179 2179 inherit (darwin.apple_sdk.frameworks) Cocoa OpenAL;