mame: add darwin support

This commit is contained in:
Dmitry Kalinkin 2020-03-27 02:17:27 -04:00
parent db4bbfff66
commit 39921bd43b
No known key found for this signature in database
GPG key ID: 5157B3EC8B2CA333
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

@ -25517,7 +25517,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 { };