Merge pull request #83469 from veprbl/pr/mame_darwin_fix

mame: add darwin support
This commit is contained in:
Dmitry Kalinkin 2020-03-28 18:24:43 -04:00 committed by GitHub
commit 97530e119f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 8 deletions

View File

@ -1,14 +1,17 @@
{ stdenv, mkDerivation, fetchFromGitHub, makeDesktopItem, makeWrapper
, python, pkgconfig, SDL2, SDL2_ttf, alsaLib, which, qtbase, libXinerama
, libpcap, CoreAudioKit, ForceFeedback
, installShellFiles }:
with stdenv;
let
majorVersion = "0";
minorVersion = "219";
desktopItem = makeDesktopItem {
name = "MAME";
exec = "mame${stdenv.lib.optionalString stdenv.is64bit "64"}";
exec = "mame${lib.optionalString stdenv.is64bit "64"}";
desktopName = "MAME";
genericName = "MAME is a multi-purpose emulation framework";
categories = "System;Emulator;";
@ -27,13 +30,22 @@ in mkDerivation {
};
hardeningDisable = [ "fortify" ];
NIX_CFLAGS_COMPILE = [ "-Wno-error=maybe-uninitialized" ];
NIX_CFLAGS_COMPILE = [ "-Wno-error=maybe-uninitialized" "-Wno-error=missing-braces" ];
makeFlags = [ "TOOLS=1" ];
makeFlags = [
"TOOLS=1"
"USE_LIBSDL=1"
]
++ lib.optionals stdenv.cc.isClang [ "CC=clang" "CXX=clang++" ]
;
dontWrapQtApps = true;
buildInputs = [ SDL2 SDL2_ttf alsaLib qtbase libXinerama ];
buildInputs =
[ SDL2 SDL2_ttf qtbase libXinerama ]
++ lib.optional stdenv.isLinux alsaLib
++ lib.optionals stdenv.isDarwin [ libpcap CoreAudioKit ForceFeedback ]
;
nativeBuildInputs = [ python pkgconfig which makeWrapper installShellFiles ];
# by default MAME assumes that paths with stock resources
@ -58,16 +70,18 @@ in mkDerivation {
installManPage ${dest}/docs/man/*.1 ${dest}/docs/man/*.6
mv artwork plugins samples ${dest}
'' + lib.optionalString stdenv.isLinux ''
mkdir -p $out/share
ln -s ${desktopItem}/share/applications $out/share
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Is a multi-purpose emulation framework";
homepage = https://www.mamedev.org/;
license = with licenses; [ bsd3 gpl2Plus ];
platforms = [ "x86_64-linux" "i686-linux" ];
platforms = platforms.unix;
# makefile needs fixes for install target
badPlatforms = [ "aarch64-linux" ];
maintainers = with maintainers; [ gnidorah ];
};
}

View File

@ -25308,7 +25308,9 @@ in
icu = icu58;
};
mame = libsForQt5.callPackage ../misc/emulators/mame { };
mame = libsForQt5.callPackage ../misc/emulators/mame {
inherit (darwin.apple_sdk.frameworks) CoreAudioKit ForceFeedback;
};
martyr = callPackage ../development/libraries/martyr { };