about summary refs log tree commit diff
path: root/nixpkgs/pkgs/misc/emulators
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-10-19 14:40:23 +0000
committerAlyssa Ross <hi@alyssa.is>2022-01-07 10:22:32 +0000
commitcc62bcb55359ba8c5e0fe3a48e778444c89060d8 (patch)
treeca0e21d44eaf8837b687395e614445f7761d7bbd /nixpkgs/pkgs/misc/emulators
parentd6625e8d25efd829c3cfa227d025ca4e606ae4b7 (diff)
parenta323570a264da96a0b0bcc1c9aa017794acdc752 (diff)
downloadnixlib-cc62bcb55359ba8c5e0fe3a48e778444c89060d8.tar
nixlib-cc62bcb55359ba8c5e0fe3a48e778444c89060d8.tar.gz
nixlib-cc62bcb55359ba8c5e0fe3a48e778444c89060d8.tar.bz2
nixlib-cc62bcb55359ba8c5e0fe3a48e778444c89060d8.tar.lz
nixlib-cc62bcb55359ba8c5e0fe3a48e778444c89060d8.tar.xz
nixlib-cc62bcb55359ba8c5e0fe3a48e778444c89060d8.tar.zst
nixlib-cc62bcb55359ba8c5e0fe3a48e778444c89060d8.zip
Merge commit 'a323570a264da96a0b0bcc1c9aa017794acdc752'
Diffstat (limited to 'nixpkgs/pkgs/misc/emulators')
-rw-r--r--nixpkgs/pkgs/misc/emulators/desmume/01_use_system_tinyxml.patch231
-rw-r--r--nixpkgs/pkgs/misc/emulators/desmume/default.nix102
-rw-r--r--nixpkgs/pkgs/misc/emulators/desmume/gcc6_fixes.patch59
-rw-r--r--nixpkgs/pkgs/misc/emulators/desmume/gcc7_fixes.patch18
-rw-r--r--nixpkgs/pkgs/misc/emulators/dolphin-emu/master.nix7
-rw-r--r--nixpkgs/pkgs/misc/emulators/duckstation/default.nix79
-rw-r--r--nixpkgs/pkgs/misc/emulators/emu2/default.nix19
-rw-r--r--nixpkgs/pkgs/misc/emulators/higan/0001-change-flags.diff25
-rw-r--r--nixpkgs/pkgs/misc/emulators/higan/001-include-cmath.patch8
-rw-r--r--nixpkgs/pkgs/misc/emulators/higan/002-sips-to-png2icns.patch24
-rw-r--r--nixpkgs/pkgs/misc/emulators/higan/default.nix213
-rw-r--r--nixpkgs/pkgs/misc/emulators/melonDS/default.nix3
-rw-r--r--nixpkgs/pkgs/misc/emulators/ryujinx/default.nix92
-rw-r--r--nixpkgs/pkgs/misc/emulators/uxn/default.nix2
-rw-r--r--nixpkgs/pkgs/misc/emulators/wine/base.nix4
-rw-r--r--nixpkgs/pkgs/misc/emulators/wine/default.nix3
-rw-r--r--nixpkgs/pkgs/misc/emulators/wine/sources.nix10
-rw-r--r--nixpkgs/pkgs/misc/emulators/zesarux/default.nix89
18 files changed, 420 insertions, 568 deletions
diff --git a/nixpkgs/pkgs/misc/emulators/desmume/01_use_system_tinyxml.patch b/nixpkgs/pkgs/misc/emulators/desmume/01_use_system_tinyxml.patch
deleted file mode 100644
index 8cec26026e7f..000000000000
--- a/nixpkgs/pkgs/misc/emulators/desmume/01_use_system_tinyxml.patch
+++ /dev/null
@@ -1,231 +0,0 @@
-From: Evgeni Golov <evgeni@debian.org>
-Subject: use the system tinyxml instead of the embedded copy
-Last-Update: 2015-08-09
-
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 7b9e263..bc7ba8c 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -81,12 +81,6 @@ libdesmume_a_SOURCES = \
- 	utils/libfat/mem_allocate.h \
- 	utils/libfat/partition.cpp \
- 	utils/libfat/partition.h \
--	utils/tinyxml/tinystr.cpp \
--	utils/tinyxml/tinystr.h \
--	utils/tinyxml/tinyxml.cpp \
--	utils/tinyxml/tinyxml.h \
--	utils/tinyxml/tinyxmlerror.cpp \
--	utils/tinyxml/tinyxmlparser.cpp \
- 	utils/glcorearb.h \
- 	addons/slot2_auto.cpp addons/slot2_mpcf.cpp addons/slot2_paddle.cpp addons/slot2_gbagame.cpp addons/slot2_none.cpp addons/slot2_rumblepak.cpp addons/slot2_guitarGrip.cpp addons/slot2_expMemory.cpp addons/slot2_piano.cpp addons/slot2_passme.cpp addons/slot1_none.cpp addons/slot1_r4.cpp addons/slot1_retail_nand.cpp addons/slot1_retail_auto.cpp addons/slot1_retail_mcrom.cpp addons/slot1_retail_mcrom_debug.cpp addons/slot1comp_mc.cpp addons/slot1comp_mc.h addons/slot1comp_rom.h addons/slot1comp_rom.cpp addons/slot1comp_protocol.h addons/slot1comp_protocol.cpp \
- 	cheatSystem.cpp cheatSystem.h \
-@@ -204,3 +198,4 @@ if HAVE_GDB_STUB
- libdesmume_a_SOURCES += gdbstub.h
- endif
- libdesmume_a_LIBADD = fs-$(desmume_arch).$(OBJEXT)
-+LIBS += -ltinyxml
-diff --git a/src/Makefile.in b/src/Makefile.in
-index 9cf26a3..d9ff7b2 100644
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -184,9 +184,6 @@ am__libdesmume_a_SOURCES_DIST = armcpu.cpp armcpu.h \
- 	utils/libfat/libfat_public_api.h utils/libfat/lock.cpp \
- 	utils/libfat/lock.h utils/libfat/mem_allocate.h \
- 	utils/libfat/partition.cpp utils/libfat/partition.h \
--	utils/tinyxml/tinystr.cpp utils/tinyxml/tinystr.h \
--	utils/tinyxml/tinyxml.cpp utils/tinyxml/tinyxml.h \
--	utils/tinyxml/tinyxmlerror.cpp utils/tinyxml/tinyxmlparser.cpp \
- 	utils/glcorearb.h addons/slot2_auto.cpp addons/slot2_mpcf.cpp \
- 	addons/slot2_paddle.cpp addons/slot2_gbagame.cpp \
- 	addons/slot2_none.cpp addons/slot2_rumblepak.cpp \
-@@ -324,10 +321,6 @@ am_libdesmume_a_OBJECTS = armcpu.$(OBJEXT) arm_instructions.$(OBJEXT) \
- 	utils/libfat/libfat.$(OBJEXT) \
- 	utils/libfat/libfat_public_api.$(OBJEXT) \
- 	utils/libfat/lock.$(OBJEXT) utils/libfat/partition.$(OBJEXT) \
--	utils/tinyxml/tinystr.$(OBJEXT) \
--	utils/tinyxml/tinyxml.$(OBJEXT) \
--	utils/tinyxml/tinyxmlerror.$(OBJEXT) \
--	utils/tinyxml/tinyxmlparser.$(OBJEXT) \
- 	addons/slot2_auto.$(OBJEXT) addons/slot2_mpcf.$(OBJEXT) \
- 	addons/slot2_paddle.$(OBJEXT) addons/slot2_gbagame.$(OBJEXT) \
- 	addons/slot2_none.$(OBJEXT) addons/slot2_rumblepak.$(OBJEXT) \
-@@ -475,7 +468,7 @@ LIBAGG_LIBS = @LIBAGG_LIBS@
- LIBGLADE_CFLAGS = @LIBGLADE_CFLAGS@
- LIBGLADE_LIBS = @LIBGLADE_LIBS@
- LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ -ltinyxml
- LIBSOUNDTOUCH_CFLAGS = @LIBSOUNDTOUCH_CFLAGS@
- LIBSOUNDTOUCH_LIBS = @LIBSOUNDTOUCH_LIBS@
- LTLIBOBJS = @LTLIBOBJS@
-@@ -625,9 +618,6 @@ libdesmume_a_SOURCES = armcpu.cpp armcpu.h arm_instructions.cpp \
- 	utils/libfat/libfat_public_api.h utils/libfat/lock.cpp \
- 	utils/libfat/lock.h utils/libfat/mem_allocate.h \
- 	utils/libfat/partition.cpp utils/libfat/partition.h \
--	utils/tinyxml/tinystr.cpp utils/tinyxml/tinystr.h \
--	utils/tinyxml/tinyxml.cpp utils/tinyxml/tinyxml.h \
--	utils/tinyxml/tinyxmlerror.cpp utils/tinyxml/tinyxmlparser.cpp \
- 	utils/glcorearb.h addons/slot2_auto.cpp addons/slot2_mpcf.cpp \
- 	addons/slot2_paddle.cpp addons/slot2_gbagame.cpp \
- 	addons/slot2_none.cpp addons/slot2_rumblepak.cpp \
-@@ -760,20 +750,6 @@ utils/libfat/lock.$(OBJEXT): utils/libfat/$(am__dirstamp) \
- 	utils/libfat/$(DEPDIR)/$(am__dirstamp)
- utils/libfat/partition.$(OBJEXT): utils/libfat/$(am__dirstamp) \
- 	utils/libfat/$(DEPDIR)/$(am__dirstamp)
--utils/tinyxml/$(am__dirstamp):
--	@$(MKDIR_P) utils/tinyxml
--	@: > utils/tinyxml/$(am__dirstamp)
--utils/tinyxml/$(DEPDIR)/$(am__dirstamp):
--	@$(MKDIR_P) utils/tinyxml/$(DEPDIR)
--	@: > utils/tinyxml/$(DEPDIR)/$(am__dirstamp)
--utils/tinyxml/tinystr.$(OBJEXT): utils/tinyxml/$(am__dirstamp) \
--	utils/tinyxml/$(DEPDIR)/$(am__dirstamp)
--utils/tinyxml/tinyxml.$(OBJEXT): utils/tinyxml/$(am__dirstamp) \
--	utils/tinyxml/$(DEPDIR)/$(am__dirstamp)
--utils/tinyxml/tinyxmlerror.$(OBJEXT): utils/tinyxml/$(am__dirstamp) \
--	utils/tinyxml/$(DEPDIR)/$(am__dirstamp)
--utils/tinyxml/tinyxmlparser.$(OBJEXT): utils/tinyxml/$(am__dirstamp) \
--	utils/tinyxml/$(DEPDIR)/$(am__dirstamp)
- addons/$(am__dirstamp):
- 	@$(MKDIR_P) addons
- 	@: > addons/$(am__dirstamp)
-@@ -1035,10 +1011,6 @@ mostlyclean-compile:
- 	-rm -f utils/libfat/partition.$(OBJEXT)
- 	-rm -f utils/md5.$(OBJEXT)
- 	-rm -f utils/task.$(OBJEXT)
--	-rm -f utils/tinyxml/tinystr.$(OBJEXT)
--	-rm -f utils/tinyxml/tinyxml.$(OBJEXT)
--	-rm -f utils/tinyxml/tinyxmlerror.$(OBJEXT)
--	-rm -f utils/tinyxml/tinyxmlparser.$(OBJEXT)
- 	-rm -f utils/vfat.$(OBJEXT)
- 	-rm -f utils/xstring.$(OBJEXT)
- 
-@@ -1175,10 +1147,6 @@ distclean-compile:
- @AMDEP_TRUE@@am__include@ @am__quote@utils/libfat/$(DEPDIR)/libfat_public_api.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@utils/libfat/$(DEPDIR)/lock.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@utils/libfat/$(DEPDIR)/partition.Po@am__quote@
--@AMDEP_TRUE@@am__include@ @am__quote@utils/tinyxml/$(DEPDIR)/tinystr.Po@am__quote@
--@AMDEP_TRUE@@am__include@ @am__quote@utils/tinyxml/$(DEPDIR)/tinyxml.Po@am__quote@
--@AMDEP_TRUE@@am__include@ @am__quote@utils/tinyxml/$(DEPDIR)/tinyxmlerror.Po@am__quote@
--@AMDEP_TRUE@@am__include@ @am__quote@utils/tinyxml/$(DEPDIR)/tinyxmlparser.Po@am__quote@
- 
- .c.o:
- @am__fastdepCC_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@@ -1449,8 +1417,6 @@ distclean-generic:
- 	-rm -f utils/decrypt/$(am__dirstamp)
- 	-rm -f utils/libfat/$(DEPDIR)/$(am__dirstamp)
- 	-rm -f utils/libfat/$(am__dirstamp)
--	-rm -f utils/tinyxml/$(DEPDIR)/$(am__dirstamp)
--	-rm -f utils/tinyxml/$(am__dirstamp)
- 
- maintainer-clean-generic:
- 	@echo "This command is intended for maintainers to use"
-@@ -1460,7 +1426,7 @@ clean: clean-recursive
- clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
- 
- distclean: distclean-recursive
--	-rm -rf ./$(DEPDIR) addons/$(DEPDIR) filter/$(DEPDIR) metaspu/$(DEPDIR) utils/$(DEPDIR) utils/AsmJit/core/$(DEPDIR) utils/AsmJit/x86/$(DEPDIR) utils/decrypt/$(DEPDIR) utils/libfat/$(DEPDIR) utils/tinyxml/$(DEPDIR)
-+	-rm -rf ./$(DEPDIR) addons/$(DEPDIR) filter/$(DEPDIR) metaspu/$(DEPDIR) utils/$(DEPDIR) utils/AsmJit/core/$(DEPDIR) utils/AsmJit/x86/$(DEPDIR) utils/decrypt/$(DEPDIR) utils/libfat/$(DEPDIR)
- 	-rm -f Makefile
- distclean-am: clean-am distclean-compile distclean-generic \
- 	distclean-tags
-@@ -1506,7 +1472,7 @@ install-ps-am:
- installcheck-am:
- 
- maintainer-clean: maintainer-clean-recursive
--	-rm -rf ./$(DEPDIR) addons/$(DEPDIR) filter/$(DEPDIR) metaspu/$(DEPDIR) utils/$(DEPDIR) utils/AsmJit/core/$(DEPDIR) utils/AsmJit/x86/$(DEPDIR) utils/decrypt/$(DEPDIR) utils/libfat/$(DEPDIR) utils/tinyxml/$(DEPDIR)
-+	-rm -rf ./$(DEPDIR) addons/$(DEPDIR) filter/$(DEPDIR) metaspu/$(DEPDIR) utils/$(DEPDIR) utils/AsmJit/core/$(DEPDIR) utils/AsmJit/x86/$(DEPDIR) utils/decrypt/$(DEPDIR) utils/libfat/$(DEPDIR)
- 	-rm -f Makefile
- maintainer-clean-am: distclean-am maintainer-clean-generic
- 
-diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am
-index 1985209..d958323 100755
---- a/src/cli/Makefile.am
-+++ b/src/cli/Makefile.am
-@@ -5,7 +5,7 @@ AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) $(GT
- 
- bin_PROGRAMS = desmume-cli
- desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp ../driver.h ../driver.cpp
--desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) $(LIBSOUNDTOUCH_LIBS)
-+desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) $(LIBSOUNDTOUCH_LIBS) -ltinyxml
- if HAVE_GDB_STUB
- desmume_cli_LDADD += ../gdbstub/libgdbstub.a
- endif
-diff --git a/src/cli/Makefile.in b/src/cli/Makefile.in
-index 14efd77..f04ab7d 100644
---- a/src/cli/Makefile.in
-+++ b/src/cli/Makefile.in
-@@ -311,7 +311,7 @@ AM_LDFLAGS =
- desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp ../driver.h ../driver.cpp
- desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) \
- 	$(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) \
--	$(LIBSOUNDTOUCH_LIBS) $(am__append_1)
-+	$(LIBSOUNDTOUCH_LIBS) -ltinyxml $(am__append_1)
- all: all-recursive
- 
- .SUFFIXES:
-diff --git a/src/gtk-glade/Makefile.am b/src/gtk-glade/Makefile.am
-index b667fca..c79fdac 100755
---- a/src/gtk-glade/Makefile.am
-+++ b/src/gtk-glade/Makefile.am
-@@ -33,7 +33,7 @@ desmume_glade_SOURCES =  \
- desmume_glade_LDADD = ../libdesmume.a \
- 			$(SDL_LIBS) $(GTKGLEXT_LIBS) $(LIBGLADE_LIBS) \
- 			$(GTHREAD_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) \
--			$(LIBSOUNDTOUCH_LIBS)
-+			$(LIBSOUNDTOUCH_LIBS) -ltinyxml
- if HAVE_GDB_STUB
- desmume_glade_LDADD += ../gdbstub/libgdbstub.a
- endif
-diff --git a/src/gtk-glade/Makefile.in b/src/gtk-glade/Makefile.in
-index 5f77ec5..012aa72 100644
---- a/src/gtk-glade/Makefile.in
-+++ b/src/gtk-glade/Makefile.in
-@@ -367,7 +367,7 @@ desmume_glade_SOURCES = \
- 
- desmume_glade_LDADD = ../libdesmume.a $(SDL_LIBS) $(GTKGLEXT_LIBS) \
- 	$(LIBGLADE_LIBS) $(GTHREAD_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) \
--	$(LIBSOUNDTOUCH_LIBS) $(am__append_1)
-+	$(LIBSOUNDTOUCH_LIBS) -ltinyxml $(am__append_1)
- all: all-recursive
- 
- .SUFFIXES:
-diff --git a/src/gtk/Makefile.am b/src/gtk/Makefile.am
-index 59cb1f2..e451102 100755
---- a/src/gtk/Makefile.am
-+++ b/src/gtk/Makefile.am
-@@ -32,7 +32,7 @@ desmume_SOURCES = \
- 	../filter/videofilter.cpp ../filter/videofilter.h \
- 	main.cpp main.h
- desmume_LDADD = ../libdesmume.a \
--	$(SDL_LIBS) $(GTK_LIBS) $(GTHREAD_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(LIBSOUNDTOUCH_LIBS)
-+	$(SDL_LIBS) $(GTK_LIBS) $(GTHREAD_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(LIBSOUNDTOUCH_LIBS) -ltinyxml
- if HAVE_GDB_STUB
- desmume_LDADD += ../gdbstub/libgdbstub.a
- endif
-diff --git a/src/gtk/Makefile.in b/src/gtk/Makefile.in
-index e1a2c37..75f392f 100644
---- a/src/gtk/Makefile.in
-+++ b/src/gtk/Makefile.in
-@@ -382,7 +382,7 @@ desmume_SOURCES = \
- 
- desmume_LDADD = ../libdesmume.a $(SDL_LIBS) $(GTK_LIBS) \
- 	$(GTHREAD_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) \
--	$(LIBSOUNDTOUCH_LIBS) $(am__append_1) $(am__append_2) \
-+	$(LIBSOUNDTOUCH_LIBS) -ltinyxml $(am__append_1) $(am__append_2) \
- 	$(am__append_3)
- UPDATE_DESKTOP = \
-   appsdir=$(DESTDIR)$(datadir)/applications ; \
-diff --git a/src/utils/advanscene.cpp b/src/utils/advanscene.cpp
-index 8d8f370..09c35bb 100755
---- a/src/utils/advanscene.cpp
-+++ b/src/utils/advanscene.cpp
-@@ -19,7 +19,7 @@
- #include <time.h>

- 

- #define TIXML_USE_STL

--#include "tinyxml/tinyxml.h"

-+#include <tinyxml.h>

- 

- #include "advanscene.h"

- #include "../common.h"

diff --git a/nixpkgs/pkgs/misc/emulators/desmume/default.nix b/nixpkgs/pkgs/misc/emulators/desmume/default.nix
index 03e97743905b..49cb2498e64f 100644
--- a/nixpkgs/pkgs/misc/emulators/desmume/default.nix
+++ b/nixpkgs/pkgs/misc/emulators/desmume/default.nix
@@ -1,57 +1,87 @@
-{ lib, stdenv, fetchurl, fetchpatch
-, pkg-config, libtool, intltool
+{ lib
+, stdenv
+, fetchFromGitHub
+, SDL2
+, agg
+, alsa-lib
+, desktop-file-utils
+, gtk3
+, intltool
+, libGLU
 , libXmu
+, libpcap
+, libtool
 , lua
+, meson
+, ninja
+, openal
+, pkg-config
+, soundtouch
 , tinyxml
-, agg, alsa-lib, soundtouch, openal
-, desktop-file-utils
-, gtk2, gtkglext, libglade
-, libGLU, libpcap, SDL, zziplib }:
+, zlib
+}:
 
-with lib;
 stdenv.mkDerivation rec {
-
   pname = "desmume";
-  version = "0.9.11";
+  version = "0.9.11+unstable=2021-09-22";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/project/desmume/desmume/${version}/${pname}-${version}.tar.gz";
-    sha256 = "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs";
+  src = fetchFromGitHub {
+    owner = "TASVideos";
+    repo = pname;
+    rev = "7fc2e4b6b6a58420de65a4089d4df3934d7a46b1";
+    hash = "sha256-sTCyjQ31w1Lp+aa3VQ7/rdLbhjnqthce54mjKJZQIDM=";
   };
 
-  patches = [
-    ./gcc6_fixes.patch
-    ./gcc7_fixes.patch
-    ./01_use_system_tinyxml.patch
+  nativeBuildInputs = [
+    desktop-file-utils
+    intltool
+    libtool
+    lua
+    meson
+    ninja
+    pkg-config
   ];
 
-  CXXFLAGS = "-fpermissive";
+  buildInputs = [
+    SDL2
+    agg
+    alsa-lib
+    gtk3
+    libGLU
+    libXmu
+    libpcap
+    openal
+    soundtouch
+    tinyxml
+    zlib
+  ];
+
+  hardeningDisable = [ "format" ];
 
-  buildInputs =
-  [ pkg-config libtool intltool libXmu lua agg alsa-lib soundtouch
-    openal desktop-file-utils gtk2 gtkglext libglade
-    libGLU libpcap SDL zziplib tinyxml ];
+  preConfigure = ''
+    cd desmume/src/frontend/posix
+  '';
 
-  configureFlags = [
-    "--disable-glade"  # Failing on compile step
-    "--enable-openal"
-    "--enable-glx"
-    "--enable-hud"
-    "--enable-wifi" ];
+  mesonFlags = [
+    "-Db_pie=true"
+    "-Dopenal=true"
+    "-Dwifi=true"
+  ];
 
-  meta = {
+  meta = with lib; {
+    homepage = "https://www.github.com/TASVideos/desmume/";
     description = "An open-source Nintendo DS emulator";
     longDescription = ''
-      DeSmuME is a freeware emulator for the NDS roms & Nintendo DS
-      Lite games created by YopYop156. It supports many homebrew nds
-      rom demoes as well as a handful of Wireless Multiboot demo nds
-      roms. DeSmuME is also able to emulate nearly all of the
+      DeSmuME is a freeware emulator for the NDS roms & Nintendo DS Lite games
+      created by YopYop156 and now maintained by the TASvideos team. It supports
+      many homebrew nds rom demoes as well as a handful of Wireless Multiboot
+      demo nds roms. DeSmuME is also able to emulate nearly all of the
       commercial nds rom titles which other DS Emulators aren't.
     '';
-    homepage = "http://www.desmume.com";
-    license = licenses.gpl1Plus;
+    license = licenses.gpl2Plus;
     maintainers = [ maintainers.AndersonTorres ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
-# TODO: investigate glade
+# TODO: investigate the patches
+# TODO: investigate other platforms
diff --git a/nixpkgs/pkgs/misc/emulators/desmume/gcc6_fixes.patch b/nixpkgs/pkgs/misc/emulators/desmume/gcc6_fixes.patch
deleted file mode 100644
index 6eb9576f649b..000000000000
--- a/nixpkgs/pkgs/misc/emulators/desmume/gcc6_fixes.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From: zeromus
-Origin: upstream, https://sourceforge.net/p/desmume/code/5514, https://sourceforge.net/p/desmume/code/5517, https://sourceforge.net/p/desmume/code/5430
-Subject: fix GCC6 issues
-Bug: https://sourceforge.net/p/desmume/bugs/1570/
-Bug-Debian: http://bugs.debian.org/811691
-
-Index: desmume/src/MMU_timing.h
-===================================================================
---- desmume/src/MMU_timing.h	(revision 5513)
-+++ desmume/src/MMU_timing.h	(revision 5517)
-@@ -155,8 +155,8 @@
- 	enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT };

- 	enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT };

- 	enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT };

--	enum { TAGMASK = (u32)(~0 << TAGSHIFT) };

--	enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };

-+	enum { TAGMASK = (u32)(~0U << TAGSHIFT) };

-+	enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << BLOCKSIZESHIFT) };

- 	enum { WORDSIZE = sizeof(u32) };

- 	enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE };

