Merge pull request #204370 from atorres1985-contrib/mame-refactor
mame: refactor
This commit is contained in:
commit
7b7588edb1
|
@ -10,18 +10,18 @@
|
||||||
- { OPTION_CTRLRPATH, "ctrlr", core_options::option_type::STRING, "path to controller definitions" },
|
- { OPTION_CTRLRPATH, "ctrlr", core_options::option_type::STRING, "path to controller definitions" },
|
||||||
- { OPTION_INIPATH, ".;ini;ini/presets", core_options::option_type::STRING, "path to ini files" },
|
- { OPTION_INIPATH, ".;ini;ini/presets", core_options::option_type::STRING, "path to ini files" },
|
||||||
- { OPTION_FONTPATH, ".", core_options::option_type::STRING, "path to font files" },
|
- { OPTION_FONTPATH, ".", core_options::option_type::STRING, "path to font files" },
|
||||||
+ { OPTION_HASHPATH ";hash_directory;hash", "hash;@mame@/hash", core_options::option_type::STRING, "path to software definition files" },
|
+ { OPTION_HASHPATH ";hash_directory;hash", "hash;@mamePath@/hash", core_options::option_type::STRING, "path to software definition files" },
|
||||||
+ { OPTION_SAMPLEPATH ";sp", "samples;@mame@/samples", core_options::option_type::STRING, "path to audio sample sets" },
|
+ { OPTION_SAMPLEPATH ";sp", "samples;@mamePath@/samples", core_options::option_type::STRING, "path to audio sample sets" },
|
||||||
+ { OPTION_ARTPATH, "artwork;@mame@/artwork", core_options::option_type::STRING, "path to artwork files" },
|
+ { OPTION_ARTPATH, "artwork;@mamePath@/artwork", core_options::option_type::STRING, "path to artwork files" },
|
||||||
+ { OPTION_CTRLRPATH, "ctrlr;@mame@/ctrlr", core_options::option_type::STRING, "path to controller definitions" },
|
+ { OPTION_CTRLRPATH, "ctrlr;@mamePath@/ctrlr", core_options::option_type::STRING, "path to controller definitions" },
|
||||||
+ { OPTION_INIPATH, ".;ini;ini/presets;@mame@/ini/presets", core_options::option_type::STRING, "path to ini files" },
|
+ { OPTION_INIPATH, ".;ini;ini/presets;@mamePath@/ini/presets", core_options::option_type::STRING, "path to ini files" },
|
||||||
+ { OPTION_FONTPATH, ".;@mame@", core_options::option_type::STRING, "path to font files" },
|
+ { OPTION_FONTPATH, ".;@mamePath@", core_options::option_type::STRING, "path to font files" },
|
||||||
{ OPTION_CHEATPATH, "cheat", core_options::option_type::STRING, "path to cheat files" },
|
{ OPTION_CHEATPATH, "cheat", core_options::option_type::STRING, "path to cheat files" },
|
||||||
{ OPTION_CROSSHAIRPATH, "crosshair", core_options::option_type::STRING, "path to crosshair files" },
|
{ OPTION_CROSSHAIRPATH, "crosshair", core_options::option_type::STRING, "path to crosshair files" },
|
||||||
- { OPTION_PLUGINSPATH, "plugins", core_options::option_type::STRING, "path to plugin files" },
|
- { OPTION_PLUGINSPATH, "plugins", core_options::option_type::STRING, "path to plugin files" },
|
||||||
- { OPTION_LANGUAGEPATH, "language", core_options::option_type::STRING, "path to UI translation files" },
|
- { OPTION_LANGUAGEPATH, "language", core_options::option_type::STRING, "path to UI translation files" },
|
||||||
+ { OPTION_PLUGINSPATH, "plugins;@mame@/plugins", core_options::option_type::STRING, "path to plugin files" },
|
+ { OPTION_PLUGINSPATH, "plugins;@mamePath@/plugins", core_options::option_type::STRING, "path to plugin files" },
|
||||||
+ { OPTION_LANGUAGEPATH, "language;@mame@/language", core_options::option_type::STRING, "path to UI translation files" },
|
+ { OPTION_LANGUAGEPATH, "language;@mamePath@/language", core_options::option_type::STRING, "path to UI translation files" },
|
||||||
{ OPTION_SWPATH, "software", core_options::option_type::STRING, "path to loose software" },
|
{ OPTION_SWPATH, "software", core_options::option_type::STRING, "path to loose software" },
|
||||||
|
|
||||||
// output directory options
|
// output directory options
|
|
@ -1,24 +1,24 @@
|
||||||
{ lib
|
{ lib
|
||||||
, stdenv
|
, stdenv
|
||||||
, alsa-lib
|
|
||||||
, copyDesktopItems
|
|
||||||
, CoreAudioKit
|
|
||||||
, expat
|
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, fetchurl
|
, alsa-lib
|
||||||
|
, SDL2
|
||||||
|
, SDL2_ttf
|
||||||
|
, copyDesktopItems
|
||||||
|
, expat
|
||||||
, flac
|
, flac
|
||||||
, fontconfig
|
, fontconfig
|
||||||
, ForceFeedback
|
|
||||||
, glm
|
, glm
|
||||||
, installShellFiles
|
, installShellFiles
|
||||||
|
, libXi
|
||||||
|
, libXinerama
|
||||||
, libjpeg
|
, libjpeg
|
||||||
, libpcap
|
, libpcap
|
||||||
, libpulseaudio
|
, libpulseaudio
|
||||||
, libXi
|
|
||||||
, libXinerama
|
|
||||||
, lua5_3
|
, lua5_3
|
||||||
, makeDesktopItem
|
, makeDesktopItem
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
|
, papirus-icon-theme
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, portaudio
|
, portaudio
|
||||||
, portmidi
|
, portmidi
|
||||||
|
@ -26,31 +26,26 @@
|
||||||
, python3
|
, python3
|
||||||
, qtbase
|
, qtbase
|
||||||
, rapidjson
|
, rapidjson
|
||||||
, SDL2
|
|
||||||
, SDL2_ttf
|
|
||||||
, sqlite
|
, sqlite
|
||||||
, utf8proc
|
, utf8proc
|
||||||
, which
|
, which
|
||||||
, writeScript
|
, writeScript
|
||||||
, zlib
|
, zlib
|
||||||
|
, darwin
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
# Get icon from Arch Linux package
|
inherit (darwin.apple_sdk.frameworks) CoreAudioKit ForceFeedback;
|
||||||
icon = fetchurl {
|
|
||||||
url = "https://raw.githubusercontent.com/archlinux/svntogit-community/614b24ef3856cb52b5cafc386b0f77923cbc9156/trunk/mame.svg";
|
|
||||||
sha256 = "sha256-F8RCyTPXZBdeTOHeUKgMDC3dXXM8rwnDzV5rppesQ/Q=";
|
|
||||||
};
|
|
||||||
dest = "$out/opt/mame";
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "mame";
|
pname = "mame";
|
||||||
version = "0.250";
|
version = "0.250";
|
||||||
|
srcVersion = builtins.replaceStrings [ "." ] [ "" ] version;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "mamedev";
|
owner = "mamedev";
|
||||||
repo = "mame";
|
repo = "mame";
|
||||||
rev = "mame${builtins.replaceStrings [ "." ] [ "" ] version}";
|
rev = "mame${srcVersion}";
|
||||||
sha256 = "sha256-jexs/1ovRk9Is5orD7hT9fN+dYm+WA+57aZ6JH7zjL4=";
|
sha256 = "sha256-jexs/1ovRk9Is5orD7hT9fN+dYm+WA+57aZ6JH7zjL4=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -109,15 +104,17 @@ stdenv.mkDerivation rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
# by default MAME assumes that paths with stock resources
|
# by default MAME assumes that paths with stock resources are relative and
|
||||||
# are relative and that you run MAME changing to
|
# that you run MAME changing to install directory, so we add absolute paths
|
||||||
# install directory, so we add absolute paths here
|
# here
|
||||||
./emuopts.patch
|
./001-use-absolute-paths.diff
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Since the bug described in https://github.com/NixOS/nixpkgs/issues/135438,
|
||||||
|
# it is not possible to use substituteAll
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace src/emu/emuopts.cpp \
|
substituteInPlace src/emu/emuopts.cpp \
|
||||||
--subst-var-by mame ${dest}
|
--subst-var-by mamePath "$out/opt/mame"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
desktopItems = [
|
desktopItems = [
|
||||||
|
@ -134,23 +131,26 @@ stdenv.mkDerivation rec {
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
installPhase = ''
|
# TODO: copy shaders from src/osd/modules/opengl/shader/glsl*.*h
|
||||||
|
# to the final package after we figure out how they work
|
||||||
|
installPhase = let
|
||||||
|
icon = "${papirus-icon-theme}/share/icons/Papirus/32x32/apps/mame.svg";
|
||||||
|
in ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
# mame
|
# mame
|
||||||
mkdir -p ${dest}
|
mkdir -p $out/opt/mame
|
||||||
|
|
||||||
install -Dm755 mame -t $out/bin
|
install -Dm755 mame -t $out/bin
|
||||||
install -Dm644 ${icon} $out/share/icons/hicolor/scalable/apps/mame.svg
|
install -Dm644 ${icon} $out/share/icons/hicolor/scalable/apps/mame.svg
|
||||||
installManPage docs/man/*.1 docs/man/*.6
|
installManPage docs/man/*.1 docs/man/*.6
|
||||||
cp -ar {artwork,bgfx,plugins,language,ctrlr,keymaps,hash} ${dest}
|
cp -ar {artwork,bgfx,plugins,language,ctrlr,keymaps,hash} $out/opt/mame
|
||||||
# TODO: copy shaders from src/osd/modules/opengl/shader/glsl*.*h
|
|
||||||
# to the final package after we figure out how they work
|
|
||||||
|
|
||||||
# mame-tools
|
# mame-tools
|
||||||
for _i in castool chdman floptool imgtool jedutil ldresample ldverify nltool nlwav pngcmp regrep romcmp \
|
for _tool in castool chdman floptool imgtool jedutil ldresample ldverify \
|
||||||
split srcclean testkeys unidasm; do
|
nltool nlwav pngcmp regrep romcmp split srcclean testkeys \
|
||||||
install -Dm755 $_i -t $tools/bin
|
unidasm; do
|
||||||
|
install -Dm755 $_tool -t $tools/bin
|
||||||
done
|
done
|
||||||
mv $tools/bin/{,mame-}split
|
mv $tools/bin/{,mame-}split
|
||||||
|
|
||||||
|
@ -176,11 +176,26 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
broken = stdenv.isDarwin;
|
|
||||||
description = "Is a multi-purpose emulation framework";
|
|
||||||
homepage = "https://www.mamedev.org/";
|
homepage = "https://www.mamedev.org/";
|
||||||
|
description = "A multi-purpose emulation framework";
|
||||||
|
longDescription = ''
|
||||||
|
MAME's purpose is to preserve decades of software history. As electronic
|
||||||
|
technology continues to rush forward, MAME prevents this important
|
||||||
|
"vintage" software from being lost and forgotten. This is achieved by
|
||||||
|
documenting the hardware and how it functions. The source code to MAME
|
||||||
|
serves as this documentation. The fact that the software is usable serves
|
||||||
|
primarily to validate the accuracy of the documentation (how else can you
|
||||||
|
prove that you have recreated the hardware faithfully?). Over time, MAME
|
||||||
|
(originally stood for Multiple Arcade Machine Emulator) absorbed the
|
||||||
|
sister-project MESS (Multi Emulator Super System), so MAME now documents a
|
||||||
|
wide variety of (mostly vintage) computers, video game consoles and
|
||||||
|
calculators, in addition to the arcade video games that were its initial
|
||||||
|
focus.
|
||||||
|
'';
|
||||||
|
changelog = "https://github.com/mamedev/mame/releases/download/mame${srcVersion}/whatsnew_${srcVersion}.txt";
|
||||||
license = with licenses; [ bsd3 gpl2Plus ];
|
license = with licenses; [ bsd3 gpl2Plus ];
|
||||||
platforms = platforms.unix;
|
|
||||||
maintainers = with maintainers; [ thiagokokada ];
|
maintainers = with maintainers; [ thiagokokada ];
|
||||||
|
platforms = platforms.unix;
|
||||||
|
broken = stdenv.isDarwin;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2024,11 +2024,11 @@ with pkgs;
|
||||||
|
|
||||||
maiko = callPackage ../applications/emulators/maiko { };
|
maiko = callPackage ../applications/emulators/maiko { };
|
||||||
|
|
||||||
mame = libsForQt5.callPackage ../applications/emulators/mame {
|
mame = libsForQt5.callPackage ../applications/emulators/mame { };
|
||||||
inherit (darwin.apple_sdk.frameworks) CoreAudioKit ForceFeedback;
|
|
||||||
};
|
|
||||||
|
|
||||||
mame-tools = (lib.getOutput "tools" mame);
|
mame-tools = lib.addMetaAttrs {
|
||||||
|
description = mame.meta.description + " (tools only)";
|
||||||
|
} (lib.getOutput "tools" mame);
|
||||||
|
|
||||||
mednafen = callPackage ../applications/emulators/mednafen {
|
mednafen = callPackage ../applications/emulators/mednafen {
|
||||||
inherit (darwin) libiconv;
|
inherit (darwin) libiconv;
|
||||||
|
|
Loading…
Reference in a new issue