2021-01-15 13:21:58 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, nasm, SDL, zlib, libpng, ncurses, libGLU, libGL
|
2016-06-04 20:43:43 +00:00
|
|
|
, makeDesktopItem }:
|
2011-06-25 22:25:50 +00:00
|
|
|
|
2016-06-04 20:43:43 +00:00
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "zsnes";
|
|
|
|
exec = "zsnes";
|
|
|
|
icon = "zsnes";
|
|
|
|
comment = "A SNES emulator";
|
|
|
|
desktopName = "zsnes";
|
|
|
|
genericName = "zsnes";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" ];
|
2016-06-04 20:43:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
2021-08-12 21:00:21 +00:00
|
|
|
pname = "zsnes";
|
|
|
|
version = "1.51";
|
2013-10-09 06:15:39 +00:00
|
|
|
|
2016-10-07 22:39:40 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "emillon";
|
|
|
|
repo = "zsnes";
|
|
|
|
rev = "fc160b2538738995f600f8405d23a66b070dac02";
|
|
|
|
sha256 = "1gy79d5wdaacph0cc1amw7mqm7i0716n6mvav16p1svi26iz193v";
|
2011-06-25 22:25:50 +00:00
|
|
|
};
|
|
|
|
|
2019-11-10 16:44:34 +00:00
|
|
|
buildInputs = [ nasm SDL zlib libpng ncurses libGLU libGL ];
|
2014-01-02 23:54:13 +00:00
|
|
|
|
2016-10-07 22:39:40 +00:00
|
|
|
prePatch = ''
|
|
|
|
for i in $(cat debian/patches/series); do
|
|
|
|
echo "applying $i"
|
|
|
|
patch -p1 < "debian/patches/$i"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2011-06-25 22:25:50 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cd src
|
2014-01-02 23:54:13 +00:00
|
|
|
sed -i "/^STRIP/d" configure
|
2017-08-05 14:39:48 +00:00
|
|
|
sed -i "/\$STRIP/d" configure
|
2011-06-25 22:25:50 +00:00
|
|
|
'';
|
2013-10-09 06:15:39 +00:00
|
|
|
|
2015-07-10 10:42:39 +00:00
|
|
|
configureFlags = [ "--enable-release" ];
|
2013-10-09 06:15:39 +00:00
|
|
|
|
2016-06-04 20:43:43 +00:00
|
|
|
postInstall = ''
|
|
|
|
function installIcon () {
|
|
|
|
mkdir -p $out/share/icons/hicolor/$1/apps/
|
|
|
|
cp icons/$1x32.png $out/share/icons/hicolor/$1/apps/zsnes.png
|
|
|
|
}
|
|
|
|
installIcon "16x16"
|
|
|
|
installIcon "32x32"
|
|
|
|
installIcon "48x48"
|
|
|
|
installIcon "64x64"
|
|
|
|
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications/
|
|
|
|
'';
|
|
|
|
|
2011-06-25 22:25:50 +00:00
|
|
|
meta = {
|
|
|
|
description = "A Super Nintendo Entertainment System Emulator";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = [ lib.maintainers.sander ];
|
2022-01-03 15:53:12 +00:00
|
|
|
homepage = "https://www.zsnes.com";
|
2017-09-10 12:19:11 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2011-06-25 22:25:50 +00:00
|
|
|
};
|
2014-01-02 23:54:13 +00:00
|
|
|
}
|