Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

mame: add darwin support

(cherry picked from commit 39921bd43ba6ccd273f4337098b71eb851e9c77d)

authored by

Dmitry Kalinkin and committed by
Daiderd Jordan
8876e5ed 06fe4b25

+24 -8
+21 -7
pkgs/misc/emulators/mame/default.nix
··· 1 1 { stdenv, mkDerivation, fetchFromGitHub, makeDesktopItem, makeWrapper 2 2 , python, pkgconfig, SDL2, SDL2_ttf, alsaLib, which, qtbase, libXinerama 3 + , libpcap, CoreAudioKit, ForceFeedback 3 4 , installShellFiles }: 5 + 6 + with stdenv; 4 7 5 8 let 6 9 majorVersion = "0"; ··· 8 11 9 12 desktopItem = makeDesktopItem { 10 13 name = "MAME"; 11 - exec = "mame${stdenv.lib.optionalString stdenv.is64bit "64"}"; 14 + exec = "mame${lib.optionalString stdenv.is64bit "64"}"; 12 15 desktopName = "MAME"; 13 16 genericName = "MAME is a multi-purpose emulation framework"; 14 17 categories = "System;Emulator;"; ··· 27 30 }; 28 31 29 32 hardeningDisable = [ "fortify" ]; 30 - NIX_CFLAGS_COMPILE = [ "-Wno-error=maybe-uninitialized" ]; 33 + NIX_CFLAGS_COMPILE = [ "-Wno-error=maybe-uninitialized" "-Wno-error=missing-braces" ]; 31 34 32 - makeFlags = [ "TOOLS=1" ]; 35 + makeFlags = [ 36 + "TOOLS=1" 37 + "USE_LIBSDL=1" 38 + ] 39 + ++ lib.optionals stdenv.cc.isClang [ "CC=clang" "CXX=clang++" ] 40 + ; 33 41 34 42 dontWrapQtApps = true; 35 43 36 - buildInputs = [ SDL2 SDL2_ttf alsaLib qtbase libXinerama ]; 44 + buildInputs = 45 + [ SDL2 SDL2_ttf qtbase libXinerama ] 46 + ++ lib.optional stdenv.isLinux alsaLib 47 + ++ lib.optionals stdenv.isDarwin [ libpcap CoreAudioKit ForceFeedback ] 48 + ; 37 49 nativeBuildInputs = [ python pkgconfig which makeWrapper installShellFiles ]; 38 50 39 51 # by default MAME assumes that paths with stock resources ··· 58 70 installManPage ${dest}/docs/man/*.1 ${dest}/docs/man/*.6 59 71 60 72 mv artwork plugins samples ${dest} 61 - 73 + '' + lib.optionalString stdenv.isLinux '' 62 74 mkdir -p $out/share 63 75 ln -s ${desktopItem}/share/applications $out/share 64 76 ''; 65 77 66 - meta = with stdenv.lib; { 78 + meta = with lib; { 67 79 description = "Is a multi-purpose emulation framework"; 68 80 homepage = https://www.mamedev.org/; 69 81 license = with licenses; [ bsd3 gpl2Plus ]; 70 - platforms = [ "x86_64-linux" "i686-linux" ]; 82 + platforms = platforms.unix; 83 + # makefile needs fixes for install target 84 + badPlatforms = [ "aarch64-linux" ]; 71 85 maintainers = with maintainers; [ gnidorah ]; 72 86 }; 73 87 }
+3 -1
pkgs/top-level/all-packages.nix
··· 24971 24971 icu = icu58; 24972 24972 }; 24973 24973 24974 - mame = libsForQt5.callPackage ../misc/emulators/mame { }; 24974 + mame = libsForQt5.callPackage ../misc/emulators/mame { 24975 + inherit (darwin.apple_sdk.frameworks) CoreAudioKit ForceFeedback; 24976 + }; 24975 24977 24976 24978 martyr = callPackage ../development/libraries/martyr { }; 24977 24979