From b89efbd9a45aaa6563225ba2de8a93ce9663f337 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 8 Nov 2022 23:46:02 +0000 Subject: [PATCH 1/3] 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; }; From d868053b400db0fa46e2a0432fa06231a040a7cb Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Thu, 10 Nov 2022 08:33:35 +0000 Subject: [PATCH 2/3] nixos/doc: formatting improvements --- .../doc/manual/from_md/release-notes/rl-2211.section.xml | 9 +++++---- nixos/doc/manual/release-notes/rl-2211.section.md | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index c53474144d27..d9fa98904db8 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -1338,10 +1338,11 @@ - boot.kernel.sysctl is defined as a freeformType and adds a - custom merge option for net.core.rmem_max - (taking the highest value defined to avoid conflicts between 2 - services trying to set that value) + boot.kernel.sysctl is defined as a + freeformType and adds a custom merge option for + net.core.rmem_max (taking the highest value + defined to avoid conflicts between 2 services trying to set + that value). diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index 863bf95b55f3..d043de005dda 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -395,6 +395,6 @@ Available as [services.patroni](options.html#opt-services.patroni.enable). - The `nodePackages` package set now defaults to the LTS release in the `nodejs` package again, instead of being pinned to `nodejs-14_x`. Several updates to node2nix have been made for compatibility with newer Node.js and npm versions and a new `postRebuild` hook has been added for packages to perform extra build steps before the npm install step prunes dev dependencies. -- boot.kernel.sysctl is defined as a freeformType and adds a custom merge option for "net.core.rmem_max" (taking the highest value defined to avoid conflicts between 2 services trying to set that value) +- `boot.kernel.sysctl` is defined as a freeformType and adds a custom merge option for "net.core.rmem_max" (taking the highest value defined to avoid conflicts between 2 services trying to set that value). From 891511b61957757faa4c3162d173e984f9c39e34 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Thu, 10 Nov 2022 08:35:40 +0000 Subject: [PATCH 3/3] nixos/doc: document mame package changes --- .../doc/manual/from_md/release-notes/rl-2211.section.xml | 9 +++++++++ nixos/doc/manual/release-notes/rl-2211.section.md | 2 ++ 2 files changed, 11 insertions(+) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index d9fa98904db8..841aced11f2f 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -1345,6 +1345,15 @@ that value). + + + The mame package does not ship with its + tools anymore in the default output. They were moved to a + separate tools output instead. For + convenience, mame-tools package was added + for those who want to use it. + + diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index d043de005dda..85d8080fba18 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -397,4 +397,6 @@ Available as [services.patroni](options.html#opt-services.patroni.enable). - `boot.kernel.sysctl` is defined as a freeformType and adds a custom merge option for "net.core.rmem_max" (taking the highest value defined to avoid conflicts between 2 services trying to set that value). +- The `mame` package does not ship with its tools anymore in the default output. They were moved to a separate `tools` output instead. For convenience, `mame-tools` package was added for those who want to use it. +