2024-04-25 01:11:32 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
SDL2,
|
|
|
|
alsa-lib,
|
|
|
|
cmake,
|
|
|
|
fetchFromGitHub,
|
|
|
|
gtkmm3,
|
|
|
|
libX11,
|
|
|
|
libXdmcp,
|
|
|
|
libXext,
|
|
|
|
libXinerama,
|
|
|
|
libXrandr,
|
|
|
|
libXv,
|
|
|
|
libepoxy,
|
|
|
|
libpng,
|
|
|
|
libselinux,
|
|
|
|
minizip,
|
|
|
|
ninja,
|
|
|
|
pcre2,
|
|
|
|
pkg-config,
|
|
|
|
portaudio,
|
|
|
|
pulseaudio,
|
|
|
|
python3,
|
|
|
|
stdenv,
|
|
|
|
util-linuxMinimal,
|
|
|
|
wrapGAppsHook,
|
|
|
|
zlib,
|
|
|
|
# Boolean flags
|
|
|
|
withGtk ? false,
|
2022-04-20 00:28:54 +02:00
|
|
|
}:
|
|
|
|
|
2024-04-25 01:11:32 +02:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "snes9x" + lib.optionalString withGtk "-gtk";
|
|
|
|
version = "1.62.3-unstable-2024-04-22";
|
2022-04-20 00:28:54 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "snes9xgit";
|
|
|
|
repo = "snes9x";
|
2024-04-25 01:11:32 +02:00
|
|
|
rev = "582128bce7ccf4e3cf7848ae9f6a729a1ebad4c4";
|
2022-04-20 00:28:54 +02:00
|
|
|
fetchSubmodules = true;
|
2024-04-25 01:11:32 +02:00
|
|
|
hash = "sha256-fJ1g/L7oA9bhEawTsWjfLl1dDIKEGI+pcpWQCTutyR8=";
|
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
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isLinux [
|
|
|
|
alsa-lib
|
|
|
|
pulseaudio
|
2024-04-25 01:11:32 +02:00
|
|
|
libselinux
|
|
|
|
util-linuxMinimal # provides libmount
|
2022-04-20 00:28:54 +02:00
|
|
|
]
|
|
|
|
++ 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
|
|
|
libXdmcp
|
|
|
|
libXrandr
|
|
|
|
pcre2
|
2022-04-20 00:28:54 +02:00
|
|
|
portaudio
|
|
|
|
SDL2
|
|
|
|
];
|
|
|
|
|
2024-04-25 01:11:32 +02:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
configureFlags = lib.optionals stdenv.hostPlatform.sse4_1Support [
|
|
|
|
"--enable-sse41"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.avx2Support [
|
|
|
|
"--enable-avx2"
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd ${if withGtk then "gtk" else "unix"}
|
|
|
|
'';
|
2022-04-20 00:28:54 +02:00
|
|
|
|
|
|
|
installPhase = lib.optionalString (!withGtk) ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 snes9x -t "$out/bin/"
|
2024-04-25 01:11:32 +02:00
|
|
|
install -Dm644 snes9x.conf.default -t "$out/share/doc/${finalAttrs.pname}/"
|
2022-04-20 00:28:54 +02:00
|
|
|
install -Dm644 ../docs/{control-inputs,controls,snapshots}.txt -t \
|
2024-04-25 01:11:32 +02:00
|
|
|
"$out/share/doc/${finalAttrs.pname}/"
|
2022-04-20 00:28:54 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-04-25 01:11:32 +02:00
|
|
|
meta = let
|
|
|
|
interface = if withGtk then "GTK" else "X11";
|
|
|
|
in
|
2022-04-20 00:28:54 +02:00
|
|
|
{
|
|
|
|
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.
|
|
|
|
'';
|
2024-04-25 01:11:32 +02:00
|
|
|
license = lib.licenses.unfreeRedistributable // {
|
|
|
|
url = "https://github.com/snes9xgit/snes9x/blob/${finalAttrs.src.rev}/LICENSE";
|
2022-04-20 00:28:54 +02:00
|
|
|
};
|
2023-08-04 20:23:13 +02:00
|
|
|
mainProgram = "snes9x";
|
2024-04-25 01:11:32 +02:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
AndersonTorres
|
|
|
|
qknight
|
|
|
|
thiagokokada
|
|
|
|
];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
broken = (withGtk && stdenv.isDarwin);
|
2022-04-20 00:28:54 +02:00
|
|
|
};
|
2024-04-25 01:11:32 +02:00
|
|
|
})
|