1 { lib, stdenv, fetchFromGitHub, nasm, SDL, zlib, libpng, ncurses, libGLU, libGL
5 desktopItem = makeDesktopItem {
9 comment = "A SNES emulator";
10 desktopName = "zsnes";
11 genericName = "zsnes";
12 categories = [ "Game" ];
15 in stdenv.mkDerivation {
19 src = fetchFromGitHub {
22 rev = "fc160b2538738995f600f8405d23a66b070dac02";
23 sha256 = "1gy79d5wdaacph0cc1amw7mqm7i0716n6mvav16p1svi26iz193v";
26 buildInputs = [ nasm SDL zlib libpng ncurses libGLU libGL ];
29 for i in $(cat debian/patches/series); do
31 patch -p1 < "debian/patches/$i"
35 # Workaround build failure on -fno-common toolchains:
36 # ld: initc.o:(.bss+0x28): multiple definition of `HacksDisable'; cfg.o:(.bss+0x59e3): first defined here
37 # Use pre-c++17 standard (c++17 forbids throw annotations)
38 NIX_CFLAGS_COMPILE = "-fcommon -std=c++14";
42 sed -i "/^STRIP/d" configure
43 sed -i "/\$STRIP/d" configure
46 configureFlags = [ "--enable-release" ];
49 function installIcon () {
50 mkdir -p $out/share/icons/hicolor/$1/apps/
51 cp icons/$1x32.png $out/share/icons/hicolor/$1/apps/zsnes.png
58 mkdir -p $out/share/applications
59 ln -s ${desktopItem}/share/applications/* $out/share/applications/
63 description = "A Super Nintendo Entertainment System Emulator";
64 license = lib.licenses.gpl2Plus;
65 maintainers = [ lib.maintainers.sander ];
66 homepage = "https://www.zsnes.com";
67 platforms = [ "i686-linux" "x86_64-linux" ];