From b89efbd9a45aaa6563225ba2de8a93ce9663f337 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 8 Nov 2022 23:46:02 +0000 Subject: [PATCH] mame-tools: init at 0.249 This commit adds a new `tools` output to `mame` and move all non-emulator binaries to it. This is because some of those binaries (e.g.: chdman) are useful outside of the MAME, and the MAME binary is really big. So if you only want to use some of the MAME tools, this will reduce the download size needed for it. The `tools` output is declared as `mame-tools` inside `all-packages.nix`, for easier discovery. This is similar to how other distros packages MAME, e.g.: on Arch Linux we have `mame` and `mame-tools`. --- pkgs/applications/emulators/mame/default.nix | 24 ++++++++++++++++---- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/emulators/mame/default.nix b/pkgs/applications/emulators/mame/default.nix index aaa4077015ee..cd5d718c8a4e 100644 --- a/pkgs/applications/emulators/mame/default.nix +++ b/pkgs/applications/emulators/mame/default.nix @@ -53,6 +53,8 @@ stdenv.mkDerivation rec { sha256 = "sha256-im6y/E0pQxruX2kNXZLE3fHq+zXfsstnOoC1QvH4fd4="; }; + outputs = [ "out" "tools" ]; + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "CXX=${stdenv.cc.targetPrefix}c++" @@ -138,21 +140,33 @@ stdenv.mkDerivation rec { runHook preInstall make -f dist.mak PTR64=${lib.optionalString stdenv.is64bit "1"} + + # mame 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 {} \; - install -Dm755 src/osd/sdl/taputil.sh $out/bin/taputil.sh - - installManPage ${dest}/docs/man/*.1 ${dest}/docs/man/*.6 + find ${dest} -maxdepth 1 -executable -type f -delete; + install -Dm755 mame -t $out/bin install -Dm644 ${icon} $out/share/icons/hicolor/scalable/apps/mame.svg + installManPage ${dest}/docs/man/*.1 ${dest}/docs/man/*.6 mv artwork plugins samples ${dest} + # mame-tools + for _i in castool chdman floptool imgtool jedutil ldresample ldverify nltool nlwav pngcmp regrep romcmp \ + split srcclean testkeys unidasm; do + install -Dm755 $_i -t $tools/bin + done + mv $tools/bin/{,mame-}split + runHook postInstall ''; + postFixup = '' + mkdir -p $tools/share/man + mv {$out,$tools}/share/man/man1 + ''; + enableParallelBuilding = true; passthru.updateScript = writeScript "mame-update-script" '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b70b510d21f5..f7745800c661 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1597,6 +1597,8 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) CoreAudioKit ForceFeedback; }; + mame-tools = (lib.getOutput "tools" mame); + mednafen = callPackage ../applications/emulators/mednafen { inherit (darwin) libiconv; };