- 	enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY };

-Index: desmume/src/ctrlssdl.cpp
-===================================================================
---- desmume/src/ctrlssdl.cpp	(revision 5513)
-+++ desmume/src/ctrlssdl.cpp	(revision 5517)
-@@ -200,7 +200,7 @@
-           break;
-         case SDL_JOYAXISMOTION:
-           /* Dead zone of 50% */
--          if( (abs(event.jaxis.value) >> 14) != 0 )
-+          if( ((u32)abs(event.jaxis.value) >> 14) != 0 )
-             {
-               key = ((event.jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event.jaxis.axis & 127) << 1);
-               if (event.jaxis.value > 0) {
-@@ -370,7 +370,7 @@
-          Note: button constants have a 1bit offset. */
-     case SDL_JOYAXISMOTION:
-       key_code = ((event->jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event->jaxis.axis & 127) << 1);
--      if( (abs(event->jaxis.value) >> 14) != 0 )
-+      if( ((u32)abs(event->jaxis.value) >> 14) != 0 )
-         {
-           if (event->jaxis.value > 0)
-             key_code |= 1;
-Index: desmume/src/wifi.cpp
-===================================================================
---- desmume/src/wifi.cpp	(revision 5429)
-+++ desmume/src/wifi.cpp	(revision 5430)
-@@ -320,9 +320,9 @@
- 
- #if (WIFI_LOGGING_LEVEL >= 1)
- 	#if WIFI_LOG_USE_LOGC
--		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: "__VA_ARGS__);
-+		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: " __VA_ARGS__);
- 	#else
--		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: "__VA_ARGS__);
-+		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: " __VA_ARGS__);
- 	#endif
- #else
- #define WIFI_LOG(level, ...) {}
diff --git a/nixpkgs/pkgs/misc/emulators/desmume/gcc7_fixes.patch b/nixpkgs/pkgs/misc/emulators/desmume/gcc7_fixes.patch
deleted file mode 100644
index a4934ff6e611..000000000000
--- a/nixpkgs/pkgs/misc/emulators/desmume/gcc7_fixes.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-From e1f7039f1b06add4fb75b2f8774000b8f05574af Mon Sep 17 00:00:00 2001
-From: rogerman <rogerman@users.sf.net>
-Date: Mon, 17 Aug 2015 21:15:04 +0000
-Subject: Fix bug with libfat string handling.
-
-diff --git a/src/utils/libfat/directory.cpp b/src/utils/libfat/directory.cpp
-index 765d7ae5..b6d7f01f 100644
---- a/src/utils/libfat/directory.cpp
-+++ b/src/utils/libfat/directory.cpp
-@@ -139,7 +139,7 @@ static size_t _FAT_directory_mbstoucs2 (ucs2_t* dst, const char* src, size_t len
- 	int bytes;
- 	size_t count = 0;
- 
--	while (count < len-1 && src != '\0') {
-+	while (count < len-1 && *src != '\0') {
- 		bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps);
- 		if (bytes > 0) {
- 			*dst = (ucs2_t)tempChar;
diff --git a/nixpkgs/pkgs/misc/emulators/dolphin-emu/master.nix b/nixpkgs/pkgs/misc/emulators/dolphin-emu/master.nix
index 8e08be28eda8..06b1221dccb8 100644
--- a/nixpkgs/pkgs/misc/emulators/dolphin-emu/master.nix
+++ b/nixpkgs/pkgs/misc/emulators/dolphin-emu/master.nix
@@ -21,13 +21,14 @@ let
   };
 in stdenv.mkDerivation rec {
   pname = "dolphin-emu";
-  version = "5.0-14002";
+  version = "5.0-15260";
 
   src = fetchFromGitHub {
     owner = "dolphin-emu";
     repo = "dolphin";
-    rev = "53222560650e4a99eceafcd537d4e04d1c50b3a6";
-    sha256 = "1m71gk9hm011fpv5hmpladf7abkylmawgr60d0czkr276pzg04ky";
+    rev = "207c931a04c8e2629a735bc2b3f36b5c89365ca7";
+    sha256 = "15r9syk7f62h16klcznw7css6sng8nqkkz4d1qr8d988rdfaiypx";
+    fetchSubmodules = true;
   };
 
   nativeBuildInputs = [ cmake pkg-config ]
diff --git a/nixpkgs/pkgs/misc/emulators/duckstation/default.nix b/nixpkgs/pkgs/misc/emulators/duckstation/default.nix
index 29b867f0e9e3..e4cf7d89b3b8 100644
--- a/nixpkgs/pkgs/misc/emulators/duckstation/default.nix
+++ b/nixpkgs/pkgs/misc/emulators/duckstation/default.nix
@@ -1,33 +1,88 @@
-{ lib, mkDerivation, fetchFromGitHub, cmake, pkg-config, SDL2, qtbase
-, wrapQtAppsHook, qttools, ninja, gtk3 }:
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, pkg-config
+, SDL2
+, qtbase
+, wrapQtAppsHook
+, qttools
+, ninja
+, gtk3
+, libevdev
+, curl
+, libpulseaudio
+, sndio
+, mesa
+}:
 mkDerivation rec {
   pname = "duckstation";
-  version = "unstable-2020-12-29";
+  version = "unstable-2021-10-01";
 
   src = fetchFromGitHub {
     owner = "stenzek";
     repo = pname;
-    rev = "f8dcfabc44ff8391b2d41eab2e883dc8f21a88b7";
-    sha256 = "0v6w4di4yj1hbxpqqrcw8rbfjg18g9kla8mnb3b5zgv7i4dyzykw";
+    rev = "a7096f033ecca48827fa55825fc0d0221265f1c2";
+    sha256 = "sha256-e/Y1TJBuY76q3/0MCAqu9AJzLxIoJ8FJUV5vc/AgcjA=";
   };
 
-  nativeBuildInputs = [ cmake wrapQtAppsHook qttools ];
+  nativeBuildInputs = [ cmake ninja pkg-config extra-cmake-modules wrapQtAppsHook qttools ];
 
-  buildInputs = [ SDL2 qtbase gtk3 pkg-config ];
+  buildInputs = [
+    SDL2
+    qtbase
+    gtk3
+    libevdev
+    sndio
+    mesa
+    curl
+    libpulseaudio
+  ];
+
+  cmakeFlags = [
+    "-DUSE_DRMKMS=ON"
+    "-DUSE_EGL=ON"
+  ];
+
+  postPatch = ''
+    substituteInPlace extras/linux-desktop-files/duckstation-qt.desktop \
+      --replace "duckstation-qt" "duckstation" \
+      --replace "TryExec=duckstation" "tryExec=duckstation-qt" \
+      --replace "Exec=duckstation" "Exec=duckstation-qt"
+    substituteInPlace extras/linux-desktop-files/duckstation-nogui.desktop \
+      --replace "duckstation-nogui" "duckstation" \
+      --replace "TryExec=duckstation" "tryExec=duckstation-nogui" \
+      --replace "Exec=duckstation" "Exec=duckstation-nogui"
+  '';
 
   installPhase = ''
-    mkdir -p $out/
-    mv bin $out/
+    runHook preInstall
+    mkdir -p $out/bin $out/share $out/share/pixmaps $out/share/applications
+    rm bin/common-tests
+
+    cp -r bin $out/share/duckstation
+    ln -s $out/share/duckstation/duckstation-{qt,nogui} $out/bin/
+
+    cp ../extras/icons/icon-256px.png $out/share/pixmaps/duckstation.png
+    cp ../extras/linux-desktop-files/* $out/share/applications/
+    runHook postInstall
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
+    ./bin/common-tests
+    runHook postCheck
   '';
 
   # TODO:
   # - vulkan graphics backend (OpenGL works).
   # - default sound backend (cubeb) does not work, but SDL does.
   meta = with lib; {
-    description =
-      "PlayStation 1 emulator focusing on playability, speed and long-term maintainability";
+    description = "PlayStation 1 emulator focusing on playability, speed and long-term maintainability";
     homepage = "https://github.com/stenzek/duckstation";
-    license = licenses.gpl3;
+    license = licenses.gpl3Only;
     platforms = platforms.linux;
     maintainers = [ maintainers.guibou ];
   };
diff --git a/nixpkgs/pkgs/misc/emulators/emu2/default.nix b/nixpkgs/pkgs/misc/emulators/emu2/default.nix
index eef361ecd037..7949a3f2b051 100644
--- a/nixpkgs/pkgs/misc/emulators/emu2/default.nix
+++ b/nixpkgs/pkgs/misc/emulators/emu2/default.nix
@@ -1,14 +1,17 @@
-{ lib, stdenv, fetchFromGitHub }:
+{ lib
+, stdenv
+, fetchFromGitHub
+}:
 
 stdenv.mkDerivation rec {
   pname = "emu2";
-  version = "unstable-2020-06-04";
+  version = "0.pre+unstable=2021-09-22";
 
   src = fetchFromGitHub {
-    owner  = "dmsc";
-    repo   = "emu2";
-    rev    = "f9599d347aab07d9281400ec8b214aabd187fbcd";
-    sha256 = "0d8fb3wp477kfi0p4mmr69lxsbgb4gl9pqmm68g9ixzrfch837v4";
+    owner = "dmsc";
+    repo = "emu2";
+    rev = "8d01b53f154d6bfc9561a44b9c281b46e00a4e87";
+    hash = "sha256-Jafl0Pw2k5RCF9GgpdAWcQ+HBTsiX7dOKSMCWPHQ+2E=";
   };
 
   makeFlags = [ "PREFIX=$(out)" ];
@@ -17,7 +20,7 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/dmsc/emu2/";
     description = "A simple text-mode x86 + DOS emulator";
     platforms = platforms.linux;
-    maintainers = with maintainers; [ dramaturg ];
-    license = licenses.gpl2;
+    maintainers = with maintainers; [ AndersonTorres ];
+    license = licenses.gpl2Plus;
   };
 }
diff --git a/nixpkgs/pkgs/misc/emulators/higan/0001-change-flags.diff b/nixpkgs/pkgs/misc/emulators/higan/0001-change-flags.diff
deleted file mode 100644
index 745bba5d518d..000000000000
--- a/nixpkgs/pkgs/misc/emulators/higan/0001-change-flags.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -Naur higan-110-old/higan/GNUmakefile higan-110-new/higan/GNUmakefile
---- higan-110-old/higan/GNUmakefile	2020-04-15 11:06:00.279935557 -0300
-+++ higan-110-new/higan/GNUmakefile	2020-04-15 11:08:32.982417291 -0300
-@@ -11,7 +11,7 @@
- include $(nall.path)/GNUmakefile
- 
- ifeq ($(platform),local)
--  flags += -march=native
-+  flags +=
- endif
- 
- ifeq ($(platform),windows)
-diff -Naur higan-110-old/nall/GNUmakefile higan-110-new/nall/GNUmakefile
---- higan-110-old/nall/GNUmakefile	2020-04-15 11:06:00.396935154 -0300
-+++ higan-110-new/nall/GNUmakefile	2020-04-15 11:10:37.738011488 -0300
-@@ -127,7 +127,8 @@
- 
- # linux settings
- ifeq ($(platform),linux)
--  options += -ldl
-+  flags += $(CXXFLAGS)
-+  options += $(LDFLAGS) -ldl
- endif
- 
- # bsd settings
diff --git a/nixpkgs/pkgs/misc/emulators/higan/001-include-cmath.patch b/nixpkgs/pkgs/misc/emulators/higan/001-include-cmath.patch
new file mode 100644
index 000000000000..67644e656aa7
--- /dev/null
+++ b/nixpkgs/pkgs/misc/emulators/higan/001-include-cmath.patch
@@ -0,0 +1,8 @@
+diff -Naur source-old/higan/fc/ppu/ppu.cpp source-new/higan/fc/ppu/ppu.cpp
+--- source-old/higan/fc/ppu/ppu.cpp	1969-12-31 21:00:01.000000000 -0300
++++ source-new/higan/fc/ppu/ppu.cpp	2021-09-29 22:23:19.107527772 -0300
+@@ -1,3 +1,4 @@
++#include <cmath>
+ #include <fc/fc.hpp>
+ 
+ namespace higan::Famicom {
diff --git a/nixpkgs/pkgs/misc/emulators/higan/002-sips-to-png2icns.patch b/nixpkgs/pkgs/misc/emulators/higan/002-sips-to-png2icns.patch
new file mode 100644
index 000000000000..0585c8a38c72
--- /dev/null
+++ b/nixpkgs/pkgs/misc/emulators/higan/002-sips-to-png2icns.patch
@@ -0,0 +1,24 @@
+diff -Naur source-old/higan-ui/GNUmakefile source-new/higan-ui/GNUmakefile
+--- source-old/higan-ui/GNUmakefile	1969-12-31 21:00:01.000000000 -0300
++++ source-new/higan-ui/GNUmakefile	2021-09-29 22:35:35.744721052 -0300
+@@ -61,7 +61,7 @@
+ 	mkdir -p $(output.path)/$(name).app/Contents/Resources/
+ 	mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name)
+ 	cp resource/$(name).plist $(output.path)/$(name).app/Contents/Info.plist
+-	sips -s format icns resource/$(name).png --out $(output.path)/$(name).app/Contents/Resources/$(name).icns
++	png2icns $(output.path)/$(name).app/Contents/Resources/$(name).icns resource/$(name).png
+ endif
+ 
+ verbose: nall.verbose ruby.verbose hiro.verbose all;
+diff -Naur source-old/icarus/GNUmakefile source-new/icarus/GNUmakefile
+--- source-old/icarus/GNUmakefile	1969-12-31 21:00:01.000000000 -0300
++++ source-new/icarus/GNUmakefile	2021-09-29 22:35:53.639846113 -0300
+@@ -26,7 +26,7 @@
+ 	mkdir -p $(output.path)/$(name).app/Contents/Resources/
+ 	mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name)
+ 	cp resource/$(name).plist $(output.path)/$(name).app/Contents/Info.plist
+-	sips -s format icns resource/$(name).png --out $(output.path)/$(name).app/Contents/Resources/$(name).icns
++	png2icns $(output.path)/$(name).app/Contents/Resources/$(name).icns resource/$(name).png
+ endif
+ 
+ verbose: hiro.verbose nall.verbose all;
diff --git a/nixpkgs/pkgs/misc/emulators/higan/default.nix b/nixpkgs/pkgs/misc/emulators/higan/default.nix
index 8e10b7bb3154..558cb53c3d5d 100644
--- a/nixpkgs/pkgs/misc/emulators/higan/default.nix
+++ b/nixpkgs/pkgs/misc/emulators/higan/default.nix
@@ -1,135 +1,156 @@
-{ lib, stdenv, fetchFromGitHub
-, pkg-config
-, libX11, libXv
-, udev
-, libGLU, libGL, SDL2
-, libao, openal, libpulseaudio
+{ lib
+, stdenv
+, fetchFromGitHub
+, SDL2
 , alsa-lib
-, gtk2, gtksourceview
+, gtk3
+, gtksourceview3
+, libGL
+, libGLU
+, libX11
+, libXv
+, libao
+, libpulseaudio
+, openal
+, pkg-config
 , runtimeShell
+, udev
 # Darwin dependencies
-, libicns, Carbon, Cocoa, OpenGL, OpenAL}:
+, libicns
+, Carbon
+, Cocoa
+, OpenAL
+, OpenGL
+}:
 
-let
-  inherit (lib) optionals;
-in
 stdenv.mkDerivation rec {
-
   pname = "higan";
-  version = "110";
+  version = "115+unstable=2021-08-18";
 
   src = fetchFromGitHub {
     owner = "higan-emu";
     repo = "higan";
-    rev = "v${version}";
-    sha256 = "11rvm53c3p2f6zk8xbyv2j51xp8zmqnch7zravhj3fk590qrjrr2";
+    rev = "9bf1b3314b2bcc73cbc11d344b369c31562aff10";
+    hash = "sha256-HZItJ97x20OjFKv2OVbMja7g+c1ZXcgcaC/XDe3vMZM=";
   };
 
-  patches = [ ./0001-change-flags.diff ];
-  postPatch = ''
-    sed '1i#include <cmath>' -i higan/fc/ppu/ppu.cpp
+  nativeBuildInputs = [
+    pkg-config
+  ] ++ lib.optionals stdenv.isDarwin [
+    libicns
+  ];
+
+  buildInputs = [
+    SDL2
+    libao
+  ] ++ lib.optionals stdenv.isLinux [
+    alsa-lib
+    gtk3
+    gtksourceview3
+    libGL
+    libGLU
+    libX11
+    libXv
+    libpulseaudio
+    openal
+    udev
+  ] ++ lib.optionals stdenv.isDarwin [
+    Carbon
+    Cocoa
+    OpenAL
+    OpenGL
+  ];
+
+  patches = [
+    # Includes cmath header
+    ./001-include-cmath.patch
+    # Uses png2icns instead of sips
+    ./002-sips-to-png2icns.patch
+  ];
+
+  dontConfigure = true;
+
+  enableParallelBuilding = true;
 
-    for file in icarus/GNUmakefile higan/target-higan/GNUmakefile; do
-      substituteInPlace "$file" \
-        --replace 'sips -s format icns data/$(name).png --out out/$(name).app/Contents/Resources/$(name).icns' \
-                  'png2icns out/$(name).app/Contents/Resources/$(name).icns data/$(name).png'
-    done
-  '';
-
-  nativeBuildInputs = [ pkg-config ]
-    ++ optionals stdenv.isDarwin [ libicns ];
+  buildPhase = ''
+    runHook preBuild
 
-  buildInputs = [ SDL2 libao ]
-                ++ optionals stdenv.isLinux [ alsa-lib udev libpulseaudio openal
-                                              gtk2 gtksourceview libX11 libXv
-                                              libGLU libGL ]
-                ++ optionals stdenv.isDarwin [ Carbon Cocoa OpenGL OpenAL ];
+    make -j $NIX_BUILD_CORES compiler=${stdenv.cc.targetPrefix}c++ \
+         platform=linux openmp=true hiro=gtk3 build=accuracy local=false \
+         cores="cv fc gb gba md ms msx ngp pce sfc sg ws" -C higan-ui
+    make -j $NIX_BUILD_CORES compiler=${stdenv.cc.targetPrefix}c++ \
+         platform=linux openmp=true hiro=gtk3 -C icarus
 
-  buildPhase = ''
-    make compiler=c++ -C higan openmp=true target=higan
-    make compiler=c++ -C genius openmp=true
-    make compiler=c++ -C icarus openmp=true
+    runHook postBuild
   '';
 
-  installPhase = (if stdenv.isDarwin then ''
-    mkdir "$out"
-    mv higan/out/higan.app "$out"/
-    mv icarus/out/icarus.app "$out"/
-    mv genius/out/genius.app "$out"/
+  installPhase = ''
+    runHook preInstall
+
+  '' + (if stdenv.isDarwin then ''
+    mkdir ${placeholder "out"}
+    mv higan/out/higan.app ${placeholder "out"}/
+    mv icarus/out/icarus.app ${placeholder "out"}/
   '' else ''
-    install -dm 755 "$out"/bin "$out"/share/applications "$out"/share/pixmaps
-
-    install -m 755 higan/out/higan -t "$out"/bin/
-    install -m 644 higan/target-higan/resource/higan.desktop \
-            -t $out/share/applications/
-    install -m 644 higan/target-higan/resource/higan.svg \
-            $out/share/pixmaps/higan-icon.svg
-    install -m 644 higan/target-higan/resource/higan.png \
-            $out/share/pixmaps/higan-icon.png
-
-    install -m 755 icarus/out/icarus -t "$out"/bin/
-    install -m 644 icarus/data/icarus.desktop -t $out/share/applications/
-    install -m 644 icarus/data/icarus.svg $out/share/pixmaps/icarus-icon.svg
-    install -m 644 icarus/data/icarus.png $out/share/pixmaps/icarus-icon.png
-
-    install -m 755 genius/out/genius -t "$out"/bin/
-    install -m 644 genius/data/genius.desktop -t $out/share/applications/
-    install -m 644 genius/data/genius.svg $out/share/pixmaps/genius-icon.svg
-    install -m 644 genius/data/genius.png $out/share/pixmaps/genius-icon.png
+    install -d ${placeholder "out"}/bin
+    install higan-ui/out/higan -t ${placeholder "out"}/bin/
+    install icarus/out/icarus -t ${placeholder "out"}/bin/
+
+    install -d ${placeholder "out"}/share/applications
+    install higan-ui/resource/higan.desktop -t ${placeholder "out"}/share/applications/
+    install icarus/resource/icarus.desktop -t ${placeholder "out"}/share/applications/
+
+    install -d ${placeholder "out"}/share/pixmaps
+    install higan/higan/resource/higan.svg ${placeholder "out"}/share/pixmaps/higan-icon.svg
+    install higan/higan/resource/logo.png ${placeholder "out"}/share/pixmaps/higan-icon.png
+    install icarus/resource/icarus.svg ${placeholder "out"}/share/pixmaps/icarus-icon.svg
+    install icarus/resource/icarus.png ${placeholder "out"}/share/pixmaps/icarus-icon.png
   '') + ''
-    mkdir -p "$out"/share/higan "$out"/share/icarus
-    cp --recursive --no-dereference --preserve='links' --no-preserve='ownership' \
-      higan/System/ "$out"/share/higan/
-    cp --recursive --no-dereference --preserve='links' --no-preserve='ownership' \
-      icarus/Database icarus/Firmware $out/share/icarus/
-  '';
+    install -d ${placeholder "out"}/share/higan
+    cp -rd extras/ higan/System/ ${placeholder "out"}/share/higan/
 
-  fixupPhase = let
-    dest = if stdenv.isDarwin
-           then "\\$HOME/Library/Application Support/higan"
-           else "\\$HOME/higan";
-  in ''
+    install -d ${placeholder "out"}/share/icarus
+    cp -rd icarus/Database icarus/Firmware ${placeholder "out"}/share/icarus/
+  '' + (
     # A dirty workaround, suggested by @cpages:
     # we create a first-run script to populate
     # $HOME with all the stuff needed at runtime
-
-    mkdir -p "$out"/bin
-    cat <<EOF > $out/bin/higan-init.sh
+    let
+      dest = if stdenv.isDarwin
+           then "\\$HOME/Library/Application Support/higan"
+           else "\\$HOME/higan";
+    in ''
+    mkdir -p ${placeholder "out"}/bin
+    cat <<EOF > ${placeholder "out"}/bin/higan-init.sh
     #!${runtimeShell}
 
-    cp --recursive --update $out/share/higan/System/ "${dest}"/
+    cp --recursive --update ${placeholder "out"}/share/higan/System/ "${dest}"/
 
     EOF
 
-    chmod +x $out/bin/higan-init.sh
+    chmod +x ${placeholder "out"}/bin/higan-init.sh
+  '') + ''
+
+    runHook postInstall
   '';
 
   meta = with lib; {
+    homepage = "https://github.com/higan-emu/higan";
     description = "An open-source, cycle-accurate multi-system emulator";
     longDescription = ''
-      higan is a multi-system game console emulator. The purpose of higan is to
-      serve as hardware documentation in source code form: it is meant to be as
-      accurate and complete as possible, with code that is easy to read and
-      understand.
-
-      It currently supports the following systems:
-      - Famicom + Famicom Disk System
-      - Super Famicom + Super Game Boy
-      - Game Boy + Game Boy Color
-      - Game Boy Advance + Game Boy Player
-      - SG-1000 + SC-3000
-      - Master System + Game Gear
-      - Mega Drive + Mega CD
-      - PC Engine + SuperGrafx
-      - MSX + MSX2
-      - ColecoVision
-      - Neo Geo Pocket + Neo Geo Pocket Color
-      - WonderSwan + WonderSwan Color + SwanCrystal + Pocket Challenge V2
+      higan is a multi-system emulator, originally developed by Near, with an
+      uncompromising focus on accuracy and code readability.
+
+      It currently emulates the following systems: Famicom, Famicom Disk System,
+      Super Famicom, Super Game Boy, Game Boy, Game Boy Color, Game Boy Advance,
+      Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive,
+      Mega CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket,
+      Neo Geo Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket
+      Challenge V2.
     '';
-    homepage = "https://byuu.org/higan/";
     license = licenses.gpl3Plus;
     maintainers = with maintainers; [ AndersonTorres ];
     platforms = platforms.unix;
   };
 }
-# TODO: Qt and GTK3+ support
+# TODO: select between Qt, GTK2 and GTK3
diff --git a/nixpkgs/pkgs/misc/emulators/melonDS/default.nix b/nixpkgs/pkgs/misc/emulators/melonDS/default.nix
index bd3bffde54f2..7123f496fad6 100644
--- a/nixpkgs/pkgs/misc/emulators/melonDS/default.nix
+++ b/nixpkgs/pkgs/misc/emulators/melonDS/default.nix
@@ -26,12 +26,13 @@ mkDerivation rec {
   buildInputs = [
     epoxy
     libarchive
-    libpcap
     libslirp
     qtbase
     SDL2
   ];
 
+  qtWrapperArgs = [ "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpcap ]}" ];
+
   meta = with lib; {
     homepage = "http://melonds.kuribo64.net/";
     description = "Work in progress Nintendo DS emulator";
diff --git a/nixpkgs/pkgs/misc/emulators/ryujinx/default.nix b/nixpkgs/pkgs/misc/emulators/ryujinx/default.nix
index 2e89aa296a23..e584331ea669 100644
--- a/nixpkgs/pkgs/misc/emulators/ryujinx/default.nix
+++ b/nixpkgs/pkgs/misc/emulators/ryujinx/default.nix
@@ -1,11 +1,25 @@
-{ lib, stdenv, fetchFromGitHub, fetchurl, makeWrapper, makeDesktopItem, linkFarmFromDrvs
-, dotnet-sdk_5, dotnetPackages, dotnetCorePackages, cacert
+{ lib, buildDotnetModule, fetchFromGitHub, makeDesktopItem
 , libX11, libgdiplus, ffmpeg
 , SDL2_mixer, openal, libsoundio, sndio, pulseaudio
 , gtk3, gobject-introspection, gdk-pixbuf, wrapGAppsHook
 }:
 
-let
+buildDotnetModule rec {
+  pname = "ryujinx";
+  version = "1.0.7065"; # Versioning is based off of the official appveyor builds: https://ci.appveyor.com/project/gdkchan/ryujinx
+
+  src = fetchFromGitHub {
+    owner = "Ryujinx";
+    repo = "Ryujinx";
+    rev = "c54a14d0b8d445d9d0074861dca816cc801e4008";
+    sha256 = "13j91413x1bvg27vcx9sgc7gv00q84d8f5pllih5g5plzld4r541";
+  };
+
+  projectFile = "Ryujinx.sln";
+  executables = [ "Ryujinx" ];
+  nugetDeps = ./deps.nix;
+
+  nativeBuildInputs = [ wrapGAppsHook gobject-introspection gdk-pixbuf ];
   runtimeDeps = [
     gtk3
     libX11
@@ -17,81 +31,24 @@ let
     sndio
     pulseaudio
   ];
-in stdenv.mkDerivation rec {
-  pname = "ryujinx";
-  version = "1.0.7047"; # Versioning is based off of the official appveyor builds: https://ci.appveyor.com/project/gdkchan/ryujinx
-
-  src = fetchFromGitHub {
-    owner = "Ryujinx";
-    repo = "Ryujinx";
-    rev = "7c5ead1c196d597384085cc9a609afdc89a43774";
-    sha256 = "00c6il67y9ky0f8f97nn8aqm4klwz59842nsh554w98gwv8w1jjb";
-  };
-
-  nativeBuildInputs = [ dotnet-sdk_5 dotnetPackages.Nuget cacert makeWrapper wrapGAppsHook gobject-introspection gdk-pixbuf ];
-
-  nugetDeps = linkFarmFromDrvs "${pname}-nuget-deps" (import ./deps.nix {
-    fetchNuGet = { name, version, sha256 }: fetchurl {
-      name = "nuget-${name}-${version}.nupkg";
-      url = "https://www.nuget.org/api/v2/package/${name}/${version}";
-      inherit sha256;
-    };
-  });
 
   patches = [
     ./log.patch # Without this, Ryujinx attempts to write logs to the nix store. This patch makes it write to "~/.config/Ryujinx/Logs" on Linux.
   ];
 
-  configurePhase = ''
-    runHook preConfigure
-
-    export HOME=$(mktemp -d)
-    export DOTNET_CLI_TELEMETRY_OPTOUT=1
-    export DOTNET_NOLOGO=1
-
-    nuget sources Add -Name nixos -Source "$PWD/nixos"
-    nuget init "$nugetDeps" "$PWD/nixos"
-
-    # FIXME: https://github.com/NuGet/Home/issues/4413
-    mkdir -p $HOME/.nuget/NuGet
-    cp $HOME/.config/NuGet/NuGet.Config $HOME/.nuget/NuGet
-
-    dotnet restore --source "$PWD/nixos" Ryujinx.sln
-
-    runHook postConfigure
-  '';
-
-  buildPhase = ''
-    runHook preBuild
-    dotnet build Ryujinx.sln \
-      --no-restore \
-      --configuration Release \
-      -p:Version=${version}
-    runHook postBuild
-  '';
-
-  installPhase = ''
-    runHook preInstall
-
-    dotnet publish Ryujinx.sln \
-      --no-build \
-      --configuration Release \
-      --no-self-contained \
-      --output $out/lib/ryujinx
-    shopt -s extglob
-
+  preInstall = ''
     # TODO: fix this hack https://github.com/Ryujinx/Ryujinx/issues/2349
     mkdir -p $out/lib/sndio-6
     ln -s ${sndio}/lib/libsndio.so $out/lib/sndio-6/libsndio.so.6
 
-    makeWrapper $out/lib/ryujinx/Ryujinx $out/bin/Ryujinx \
-      --set DOTNET_ROOT "${dotnetCorePackages.net_5_0}" \
-      --suffix LD_LIBRARY_PATH : "${builtins.concatStringsSep ":" [ (lib.makeLibraryPath runtimeDeps) "$out/lib/sndio-6" ]}" \
-      ''${gappsWrapperArgs[@]}
+    makeWrapperArgs+=(
+      --suffix LD_LIBRARY_PATH : "$out/lib/sndio-6"
+    )
 
     for i in 16 32 48 64 96 128 256 512 1024; do
       install -D ${src}/Ryujinx/Ui/Resources/Logo_Ryujinx.png $out/share/icons/hicolor/''${i}x$i/apps/ryujinx.png
     done
+
     cp -r ${makeDesktopItem {
       desktopName = "Ryujinx";
       name = "ryujinx";
@@ -101,13 +58,8 @@ in stdenv.mkDerivation rec {
       type = "Application";
       categories = "Game;";
     }}/share/applications $out/share
-
-    runHook postInstall
   '';
 
-  # Strip breaks the executable.
-  dontStrip = true;
-
   meta = with lib; {
     description = "Experimental Nintendo Switch Emulator written in C#";
     homepage = "https://ryujinx.org/";
diff --git a/nixpkgs/pkgs/misc/emulators/uxn/default.nix b/nixpkgs/pkgs/misc/emulators/uxn/default.nix
index 3e4928412b11..0b797e2e160b 100644
--- a/nixpkgs/pkgs/misc/emulators/uxn/default.nix
+++ b/nixpkgs/pkgs/misc/emulators/uxn/default.nix
@@ -6,7 +6,7 @@
 
 stdenv.mkDerivation rec {
   pname = "uxn";
-  version = "0.0.0+unstable=2021-08-30";
+  version = "0.pre+unstable=2021-08-30";
 
   src = fetchFromSourcehut {
     owner = "~rabbits";
diff --git a/nixpkgs/pkgs/misc/emulators/wine/base.nix b/nixpkgs/pkgs/misc/emulators/wine/base.nix
index 0023d9878b36..fa5c4afdc298 100644
--- a/nixpkgs/pkgs/misc/emulators/wine/base.nix
+++ b/nixpkgs/pkgs/misc/emulators/wine/base.nix
@@ -74,7 +74,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
   ++ lib.optionals openclSupport [ pkgs.opencl-headers pkgs.ocl-icd ]
   ++ lib.optionals xmlSupport    [ pkgs.libxml2 pkgs.libxslt ]
   ++ lib.optionals tlsSupport    [ pkgs.openssl pkgs.gnutls ]
-  ++ lib.optionals openglSupport [ pkgs.libGLU pkgs.libGL pkgs.mesa.osmesa pkgs.libdrm ]
+  ++ lib.optionals (openglSupport && !stdenv.isDarwin) [ pkgs.libGLU pkgs.libGL pkgs.mesa.osmesa pkgs.libdrm ]
   ++ lib.optionals stdenv.isDarwin (with pkgs.buildPackages.darwin.apple_sdk.frameworks; [
      CoreServices Foundation ForceFeedback AppKit OpenGL IOKit DiskArbitration Security
      ApplicationServices AudioToolbox CoreAudio AudioUnit CoreMIDI OpenAL OpenCL Cocoa Carbon
@@ -106,7 +106,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
 
   postInstall = let
     links = prefix: pkg: "ln -s ${pkg} $out/${prefix}/${pkg.name}";
-  in ''
+  in lib.optionalString supportFlags.embedInstallers ''
     mkdir -p $out/share/wine/gecko $out/share/wine/mono/
     ${lib.strings.concatStringsSep "\n"
           ((map (links "share/wine/gecko") geckos)
diff --git a/nixpkgs/pkgs/misc/emulators/wine/default.nix b/nixpkgs/pkgs/misc/emulators/wine/default.nix
index 6def48b4f596..023d013740dd 100644
--- a/nixpkgs/pkgs/misc/emulators/wine/default.nix
+++ b/nixpkgs/pkgs/misc/emulators/wine/default.nix
@@ -45,6 +45,7 @@
   faudioSupport ? false,
   vkd3dSupport ? false,
   mingwSupport ? wineRelease != "stable",
+  embedInstallers ? false # The Mono and Gecko MSI installers
 }:
 
 let wine-build = build: release:
@@ -57,7 +58,7 @@ let wine-build = build: release:
                   gsmSupport gphoto2Support ldapSupport fontconfigSupport alsaSupport
                   pulseaudioSupport xineramaSupport gtkSupport openclSupport xmlSupport tlsSupport
                   openglSupport gstreamerSupport udevSupport vulkanSupport sdlSupport faudioSupport
-                  vkd3dSupport mingwSupport;
+                  vkd3dSupport mingwSupport embedInstallers;
         };
       });
 
diff --git a/nixpkgs/pkgs/misc/emulators/wine/sources.nix b/nixpkgs/pkgs/misc/emulators/wine/sources.nix
index 618fb3beeeb4..7b87c4acbff0 100644
--- a/nixpkgs/pkgs/misc/emulators/wine/sources.nix
+++ b/nixpkgs/pkgs/misc/emulators/wine/sources.nix
@@ -44,16 +44,16 @@ in rec {
 
   unstable = fetchurl rec {
     # NOTE: Don't forget to change the SHA256 for staging as well.
-    version = "6.17";
+    version = "6.19";
     url = "https://dl.winehq.org/wine/source/6.x/wine-${version}.tar.xz";
-    sha256 = "sha256-nbHyQ12AJiw3dzF98HWFWu6j5qUst3xjDsGysfuUjwg=";
+    sha256 = "sha256-QYLi2WJ3BMw3b0b8MQlYDqkHd5b0T17oPgjj6Wvwq2Y=";
     inherit (stable) gecko32 gecko64;
 
     ## see http://wiki.winehq.org/Mono
     mono = fetchurl rec {
-      version = "6.3.0";
+      version = "6.4.0";
       url = "https://dl.winehq.org/wine/wine-mono/${version}/wine-mono-${version}-x86.msi";
-      sha256 = "sha256-pfAtMqAoNpKkpiX1Qc+7tFGIMShHTFyANiOFMXzQmfA=";
+      sha256 = "sha256-24uF87kQWQ9hrb+gAFqZXWE+KZocxz0AVT1w3IEBDjY=";
     };
 
     patches = [
@@ -65,7 +65,7 @@ in rec {
   staging = fetchFromGitHub rec {
     # https://github.com/wine-staging/wine-staging/releases
     inherit (unstable) version;
-    sha256 = "sha256-rR5m6D8M3vTXXIHzsF8+o2G5rlRS2HLfCHoatbJwlrQ=";
+    sha256 = "sha256-1Ng+kFFnqEndlCvI0eG1YmyqPdcolD3cVJ2KU5GU7Z4=";
     owner = "wine-staging";
     repo = "wine-staging";
     rev = "v${version}";
diff --git a/nixpkgs/pkgs/misc/emulators/zesarux/default.nix b/nixpkgs/pkgs/misc/emulators/zesarux/default.nix
new file mode 100644
index 000000000000..4df6cfafbc01
--- /dev/null
+++ b/nixpkgs/pkgs/misc/emulators/zesarux/default.nix
@@ -0,0 +1,89 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, SDL2
+, aalib
+, alsa-lib
+, libXext
+, libXxf86vm
+, libcaca
+, libpulseaudio
+, libsndfile
+, ncurses
+, openssl
+, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zesarux";
+  version = "10.0";
+
+  src = fetchFromGitHub {
+    owner = "chernandezba";
+    repo = pname;
+    rev = version;
+    hash = "sha256-cxV2dAzGnIzJiCRdq8vN/Cl4AQeJqjmiCAahijIJQ9k=";
+  };
+
+  nativeBuildInputs = [
+    which
+  ];
+
+  buildInputs = [
+    SDL2
+    aalib
+    alsa-lib
+    libXxf86vm
+    libXext
+    libcaca
+    libpulseaudio
+    libsndfile
+    ncurses
+    openssl
+  ];
+
+  patches = [
+    # Patch the shell scripts; remove it when the next version arrives
+    (fetchpatch {
+      name = "000-fix-shebangs.patch";
+      url = "https://github.com/chernandezba/zesarux/commit/4493439b38f565c5be7c36239ecaf0cf80045627.diff";
+      sha256 = "sha256-f+21naPcPXdcVvqU8ymlGfl1WkYGOeOBe9B/WFUauTI=";
+    })
+  ];
+
+  postPatch = ''
+    cd src
+    patchShebangs ./configure *.sh
+  '';
+
+  configureFlags = [
+    "--prefix=${placeholder "out"}"
+    "--c-compiler ${stdenv.cc.targetPrefix}cc"
+    "--enable-cpustats"
+    "--enable-memptr"
+    "--enable-sdl2"
+    "--enable-ssl"
+    "--enable-undoc-scfccf"
+    "--enable-visualmem"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    ./generate_install_sh.sh
+    patchShebangs ./install.sh
+    ./install.sh
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/chernandezba/zesarux";
+    description = " ZX Second-Emulator And Released for UniX";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
+# TODO: Darwin support