From b6ca9759409a471577b28105b690b71db59e9258 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 26 Jun 2024 11:41:07 -0300 Subject: [PATCH] dosbox-staging: refactor - reorder lists ASCIIbetically - split outputs - add tests and updateScript --- pkgs/by-name/do/dosbox-staging/package.nix | 46 ++++++++++++++-------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/do/dosbox-staging/package.nix b/pkgs/by-name/do/dosbox-staging/package.nix index 5be06575236e..f4cab21b1b30 100644 --- a/pkgs/by-name/do/dosbox-staging/package.nix +++ b/pkgs/by-name/do/dosbox-staging/package.nix @@ -1,14 +1,14 @@ { lib, - stdenv, - fetchFromGitHub, - fetchpatch, SDL2, SDL2_image, SDL2_net, alsa-lib, darwin, + fetchFromGitHub, + fetchpatch, fluidsynth, + gitUpdater, glib, gtest, iir1, @@ -18,7 +18,6 @@ libmt32emu, libogg, libpng, - zlib-ng, libpulseaudio, libslirp, libsndfile, @@ -28,7 +27,9 @@ opusfile, pkg-config, speexdsp, - nix-update-script, + stdenv, + testers, + zlib-ng, }: stdenv.mkDerivation (finalAttrs: { @@ -60,6 +61,9 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ + SDL2 + SDL2_image + SDL2_net fluidsynth glib iir1 @@ -69,15 +73,12 @@ stdenv.mkDerivation (finalAttrs: { libmt32emu libogg libpng - zlib-ng libpulseaudio libslirp libsndfile opusfile - SDL2 - SDL2_image - SDL2_net speexdsp + zlib-ng ] ++ lib.optionals stdenv.isLinux [ alsa-lib ] ++ lib.optionals stdenv.isDarwin ( @@ -89,29 +90,40 @@ stdenv.mkDerivation (finalAttrs: { ] ); + outputs = [ "out" "man" ]; + postInstall = '' install -Dm644 $src/contrib/linux/dosbox-staging.desktop $out/share/applications/ ''; + # Rename binary, add a wrapper, and copy manual to avoid conflict with + # original dosbox. Doing it this way allows us to work with frontends and + # launchers that expect the binary to be named dosbox, but get out of the way + # of vanilla dosbox if the user desires to install that as well. postFixup = '' - # Rename binary, add a wrapper, and copy manual to avoid conflict with - # original dosbox. Doing it this way allows us to work with frontends and - # launchers that expect the binary to be named dosbox, but get out of the - # way of vanilla dosbox if the user desires to install that as well. mv $out/bin/dosbox $out/bin/dosbox-staging makeWrapper $out/bin/dosbox-staging $out/bin/dosbox - # Create a symlink to dosbox manual instead of copying it - pushd $out/share/man/man1/ + pushd $man/share/man/man1/ ln -s dosbox.1.gz dosbox-staging.1.gz popd ''; - passthru.updateScript = nix-update-script { }; + passthru = { + tests = { + version = testers.testVersion { + package = finalAttrs.finalPackage; + command = "dosbox --version"; + }; + }; + updateScript = gitUpdater { + rev-prefix = "v"; + }; + }; meta = { homepage = "https://dosbox-staging.github.io/"; - description = "Modernized DOS emulator"; + description = "Modernized DOS emulator; DOSBox fork"; longDescription = '' DOSBox Staging is an attempt to revitalize DOSBox's development process. It's not a rewrite, but a continuation and improvement on the