git.iko.soy/typeable/nixpkgs
on master help sign in
mame: 0.215 -> 0.216
commit09f5d77faa3b8a01eed80c49ba3b716dc08fef88 authorgnidorah <gnidorah@users.noreply.github.com> dateFri 6 Dec 2019, 23:43 (7 years ago) parent2126e37
2 files changed+56−12
pkgs/misc/emulators/mame/default.nix+27−12 pkgs/misc/emulators/mame/emuopts.patch+29
pkgs/misc/emulators/mame/default.nix+27−12
@@ -1,9 +1,9 @@
1−{ stdenv, mkDerivation, fetchFromGitHub, makeDesktopItem
1+{ stdenv, mkDerivation, fetchFromGitHub, makeDesktopItem, makeWrapper
22, python, pkgconfig, SDL2, SDL2_ttf, alsaLib, which, qtbase, libXinerama }:
33
44let
55 majorVersion = "0";
6− minorVersion = "215";
6+ minorVersion = "216";
77
88 desktopItem = makeDesktopItem {
99 name = "MAME";
@@ -12,6 +12,8 @@ let
1212 genericName = "MAME is a multi-purpose emulation framework";
1313 categories = "System;Emulator;";
1414 };
15+
16+ dest = "$out/opt/mame";
1517in mkDerivation {
1618 pname = "mame";
1719 version = "${majorVersion}.${minorVersion}";
@@ -20,7 +22,7 @@ in mkDerivation {
2022 owner = "mamedev";
2123 repo = "mame";
2224 rev = "mame${majorVersion}${minorVersion}";
23− sha256 = "1phz846p3zzgzrbfiq2vn79iqar2dbf7iv6wfkrp32sdkkvp7l3h";
25+ sha256 = "0dmmw08pxxznvadrc51zg27jc9fjh688355w8kxkmi7k8qa367r0";
2426 };
2527
2628 hardeningDisable = [ "fortify" ];
@@ -28,22 +30,35 @@ in mkDerivation {
2830
2931 makeFlags = [ "TOOLS=1" ];
3032
33+ dontWrapQtApps = true;
34+
3135 buildInputs = [ SDL2 SDL2_ttf alsaLib qtbase libXinerama ];
32− nativeBuildInputs = [ python pkgconfig which ];
36+ nativeBuildInputs = [ python pkgconfig which makeWrapper ];
3337
34− installPhase = ''
35− dest=$out/opt/mame
38+ # by default MAME assumes that paths with stock resources
39+ # are relative and that you run MAME changing to
40+ # install directory, so we add absolute paths here
41+ patches = [ ./emuopts.patch ];
3642
37− make -f dist.mak PTR64=${if stdenv.is64bit then "1" else "0"}
38− mkdir -p $dest
39− mv build/release/${if stdenv.is64bit then "x64" else "x32"}/Release/mame/* $dest
43+ postPatch = ''
44+ substituteInPlace src/emu/emuopts.cpp \
45+ --subst-var-by mame ${dest}
46+ '';
47+
48+ installPhase = ''
49+ make -f dist.mak PTR64=${stdenv.lib.optionalString stdenv.is64bit "1"}
50+ mkdir -p ${dest}
51+ mv build/release/*/Release/mame/* ${dest}
4052
4153 mkdir -p $out/bin
42− find $dest -maxdepth 1 -executable -type f -exec mv -t $out/bin {} \;
54+ find ${dest} -maxdepth 1 -executable -type f -exec mv -t $out/bin {} \;
55+ install -Dm755 src/osd/sdl/taputil.sh $out/bin/taputil.sh
4356
4457 mkdir -p $out/share/man/man{1,6}
45− mv $dest/docs/man/*.1 $out/share/man/man1
46− mv $dest/docs/man/*.6 $out/share/man/man6
58+ mv ${dest}/docs/man/*.1 $out/share/man/man1
59+ mv ${dest}/docs/man/*.6 $out/share/man/man6
60+
61+ mv artwork plugins samples ${dest}
4762
4863 mkdir -p $out/share
4964 ln -s ${desktopItem}/share/applications $out/share
pkgs/misc/emulators/mame/emuopts.patchnew file+29
@@ -0,0 +1,29 @@
1+diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp
2+index c42fcef848..d1bddae060 100644
3+--- a/src/emu/emuopts.cpp
4++++ b/src/emu/emuopts.cpp
5+@@ -36,16 +36,16 @@ const options_entry emu_options::s_option_entries[] =
6+ { nullptr, nullptr, OPTION_HEADER, "CORE SEARCH PATH OPTIONS" },
7+ { OPTION_HOMEPATH, ".", OPTION_STRING, "path to base folder for plugin data (read/write)" },
8+ { OPTION_MEDIAPATH ";rp;biospath;bp", "roms", OPTION_STRING, "path to ROM sets and hard disk images" },
9+- { OPTION_HASHPATH ";hash_directory;hash", "hash", OPTION_STRING, "path to software definition files" },
10+- { OPTION_SAMPLEPATH ";sp", "samples", OPTION_STRING, "path to audio sample sets" },
11+- { OPTION_ARTPATH, "artwork", OPTION_STRING, "path to artwork files" },
12+- { OPTION_CTRLRPATH, "ctrlr", OPTION_STRING, "path to controller definitions" },
13+- { OPTION_INIPATH, ".;ini;ini/presets", OPTION_STRING, "path to ini files" },
14+- { OPTION_FONTPATH, ".", OPTION_STRING, "path to font files" },
15++ { OPTION_HASHPATH ";hash_directory;hash", "hash;@mame@/hash", OPTION_STRING, "path to software definition files" },
16++ { OPTION_SAMPLEPATH ";sp", "samples;@mame@/samples", OPTION_STRING, "path to audio sample sets" },
17++ { OPTION_ARTPATH, "artwork;@mame@/artwork", OPTION_STRING, "path to artwork files" },
18++ { OPTION_CTRLRPATH, "ctrlr;@mame@/ctrlr", OPTION_STRING, "path to controller definitions" },
19++ { OPTION_INIPATH, ".;ini;ini/presets;@mame@/ini/presets", OPTION_STRING, "path to ini files" },
20++ { OPTION_FONTPATH, ".;@mame@", OPTION_STRING, "path to font files" },
21+ { OPTION_CHEATPATH, "cheat", OPTION_STRING, "path to cheat files" },
22+ { OPTION_CROSSHAIRPATH, "crosshair", OPTION_STRING, "path to crosshair files" },
23+- { OPTION_PLUGINSPATH, "plugins", OPTION_STRING, "path to plugin files" },
24+- { OPTION_LANGUAGEPATH, "language", OPTION_STRING, "path to UI translation files" },
25++ { OPTION_PLUGINSPATH, "plugins;@mame@/plugins", OPTION_STRING, "path to plugin files" },
26++ { OPTION_LANGUAGEPATH, "language;@mame@/language", OPTION_STRING, "path to UI translation files" },
27+ { OPTION_SWPATH, "software", OPTION_STRING, "path to loose software" },
28+
29+ // output directory options