From 7264a780f07b951b3e048905f21dc58eaea7f3d8 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Mon, 31 Jan 2022 21:37:28 -0300 Subject: [PATCH 1/2] dosbox: use desktopItems machinery --- pkgs/misc/emulators/dosbox/default.nix | 68 ++++++++++++++++++-------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/pkgs/misc/emulators/dosbox/default.nix b/pkgs/misc/emulators/dosbox/default.nix index ba4f88dbcad0..383e943ff246 100644 --- a/pkgs/misc/emulators/dosbox/default.nix +++ b/pkgs/misc/emulators/dosbox/default.nix @@ -1,4 +1,16 @@ -{ stdenv, lib, fetchurl, makeDesktopItem, SDL, SDL_net, SDL_sound, libGLU, libGL, libpng, graphicsmagick }: +{ lib +, stdenv +, fetchurl +, SDL +, SDL_net +, SDL_sound +, copyDesktopItems +, graphicsmagick +, libGL +, libGLU +, libpng +, makeDesktopItem +}: stdenv.mkDerivation rec { pname = "dosbox"; @@ -6,31 +18,40 @@ stdenv.mkDerivation rec { src = fetchurl { url = "mirror://sourceforge/dosbox/dosbox-${version}.tar.gz"; - sha256 = "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"; + hash = "sha256-wNE91+0u02O2jeYVR1eB6JHNWC6BYrXDZpE3UCIiJgo="; }; + nativeBuildInputs = [ + copyDesktopItems + graphicsmagick + ]; + + buildInputs = [ + SDL + SDL_net + SDL_sound + libGL + libGLU + libpng + ]; + hardeningDisable = [ "format" ]; - buildInputs = [ SDL SDL_net SDL_sound libGLU libGL libpng ]; - - nativeBuildInputs = [ graphicsmagick ]; - configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest"; - desktopItem = makeDesktopItem { - name = "dosbox"; - exec = "dosbox"; - icon = "dosbox"; - comment = "x86 emulator with internal DOS"; - desktopName = "DOSBox"; - genericName = "DOS emulator"; - categories = "Emulator;"; - }; + desktopItems = [ + (makeDesktopItem { + name = "dosbox"; + exec = "dosbox"; + icon = "dosbox"; + comment = "x86 dos emulator"; + desktopName = "DOSBox"; + genericName = "DOS emulator"; + categories = "Emulator;Game;"; + }) + ]; postInstall = '' - mkdir -p $out/share/applications - cp ${desktopItem}/share/applications/* $out/share/applications - mkdir -p $out/share/icons/hicolor/256x256/apps gm convert src/dosbox.ico $out/share/icons/hicolor/256x256/apps/dosbox.png ''; @@ -40,8 +61,15 @@ stdenv.mkDerivation rec { meta = with lib; { homepage = "http://www.dosbox.com/"; description = "A DOS emulator"; - platforms = platforms.unix; + longDescription = '' + DOSBox is an emulator that recreates a MS-DOS compatible environment + (complete with Sound, Input, Graphics and even basic networking). This + environment is complete enough to run many classic MS-DOS games completely + unmodified. In order to utilize all of DOSBox's features you need to first + understand some basic concepts about the MS-DOS environment. + ''; + license = licenses.gpl2Plus; maintainers = with maintainers; [ matthewbauer ]; - license = licenses.gpl2; + platforms = platforms.unix; }; } From b0c97c01211f63dd632ccae87ac0171b7e7d9cd4 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Mon, 31 Jan 2022 22:34:45 -0300 Subject: [PATCH 2/2] munt: 2.5.0 -> 2.5.3 --- pkgs/applications/audio/munt/default.nix | 40 +++++++++++++----------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/pkgs/applications/audio/munt/default.nix b/pkgs/applications/audio/munt/default.nix index 93a9ce258544..6a308ba74c43 100644 --- a/pkgs/applications/audio/munt/default.nix +++ b/pkgs/applications/audio/munt/default.nix @@ -1,50 +1,52 @@ { lib -, mkDerivation , stdenv +, mkDerivation , fetchFromGitHub -, makeDesktopItem +, alsa-lib , cmake +, glib , pkg-config , qtbase -, glib -, alsa-lib , withJack ? stdenv.hostPlatform.isUnix, jack }: -let - mainProgram = "mt32emu-qt"; -in mkDerivation rec { pname = "munt"; - version = "2.5.0"; + version = "2.5.3"; src = fetchFromGitHub { owner = pname; repo = pname; - rev = "munt_${lib.replaceChars [ "." ] [ "_" ] version}"; - sha256 = "1lknq2a72gv1ddhzr7f967wpa12lh805jj4gjacdnamgrc1h22yn"; + rev = "libmt32emu_${lib.replaceChars [ "." ] [ "_" ] version}"; + hash = "sha256-n5VV5Swh1tOVQGT3urEKl64A/w7cY95/0y5wC5ZuLm4="; }; dontFixCmake = true; - nativeBuildInputs = [ cmake pkg-config ]; + nativeBuildInputs = [ + cmake + pkg-config + ]; - buildInputs = [ qtbase glib ] - ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib - ++ lib.optional withJack jack; + buildInputs = [ + glib + qtbase + ] + ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib + ++ lib.optional withJack jack; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir $out/Applications - mv $out/bin/${mainProgram}.app $out/Applications/ - ln -s $out/{Applications/${mainProgram}.app/Contents/MacOS,bin}/${mainProgram} + mv $out/bin/${meta.mainProgram}.app $out/Applications/ + ln -s $out/{Applications/${meta.mainProgram}.app/Contents/MacOS,bin}/${meta.mainProgram} ''; meta = with lib; { - inherit mainProgram; - description = "Multi-platform software synthesiser emulating Roland MT-32, CM-32L, CM-64 and LAPC-I devices"; homepage = "http://munt.sourceforge.net/"; + description = "An emulator of Roland MT-32, CM-32L, CM-64 and LAPC-I devices"; license = with licenses; [ lgpl21 gpl3 ]; - platforms = platforms.all; maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.all; + mainProgram = "mt32emu-qt"; }; }