2022-04-20 00:28:54 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, alsa-lib
|
2023-03-25 11:35:49 +01:00
|
|
|
, cmake
|
2022-04-20 00:28:54 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, gtkmm3
|
|
|
|
, libepoxy
|
|
|
|
, libpng
|
2023-03-25 11:35:49 +01:00
|
|
|
, libselinux
|
2022-04-20 00:28:54 +02:00
|
|
|
, libX11
|
2023-03-25 11:35:49 +01:00
|
|
|
, libXdmcp
|
2022-04-20 00:28:54 +02:00
|
|
|
, libXext
|
|
|
|
, libXinerama
|
2023-03-25 11:35:49 +01:00
|
|
|
, libXrandr
|
|
|
|
, libXv
|
2022-04-20 00:28:54 +02:00
|
|
|
, minizip
|
|
|
|
, ninja
|
2023-03-25 11:35:49 +01:00
|
|
|
, pcre2
|
2022-04-20 00:28:54 +02:00
|
|
|
, pkg-config
|
|
|
|
, portaudio
|
|
|
|
, pulseaudio
|
2023-03-25 11:35:49 +01:00
|
|
|
, python3
|
2022-04-20 00:28:54 +02:00
|
|
|
, SDL2
|
2023-03-25 11:35:49 +01:00
|
|
|
, util-linuxMinimal
|
2022-04-20 00:28:54 +02:00
|
|
|
, wrapGAppsHook
|
|
|
|
, zlib
|
|
|
|
, withGtk ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname =
|
|
|
|
if withGtk then
|
|
|
|
"snes9x-gtk"
|
|
|
|
else
|
|
|
|
"snes9x";
|
2023-04-05 16:51:26 +02:00
|
|
|
version = "1.62.3";
|
2022-04-20 00:28:54 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "snes9xgit";
|
|
|
|
repo = "snes9x";
|
|
|
|
rev = version;
|
|
|
|
fetchSubmodules = true;
|
2023-04-05 16:51:26 +02:00
|
|
|
hash = "sha256-+KHpvz7nfwGXjzDAK/V+2JDRT1sa0kXDkg7XcRyvSP8=";
|
2022-04-20 00:28:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2023-03-25 11:35:49 +01:00
|
|
|
python3
|
2022-04-20 16:38:57 +02:00
|
|
|
]
|
2022-04-20 00:28:54 +02:00
|
|
|
++ lib.optionals withGtk [
|
2023-03-25 11:35:49 +01:00
|
|
|
cmake
|
2022-04-20 00:28:54 +02:00
|
|
|
ninja
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libX11
|
|
|
|
libXv
|
|
|
|
minizip
|
|
|
|
zlib
|
|
|
|
]
|
|
|
|
# on non-Linux platforms this will build without sound support on X11 build
|
|
|
|
++ lib.optionals stdenv.isLinux [
|
|
|
|
alsa-lib
|
|
|
|
pulseaudio
|
|
|
|
]
|
|
|
|
++ lib.optionals (!withGtk) [
|
|
|
|
libpng
|
2023-03-25 11:35:49 +01:00
|
|
|
libXext
|
2022-04-20 00:28:54 +02:00
|
|
|
libXinerama
|
|
|
|
]
|
|
|
|
++ lib.optionals withGtk [
|
|
|
|
gtkmm3
|
|
|
|
libepoxy
|
2023-03-25 11:35:49 +01:00
|
|
|
libselinux
|
|
|
|
libXdmcp
|
|
|
|
libXrandr
|
|
|
|
pcre2
|
2022-04-20 00:28:54 +02:00
|
|
|
portaudio
|
|
|
|
SDL2
|
2023-03-25 11:35:49 +01:00
|
|
|
util-linuxMinimal # provides libmount
|
2022-04-20 00:28:54 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
configureFlags =
|
|
|
|
lib.optional stdenv.hostPlatform.sse4_1Support "--enable-sse41"
|
2022-04-20 16:38:57 +02:00
|
|
|
++ lib.optional stdenv.hostPlatform.avx2Support "--enable-avx2";
|
2022-04-20 00:28:54 +02:00
|
|
|
|
|
|
|
installPhase = lib.optionalString (!withGtk) ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 snes9x -t "$out/bin/"
|
|
|
|
install -Dm644 snes9x.conf.default -t "$out/share/doc/${pname}/"
|
|
|
|
install -Dm644 ../docs/{control-inputs,controls,snapshots}.txt -t \
|
|
|
|
"$out/share/doc/${pname}/"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-03-25 11:35:49 +01:00
|
|
|
preConfigure = if withGtk then "cd gtk" else "cd unix";
|
2022-04-20 00:28:54 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with lib;
|
|
|
|
let
|
|
|
|
interface = if withGtk then "GTK" else "X11";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
homepage = "https://www.snes9x.com";
|
|
|
|
description = "Super Nintendo Entertainment System (SNES) emulator, ${interface} version";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Snes9x is a portable, freeware Super Nintendo Entertainment System (SNES)
|
|
|
|
emulator. It basically allows you to play most games designed for the SNES
|
|
|
|
and Super Famicom Nintendo game systems on your PC or Workstation; which
|
|
|
|
includes some real gems that were only ever released in Japan.
|
|
|
|
|
|
|
|
Version build with ${interface} interface.
|
|
|
|
'';
|
|
|
|
|
|
|
|
license = licenses.unfreeRedistributable // {
|
|
|
|
url = "https://github.com/snes9xgit/snes9x/blob/${version}/LICENSE";
|
|
|
|
};
|
|
|
|
maintainers = with maintainers; [ qknight xfix thiagokokada ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
broken = (withGtk && stdenv.isDarwin);
|
2023-08-04 20:23:13 +02:00
|
|
|
mainProgram = "snes9x";
|
2022-04-20 00:28:54 +02:00
|
|
|
};
|
|
|
|
}
|