diff options
Diffstat (limited to 'pkgs/misc/emulators/mame/default.nix')
-rw-r--r-- | pkgs/misc/emulators/mame/default.nix | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/pkgs/misc/emulators/mame/default.nix b/pkgs/misc/emulators/mame/default.nix index 499d7dd6c4a2c..d98232b10588b 100644 --- a/pkgs/misc/emulators/mame/default.nix +++ b/pkgs/misc/emulators/mame/default.nix @@ -1,9 +1,9 @@ -{ stdenv, mkDerivation, fetchFromGitHub, makeDesktopItem +{ stdenv, mkDerivation, fetchFromGitHub, makeDesktopItem, makeWrapper , python, pkgconfig, SDL2, SDL2_ttf, alsaLib, which, qtbase, libXinerama }: let majorVersion = "0"; - minorVersion = "215"; + minorVersion = "216"; desktopItem = makeDesktopItem { name = "MAME"; @@ -12,6 +12,8 @@ let genericName = "MAME is a multi-purpose emulation framework"; categories = "System;Emulator;"; }; + + dest = "$out/opt/mame"; in mkDerivation { pname = "mame"; version = "${majorVersion}.${minorVersion}"; @@ -20,7 +22,7 @@ in mkDerivation { owner = "mamedev"; repo = "mame"; rev = "mame${majorVersion}${minorVersion}"; - sha256 = "1phz846p3zzgzrbfiq2vn79iqar2dbf7iv6wfkrp32sdkkvp7l3h"; + sha256 = "0dmmw08pxxznvadrc51zg27jc9fjh688355w8kxkmi7k8qa367r0"; }; hardeningDisable = [ "fortify" ]; @@ -28,22 +30,35 @@ in mkDerivation { makeFlags = [ "TOOLS=1" ]; + dontWrapQtApps = true; + buildInputs = [ SDL2 SDL2_ttf alsaLib qtbase libXinerama ]; - nativeBuildInputs = [ python pkgconfig which ]; + nativeBuildInputs = [ python pkgconfig which makeWrapper ]; - installPhase = '' - dest=$out/opt/mame + # by default MAME assumes that paths with stock resources + # are relative and that you run MAME changing to + # install directory, so we add absolute paths here + patches = [ ./emuopts.patch ]; - 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 + postPatch = '' + substituteInPlace src/emu/emuopts.cpp \ + --subst-var-by mame ${dest} + ''; + + installPhase = '' + make -f dist.mak PTR64=${stdenv.lib.optionalString stdenv.is64bit "1"} + mkdir -p ${dest} + mv build/release/*/Release/mame/* ${dest} mkdir -p $out/bin - find $dest -maxdepth 1 -executable -type f -exec mv -t $out/bin {} \; + find ${dest} -maxdepth 1 -executable -type f -exec mv -t $out/bin {} \; + install -Dm755 src/osd/sdl/taputil.sh $out/bin/taputil.sh 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 + mv ${dest}/docs/man/*.1 $out/share/man/man1 + mv ${dest}/docs/man/*.6 $out/share/man/man6 + + mv artwork plugins samples ${dest} mkdir -p $out/share ln -s ${desktopItem}/share/applications $out/share |