Merge pull request #72319 from gnidorah/mame

mame: init at 0.215
This commit is contained in:
worldofpeace
2019-11-03 19:18:53 +00:00
committed by GitHub
5 changed files with 63 additions and 97 deletions

View File

@@ -0,0 +1,59 @@
{ stdenv, mkDerivation, fetchFromGitHub, makeDesktopItem
, python, pkgconfig, SDL2, SDL2_ttf, alsaLib, which, qtbase, libXinerama }:
let
majorVersion = "0";
minorVersion = "215";
desktopItem = makeDesktopItem {
name = "MAME";
exec = "mame${stdenv.lib.optionalString stdenv.is64bit "64"}";
desktopName = "MAME";
genericName = "MAME is a multi-purpose emulation framework";
categories = "System;Emulator;";
};
in mkDerivation {
pname = "mame";
version = "${majorVersion}.${minorVersion}";
src = fetchFromGitHub {
owner = "mamedev";
repo = "mame";
rev = "mame${majorVersion}${minorVersion}";
sha256 = "1phz846p3zzgzrbfiq2vn79iqar2dbf7iv6wfkrp32sdkkvp7l3h";
};
hardeningDisable = [ "fortify" ];
NIX_CFLAGS_COMPILE = [ "-Wno-error=maybe-uninitialized" ];
makeFlags = [ "TOOLS=1" ];
buildInputs = [ SDL2 SDL2_ttf alsaLib qtbase libXinerama ];
nativeBuildInputs = [ python pkgconfig which ];
installPhase = ''
dest=$out/opt/mame
make -f dist.mak PTR64=${if stdenv.is64bit then "1" else "0"}
mkdir -p $dest
mv build/release/${if stdenv.is64bit then "x64" else "x32"}/Release/mame/* $dest
mkdir -p $out/bin
find $dest -maxdepth 1 -executable -type f -exec mv -t $out/bin {} \;
mkdir -p $out/share/man/man{1,6}
mv $dest/docs/man/*.1 $out/share/man/man1
mv $dest/docs/man/*.6 $out/share/man/man6
mkdir -p $out/share
ln -s ${desktopItem}/share/applications $out/share
'';
meta = with stdenv.lib; {
description = "Is a multi-purpose emulation framework";
homepage = https://www.mamedev.org/;
license = with licenses; [ bsd3 gpl2Plus ];
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = with maintainers; [ gnidorah ];
};
}

View File

@@ -1,49 +0,0 @@
{ stdenv, fetchurl, unzip, pkgconfig, SDL, gtk2, GConf, libGLU_combined
, expat, zlib }:
let
version = "139";
mameSrc = fetchurl {
url = "https://github.com/mamedev/mame/releases/download/mame0139/mame0${version}s.zip";
sha256 = "1mpkwxfz38cgxzvlni2y3fxas3b8qmnzj2ik2zzbd8mr622jdp79";
};
messSrc = fetchurl {
url = "http://www.progettosnaps.net/MESS/src/mess0${version}s.zip";
name = "mess0139s.zip";
sha256 = "1v892cg6wn8cdwc8pf1gcqqdb1v1v295r6jw2hf58svwx3h27xyy";
};
in
stdenv.mkDerivation {
name = "mess-0.${version}";
unpackPhase =
''
unzip ${mameSrc}
# Yes, the MAME distribution is a zip file containing a zip file...
unzip mame.zip
unzip -o ${messSrc}
'';
makeFlags = "TARGET=mess BUILD_EXPAT= BUILD_ZLIB= NOWERROR=1";
buildInputs =
[ unzip pkgconfig SDL gtk2 GConf libGLU_combined expat zlib ];
installPhase =
''
mkdir -p $out/bin
cp mess* $out/bin/mess
'';
meta = {
homepage = https://www.mess.org/;
license = "non-commercial";
description = "Multi Emulator Super System, an emulator of many game consoles and computer systems";
broken = true;
};
}