Merge pull request #306652 from atorres1985-contrib/snes9x

snes9x: 1.62.3 -> 1.62.3-unstable-2024-04-22
This commit is contained in:
Thiago Kenji Okada 2024-04-25 17:27:41 +01:00 committed by GitHub
commit 3a23d44ac8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 64 additions and 63 deletions

View File

@ -1,46 +1,44 @@
{ lib {
, stdenv lib,
, alsa-lib SDL2,
, cmake alsa-lib,
, fetchFromGitHub cmake,
, gtkmm3 fetchFromGitHub,
, libepoxy gtkmm3,
, libpng libX11,
, libselinux libXdmcp,
, libX11 libXext,
, libXdmcp libXinerama,
, libXext libXrandr,
, libXinerama libXv,
, libXrandr libepoxy,
, libXv libpng,
, minizip libselinux,
, ninja minizip,
, pcre2 ninja,
, pkg-config pcre2,
, portaudio pkg-config,
, pulseaudio portaudio,
, python3 pulseaudio,
, SDL2 python3,
, util-linuxMinimal stdenv,
, wrapGAppsHook util-linuxMinimal,
, zlib wrapGAppsHook,
, withGtk ? false zlib,
# Boolean flags
withGtk ? false,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = pname = "snes9x" + lib.optionalString withGtk "-gtk";
if withGtk then version = "1.62.3-unstable-2024-04-22";
"snes9x-gtk"
else
"snes9x";
version = "1.62.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "snes9xgit"; owner = "snes9xgit";
repo = "snes9x"; repo = "snes9x";
rev = version; rev = "582128bce7ccf4e3cf7848ae9f6a729a1ebad4c4";
fetchSubmodules = true; fetchSubmodules = true;
hash = "sha256-+KHpvz7nfwGXjzDAK/V+2JDRT1sa0kXDkg7XcRyvSP8="; hash = "sha256-fJ1g/L7oA9bhEawTsWjfLl1dDIKEGI+pcpWQCTutyR8=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
@ -59,10 +57,11 @@ stdenv.mkDerivation rec {
minizip minizip
zlib zlib
] ]
# on non-Linux platforms this will build without sound support on X11 build
++ lib.optionals stdenv.isLinux [ ++ lib.optionals stdenv.isLinux [
alsa-lib alsa-lib
pulseaudio pulseaudio
libselinux
util-linuxMinimal # provides libmount
] ]
++ lib.optionals (!withGtk) [ ++ lib.optionals (!withGtk) [
libpng libpng
@ -72,42 +71,43 @@ stdenv.mkDerivation rec {
++ lib.optionals withGtk [ ++ lib.optionals withGtk [
gtkmm3 gtkmm3
libepoxy libepoxy
libselinux
libXdmcp libXdmcp
libXrandr libXrandr
pcre2 pcre2
portaudio portaudio
SDL2 SDL2
util-linuxMinimal # provides libmount
]; ];
configureFlags = hardeningDisable = [ "format" ];
lib.optional stdenv.hostPlatform.sse4_1Support "--enable-sse41"
++ lib.optional stdenv.hostPlatform.avx2Support "--enable-avx2"; configureFlags = lib.optionals stdenv.hostPlatform.sse4_1Support [
"--enable-sse41"
]
++ lib.optionals stdenv.hostPlatform.avx2Support [
"--enable-avx2"
];
preConfigure = ''
cd ${if withGtk then "gtk" else "unix"}
'';
installPhase = lib.optionalString (!withGtk) '' installPhase = lib.optionalString (!withGtk) ''
runHook preInstall runHook preInstall
install -Dm755 snes9x -t "$out/bin/" install -Dm755 snes9x -t "$out/bin/"
install -Dm644 snes9x.conf.default -t "$out/share/doc/${pname}/" install -Dm644 snes9x.conf.default -t "$out/share/doc/${finalAttrs.pname}/"
install -Dm644 ../docs/{control-inputs,controls,snapshots}.txt -t \ install -Dm644 ../docs/{control-inputs,controls,snapshots}.txt -t \
"$out/share/doc/${pname}/" "$out/share/doc/${finalAttrs.pname}/"
runHook postInstall runHook postInstall
''; '';
preConfigure = if withGtk then "cd gtk" else "cd unix"; meta = let
interface = if withGtk then "GTK" else "X11";
enableParallelBuilding = true; in
meta = with lib;
let
interface = if withGtk then "GTK" else "X11";
in
{ {
homepage = "https://www.snes9x.com"; homepage = "https://www.snes9x.com";
description = "Super Nintendo Entertainment System (SNES) emulator, ${interface} version"; description = "Super Nintendo Entertainment System (SNES) emulator, ${interface} version";
longDescription = '' longDescription = ''
Snes9x is a portable, freeware Super Nintendo Entertainment System (SNES) Snes9x is a portable, freeware Super Nintendo Entertainment System (SNES)
emulator. It basically allows you to play most games designed for the SNES emulator. It basically allows you to play most games designed for the SNES
@ -116,13 +116,16 @@ stdenv.mkDerivation rec {
Version build with ${interface} interface. Version build with ${interface} interface.
''; '';
license = lib.licenses.unfreeRedistributable // {
license = licenses.unfreeRedistributable // { url = "https://github.com/snes9xgit/snes9x/blob/${finalAttrs.src.rev}/LICENSE";
url = "https://github.com/snes9xgit/snes9x/blob/${version}/LICENSE";
}; };
maintainers = with maintainers; [ qknight thiagokokada ];
platforms = platforms.unix;
broken = (withGtk && stdenv.isDarwin);
mainProgram = "snes9x"; mainProgram = "snes9x";
maintainers = with lib.maintainers; [
AndersonTorres
qknight
thiagokokada
];
platforms = lib.platforms.unix;
broken = (withGtk && stdenv.isDarwin);
}; };
} })

View File

@ -2795,9 +2795,7 @@ with pkgs;
simplenes = callPackage ../applications/emulators/simplenes { }; simplenes = callPackage ../applications/emulators/simplenes { };
snes9x = callPackage ../applications/emulators/snes9x { }; snes9x-gtk = snes9x.override {
snes9x-gtk = callPackage ../applications/emulators/snes9x {
withGtk = true; withGtk = true;
}; };