uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,32 @@
{ lib, stdenv, fetchurl, libSM, libX11, libICE, SDL, alsa-lib, gcc-unwrapped, libXext }:
stdenv.mkDerivation rec {
pname = "atari++";
version = "1.83";
src = fetchurl {
url = "http://www.xl-project.com/download/${pname}_${version}.tar.gz";
sha256 = "04fm2ic2qi4a52mi72wcaxyrpll4k8vvchx3qrik8rhg3jrxgm47";
};
buildInputs = [ libSM libX11 SDL libICE alsa-lib gcc-unwrapped libXext ];
postFixup = ''
patchelf --set-rpath ${lib.makeLibraryPath buildInputs} "$out/bin/atari++"
'';
meta = with lib; {
homepage = "http://www.xl-project.com/";
description = "An enhanced, cycle-accurated Atari emulator";
longDescription = ''
The Atari++ Emulator is a Unix based emulator of the Atari eight
bit computers, namely the Atari 400 and 800, the Atari 400XL,
800XL and 130XE, and the Atari 5200 game console. The emulator
is auto-configurable and will compile on a variety of systems
(Linux, Solaris, Irix).
'';
maintainers = [ maintainers.AndersonTorres ];
license = licenses.gpl2Plus;
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,43 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook
, zlib, SDL, readline, libGLU, libGL, libX11 }:
with lib;
stdenv.mkDerivation rec {
pname = "atari800";
version = "4.2.0";
src = fetchFromGitHub {
owner = "atari800";
repo = "atari800";
rev = "ATARI800_${replaceChars ["."] ["_"] version}";
sha256 = "15l08clqqayi9izrgsz9achan6gl4x57wqsc8mad3yn0xayzz3qy";
};
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ zlib SDL readline libGLU libGL libX11 ];
configureFlags = [
"--target=default"
"--with-video=sdl"
"--with-sound=sdl"
"--with-readline"
"--with-opengl"
"--with-x"
"--enable-riodevice"
];
meta = {
homepage = "https://atari800.github.io/";
description = "An Atari 8-bit emulator";
longDescription = ''
Atari800 is the emulator of Atari 8-bit computer systems and
5200 game console for Unix, Linux, Amiga, MS-DOS, Atari
TT/Falcon, MS-Windows, MS WinCE, Sega Dreamcast, Android and
other systems supported by the SDL library.
'';
maintainers = [ maintainers.AndersonTorres ];
license = licenses.gpl2Plus;
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,33 @@
{ expat, fetchFromGitHub, ffmpeg, fontconfig, freetype, libarchive, libjpeg
, libGLU, libGL, openal, pkg-config, sfml, lib, stdenv, zlib
}:
stdenv.mkDerivation rec {
pname = "attract-mode";
version = "2.6.2";
src = fetchFromGitHub {
owner = "mickelson";
repo = "attract";
rev = "v${version}";
sha256 = "sha256-gKxUU2y6Gtm5a/tXYw/fsaTBrriNh5vouPGICs3Ph3c=";
};
nativeBuildInputs = [ pkg-config ];
patchPhase = ''
sed -i "s|prefix=/usr/local|prefix=$out|" Makefile
'';
buildInputs = [
expat ffmpeg fontconfig freetype libarchive libjpeg libGLU libGL openal sfml zlib
];
meta = with lib; {
description = "A frontend for arcade cabinets and media PCs";
homepage = "http://attractmode.org";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ hrdinka ];
platforms = with platforms; linux;
};
}

View file

@ -0,0 +1,28 @@
{ stdenv, lib, fetchFromGitHub, autoconf, automake, pkg-config, SDL2, gtk2 }:
stdenv.mkDerivation {
pname = "basiliskii";
version = "unstable-2022-04-05";
src = fetchFromGitHub {
owner = "kanjitalk755";
repo = "macemu";
rev = "d4baa318e49a29d7ea5fc71a637191d6c470546f";
sha256 = "jBKTC2fIPJ6mSkMABNxcd2ujXJ+duCXw291iz5ZmiVg=";
};
sourceRoot = "source/BasiliskII/src/Unix";
patches = [ ./remove-redhat-6-workaround-for-scsi-sg.h.patch ];
nativeBuildInputs = [ autoconf automake pkg-config ];
buildInputs = [ SDL2 gtk2 ];
preConfigure = ''
NO_CONFIGURE=1 ./autogen.sh
'';
configureFlags = [ "--enable-sdl-video" "--enable-sdl-audio" "--with-bincue" ];
meta = with lib; {
description = "68k Macintosh emulator";
homepage = "https://basilisk.cebix.net/";
license = licenses.gpl2;
maintainers = with maintainers; [ quag ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,10 @@
diff --git a/Linux/scsi_linux.cpp b/Linux/scsi_linux.cpp
--- a/Linux/scsi_linux.cpp
+++ b/Linux/scsi_linux.cpp
@@ -22,5 +22,5 @@
#include <sys/ioctl.h>
#include <linux/param.h>
-#include <linux/../scsi/sg.h> // workaround for broken RedHat 6.0 /usr/include/scsi
+#include <scsi/sg.h>
#include <unistd.h>
#include <errno.h>

View file

@ -0,0 +1,136 @@
{ lib
, stdenv
, fetchurl
, SDL2
, curl
, docbook_xml_dtd_45
, docbook_xsl
, gtk2
, libGL
, libGLU
, libX11
, libXpm
, libtool
, ncurses
, pkg-config
, readline
, wget
, wxGTK
}:
stdenv.mkDerivation rec {
pname = "bochs";
version = "2.7";
src = fetchurl {
url = "mirror://sourceforge/project/${pname}/${pname}/${version}/${pname}-${version}.tar.gz";
hash = "sha256-oBCrG/3HKsWgjS4kEs1HHA/r1mrx2TSbwNeWh53lsXo=";
};
nativeBuildInputs = [
docbook_xml_dtd_45
docbook_xsl
libtool
pkg-config
];
buildInputs = [
SDL2
curl
gtk2
libGL
libGLU
libX11
libXpm
ncurses
readline
wget
wxGTK
];
configureFlags = [
"--with-x=yes"
"--with-x11=yes"
"--with-rfb=no"
"--with-vncsrv=no"
"--with-nogui"
# These will always be "yes" on NixOS
"--enable-ltdl-install=yes"
"--enable-readline=yes"
"--enable-all-optimizations=yes"
"--enable-logging=yes"
"--enable-xpm=yes"
# ... whereas these, always "no"!
"--enable-cpp=no"
"--enable-instrumentation=no"
"--enable-docbook=no" # Broken - it requires docbook2html
# Dangerous options - they are marked as "incomplete/experimental" on Bochs documentation
"--enable-3dnow=no"
"--enable-monitor-mwait=no"
"--enable-raw-serial=no"
# These are completely configurable, and they don't depend of external tools
"--enable-a20-pin"
"--enable-avx"
"--enable-busmouse"
"--enable-cdrom"
"--enable-clgd54xx"
"--enable-configurable-msrs"
"--enable-cpu-level=6" # from 3 to 6
"--enable-debugger" #conflicts with gdb-stub option
"--enable-debugger-gui"
"--enable-e1000"
"--enable-es1370"
"--enable-evex"
"--enable-fpu"
"--enable-gdb-stub=no" # conflicts with debugger option
"--enable-handlers-chaining"
"--enable-idle-hack"
"--enable-iodebug"
"--enable-large-ramfile"
"--enable-largefile"
"--enable-ne2000"
"--enable-pci"
"--enable-plugins=yes"
"--enable-pnic"
"--enable-repeat-speedups"
"--enable-sb16"
"--enable-show-ips"
"--enable-smp"
"--enable-vmx=2"
"--enable-svm"
"--enable-trace-linking"
"--enable-usb"
"--enable-usb-ehci"
"--enable-usb-ohci"
"--enable-usb-xhci"
"--enable-voodoo"
"--enable-x86-64"
"--enable-x86-debugger"
]
# Boolean flags
++ lib.optionals (SDL2 != null) [ "--with-sdl2" ]
++ lib.optionals (ncurses != null) [ "--with-term" ]
++ lib.optionals (gtk2 != null && wxGTK != null) [ "--with-wx" ];
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://bochs.sourceforge.io/";
description = "An open-source IA-32 (x86) PC emulator";
longDescription = ''
Bochs is an open-source (LGPL), highly portable IA-32 PC emulator, written
in C++, that runs on most popular platforms. It includes emulation of the
Intel x86 CPU, common I/O devices, and a custom BIOS.
'';
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
};
}
# TODO: a better way to organize the options
# TODO: docbook (docbook-tools from RedHat mirrors should help)

View file

@ -0,0 +1,66 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, python3
}:
stdenv.mkDerivation rec {
pname = "box64";
version = "0.1.8";
src = fetchFromGitHub {
owner = "ptitSeb";
repo = pname;
rev = "v${version}";
hash = "sha256-6k8Enbafnj19ATtgmw8W7LxtRpM3Ousj1bpZbbtq8TM=";
};
nativeBuildInputs = [
cmake
python3
];
cmakeFlags = [
"-DNOGIT=1"
] ++ (
if stdenv.hostPlatform.system == "aarch64-linux" then
[
"-DARM_DYNAREC=ON"
]
else [
"-DLD80BITS=1"
"-DNOALIGN=1"
]
);
installPhase = ''
runHook preInstall
install -Dm 0755 box64 "$out/bin/box64"
runHook postInstall
'';
doCheck = true;
checkPhase = ''
runHook preCheck
ctest
runHook postCheck
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/box64 -v
runHook postInstallCheck
'';
meta = with lib; {
homepage = "https://box86.org/";
description = "Lets you run x86_64 Linux programs on non-x86_64 Linux systems";
license = licenses.mit;
maintainers = with maintainers; [ gador ];
platforms = [ "x86_64-linux" "aarch64-linux" ];
};
}

View file

@ -0,0 +1,75 @@
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, wrapGAppsHook
, SDL2
, alsa-lib
, gtk3
, gtksourceview3
, libGL
, libGLU
, libX11
, libXv
, libao
, libpulseaudio
, openal
, udev
}:
stdenv.mkDerivation rec {
pname = "ares";
version = "128";
src = fetchFromGitHub {
owner = "ares-emulator";
repo = "ares";
rev = "v${version}";
sha256 = "sha256-Ojf1kyColBK0S3DwXjGaAZSl0ljhgiXkfKC11BL2fEc=";
};
patches = [
./dont-rebuild-on-install.patch
./fix-ruby.patch
];
nativeBuildInputs = [
pkg-config
wrapGAppsHook
];
buildInputs = [
SDL2
alsa-lib
gtk3
gtksourceview3
libGL
libGLU
libX11
libXv
libao
libpulseaudio
openal
udev
];
enableParallelBuilding = true;
makeFlags = [
"-C desktop-ui"
"local=false"
"openmp=true"
"hiro=gtk3"
"prefix=$(out)"
];
meta = with lib; {
homepage = "https://ares.dev";
description = "Open-source multi-system emulator with a focus on accuracy and preservation";
license = licenses.isc;
maintainers = with maintainers; [ Madouura ];
platforms = platforms.linux;
};
}
# TODO: select between Qt, GTK2 and GTK3
# TODO: support Darwin

View file

@ -0,0 +1,22 @@
From 65cc7647110edd768e7baa7991143014316e655a Mon Sep 17 00:00:00 2001
From: Madoura <93990818+Madouura@users.noreply.github.com>
Date: Mon, 9 May 2022 10:17:06 -0500
Subject: [PATCH] Update GNUmakefile
---
desktop-ui/GNUmakefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/desktop-ui/GNUmakefile b/desktop-ui/GNUmakefile
index 8e27b11d3..0bee561fb 100644
--- a/desktop-ui/GNUmakefile
+++ b/desktop-ui/GNUmakefile
@@ -106,7 +106,7 @@ endif
$(call rdelete,$(object.path))
$(call rdelete,$(output.path))
-install: all
+install:
ifeq ($(platform),windows)
$(call mkdir,$(prefix)/$(name)/)
else ifeq ($(shell id -un),root)

View file

@ -0,0 +1,27 @@
diff --git a/ruby/GNUmakefile b/ruby/GNUmakefile
index e85a51701..7fca89e0f 100644
--- a/ruby/GNUmakefile
+++ b/ruby/GNUmakefile
@@ -8,19 +8,9 @@ ifeq ($(ruby),)
ruby += audio.openal
ruby += input.quartz #input.carbon
else ifeq ($(platform),linux)
- pkg_check1 = $(if $(shell test -e /usr/lib/lib$1.so && echo 1),$2)
- pkg_check2 = $(if $(shell test -e /usr/lib/$(shell uname -m)-linux-gnu/lib$1.so && echo 1),$2)
- pkg_check = $(call pkg_check1,$1,$2) $(call pkg_check2,$1,$2)
- ruby += video.glx video.glx2 video.xshm
- ruby += $(call pkg_check,Xv,video.xvideo)
- ruby += audio.oss audio.alsa
- ruby += $(call pkg_check,openal,audio.openal)
- ruby += $(call pkg_check,pulse,audio.pulseaudio)
- ruby += $(call pkg_check,pulse-simple,audio.pulseaudiosimple)
- ruby += $(call pkg_check,ao,audio.ao)
- ruby += input.xlib
- ruby += $(call pkg_check,udev,input.udev)
- ruby += $(call pkg_check,SDL2,input.sdl)
+ ruby += video.glx video.glx2 video.xshm video.xvideo
+ ruby += audio.oss audio.alsa audio.openal audio.pulseaudio audio.pulseaudiosimple audio.ao
+ ruby += input.xlib input.udev input.sdl
else ifeq ($(platform),bsd)
pkg_check = $(if $(shell test -e /usr/local/lib/lib$1.so && echo 1),$2)
ruby += video.glx video.glx2 video.xshm

View file

@ -0,0 +1,67 @@
{ lib, stdenv, fetchFromGitHub
, pkg-config
, wrapGAppsHook
, libX11, libXv
, udev
, SDL2
, gtk3, gtksourceview3
, alsa-lib, libao, openal, libpulseaudio
, libicns, Cocoa, OpenAL
}:
stdenv.mkDerivation {
pname = "bsnes-hd";
version = "10.6-beta";
src = fetchFromGitHub {
owner = "DerKoun";
repo = "bsnes-hd";
rev = "beta_10_6";
sha256 = "0f3cd89fd0lqskzj98cc1pzmdbscq0psdjckp86w94rbchx7iw4h";
};
patches = [
# Replace invocation of `sips` with an equivalent invocation of `png2icns`
# while assembling the .app directory hierarchy in the macos build. The
# `sips` executable isn't in our environment during the build, but
# `png2icns` is available by way of the dependency on libicns.
./macos-replace-sips-with-png2icns.patch
# During `make install` on macos the Makefile wants to move the .app into
# the current user's home directory. This patches the Makefile such that
# the .app ends up in $(prefix)/Applications. The $(prefix) variable will
# be set to $out, so this will result in the .app ending up in the
# Applications directory in the current nix profile.
./macos-copy-app-to-prefix.patch
];
nativeBuildInputs = [ pkg-config wrapGAppsHook ]
++ lib.optionals stdenv.isDarwin [ libicns ];
buildInputs = [ SDL2 libao ]
++ lib.optionals stdenv.isLinux [ libX11 libXv udev gtk3 gtksourceview3 alsa-lib openal libpulseaudio ]
++ lib.optionals stdenv.isDarwin [ Cocoa OpenAL ];
enableParallelBuilding = true;
makeFlags = [ "-C" "bsnes" "hiro=gtk3" "prefix=$(out)" ];
# https://github.com/bsnes-emu/bsnes/issues/107
preFixup = ''
gappsWrapperArgs+=(
--prefix GDK_BACKEND : x11
)
'';
meta = with lib; {
description = "A fork of bsnes that adds HD video features";
homepage = "https://github.com/DerKoun/bsnes-hd";
license = licenses.gpl3Only;
maintainers = with maintainers; [ stevebob ];
platforms = platforms.unix;
# ../nall/traits.hpp:19:14: error: no member named 'is_floating_point_v' in namespace 'std'; did you mean 'is_floating_point'?
# using std::is_floating_point_v;
broken = (stdenv.isDarwin && stdenv.isx86_64);
mainProgram = "bsnes";
};
}

View file

@ -0,0 +1,18 @@
diff --git a/bsnes/target-bsnes/GNUmakefile b/bsnes/target-bsnes/GNUmakefile
index 7a3ab9f..ec8a1a4 100644
--- a/bsnes/target-bsnes/GNUmakefile
+++ b/bsnes/target-bsnes/GNUmakefile
@@ -43,11 +43,8 @@ ifeq ($(platform),windows)
else ifeq ($(shell id -un),root)
$(error "make install should not be run as root")
else ifeq ($(platform),macos)
- mkdir -p ~/Library/Application\ Support/$(name)/
- mkdir -p ~/Library/Application\ Support/$(name)/Database/
- mkdir -p ~/Library/Application\ Support/$(name)/Firmware/
- mkdir -p ~/Library/Application\ Support/$(name)/Shaders/
- cp -R out/$(name).app /Applications/$(name).app
+ mkdir -p $(prefix)/Applications
+ cp -R out/$(name).app $(prefix)/Applications
else ifneq ($(filter $(platform),linux bsd),)
mkdir -p $(prefix)/bin/
mkdir -p $(prefix)/share/applications/

View file

@ -0,0 +1,13 @@
diff --git a/bsnes/target-bsnes/GNUmakefile b/bsnes/target-bsnes/GNUmakefile
index 4c67bde..7a3ab9f 100644
--- a/bsnes/target-bsnes/GNUmakefile
+++ b/bsnes/target-bsnes/GNUmakefile
@@ -33,7 +33,7 @@ ifeq ($(platform),macos)
cp Database/* out/$(name).app/Contents/MacOS/Database/
cp -r ../shaders/* out/$(name).app/Contents/macOS/Shaders/
cp $(ui)/resource/$(name).plist out/$(name).app/Contents/Info.plist
- sips -s format icns $(ui)/resource/$(name).png --out out/$(name).app/Contents/Resources/$(name).icns
+ png2icns out/$(name).app/Contents/Resources/$(name).icns $(ui)/resource/$(name).png
endif
verbose: hiro.verbose ruby.verbose nall.verbose all;

View file

@ -0,0 +1,8 @@
diff -Naur source-old/higan/fc/ppu/ppu.cpp source-new/higan/fc/ppu/ppu.cpp
--- source-old/higan/fc/ppu/ppu.cpp 1969-12-31 21:00:01.000000000 -0300
+++ source-new/higan/fc/ppu/ppu.cpp 2021-09-29 22:23:19.107527772 -0300
@@ -1,3 +1,4 @@
+#include <cmath>
#include <fc/fc.hpp>
namespace higan::Famicom {

View file

@ -0,0 +1,24 @@
diff -Naur source-old/higan-ui/GNUmakefile source-new/higan-ui/GNUmakefile
--- source-old/higan-ui/GNUmakefile 1969-12-31 21:00:01.000000000 -0300
+++ source-new/higan-ui/GNUmakefile 2021-09-29 22:35:35.744721052 -0300
@@ -61,7 +61,7 @@
mkdir -p $(output.path)/$(name).app/Contents/Resources/
mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name)
cp resource/$(name).plist $(output.path)/$(name).app/Contents/Info.plist
- sips -s format icns resource/$(name).png --out $(output.path)/$(name).app/Contents/Resources/$(name).icns
+ png2icns $(output.path)/$(name).app/Contents/Resources/$(name).icns resource/$(name).png
endif
verbose: nall.verbose ruby.verbose hiro.verbose all;
diff -Naur source-old/icarus/GNUmakefile source-new/icarus/GNUmakefile
--- source-old/icarus/GNUmakefile 1969-12-31 21:00:01.000000000 -0300
+++ source-new/icarus/GNUmakefile 2021-09-29 22:35:53.639846113 -0300
@@ -26,7 +26,7 @@
mkdir -p $(output.path)/$(name).app/Contents/Resources/
mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name)
cp resource/$(name).plist $(output.path)/$(name).app/Contents/Info.plist
- sips -s format icns resource/$(name).png --out $(output.path)/$(name).app/Contents/Resources/$(name).icns
+ png2icns $(output.path)/$(name).app/Contents/Resources/$(name).icns resource/$(name).png
endif
verbose: hiro.verbose nall.verbose all;

View file

@ -0,0 +1,155 @@
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, alsa-lib
, gtk3
, gtksourceview3
, libGL
, libGLU
, libX11
, libXv
, libao
, libpulseaudio
, openal
, pkg-config
, runtimeShell
, udev
# Darwin dependencies
, libicns
, darwin
}:
stdenv.mkDerivation rec {
pname = "higan";
version = "115+unstable=2021-08-18";
src = fetchFromGitHub {
owner = "higan-emu";
repo = "higan";
rev = "9bf1b3314b2bcc73cbc11d344b369c31562aff10";
hash = "sha256-HZItJ97x20OjFKv2OVbMja7g+c1ZXcgcaC/XDe3vMZM=";
};
nativeBuildInputs = [
pkg-config
] ++ lib.optionals stdenv.isDarwin [
libicns
];
buildInputs = [
SDL2
libao
] ++ lib.optionals stdenv.isLinux [
alsa-lib
gtk3
gtksourceview3
libGL
libGLU
libX11
libXv
libpulseaudio
openal
udev
]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
Carbon
Cocoa
OpenAL
OpenGL
]);
patches = [
# Includes cmath header
./001-include-cmath.patch
# Uses png2icns instead of sips
./002-sips-to-png2icns.patch
];
dontConfigure = true;
enableParallelBuilding = true;
buildPhase = ''
runHook preBuild
make -j $NIX_BUILD_CORES compiler=${stdenv.cc.targetPrefix}c++ \
platform=linux openmp=true hiro=gtk3 build=accuracy local=false \
cores="cv fc gb gba md ms msx ngp pce sfc sg ws" -C higan-ui
make -j $NIX_BUILD_CORES compiler=${stdenv.cc.targetPrefix}c++ \
platform=linux openmp=true hiro=gtk3 -C icarus
runHook postBuild
'';
installPhase = ''
runHook preInstall
'' + (if stdenv.isDarwin then ''
mkdir ${placeholder "out"}
mv higan/out/higan.app ${placeholder "out"}/
mv icarus/out/icarus.app ${placeholder "out"}/
'' else ''
install -d ${placeholder "out"}/bin
install higan-ui/out/higan -t ${placeholder "out"}/bin/
install icarus/out/icarus -t ${placeholder "out"}/bin/
install -d ${placeholder "out"}/share/applications
install higan-ui/resource/higan.desktop -t ${placeholder "out"}/share/applications/
install icarus/resource/icarus.desktop -t ${placeholder "out"}/share/applications/
install -d ${placeholder "out"}/share/pixmaps
install higan/higan/resource/higan.svg ${placeholder "out"}/share/pixmaps/higan-icon.svg
install higan/higan/resource/logo.png ${placeholder "out"}/share/pixmaps/higan-icon.png
install icarus/resource/icarus.svg ${placeholder "out"}/share/pixmaps/icarus-icon.svg
install icarus/resource/icarus.png ${placeholder "out"}/share/pixmaps/icarus-icon.png
'') + ''
install -d ${placeholder "out"}/share/higan
cp -rd extras/ higan/System/ ${placeholder "out"}/share/higan/
install -d ${placeholder "out"}/share/icarus
cp -rd icarus/Database icarus/Firmware ${placeholder "out"}/share/icarus/
'' + (
# A dirty workaround, suggested by @cpages:
# we create a first-run script to populate
# $HOME with all the stuff needed at runtime
let
dest = if stdenv.isDarwin
then "\\$HOME/Library/Application Support/higan"
else "\\$HOME/higan";
in ''
mkdir -p ${placeholder "out"}/bin
cat <<EOF > ${placeholder "out"}/bin/higan-init.sh
#!${runtimeShell}
cp --recursive --update ${placeholder "out"}/share/higan/System/ "${dest}"/
EOF
chmod +x ${placeholder "out"}/bin/higan-init.sh
'') + ''
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/higan-emu/higan";
description = "An open-source, cycle-accurate multi-system emulator";
longDescription = ''
higan is a multi-system emulator, originally developed by Near, with an
uncompromising focus on accuracy and code readability.
It currently emulates the following systems: Famicom, Famicom Disk System,
Super Famicom, Super Game Boy, Game Boy, Game Boy Color, Game Boy Advance,
Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive,
Mega CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket,
Neo Geo Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket
Challenge V2.
'';
license = licenses.gpl3Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
broken = stdenv.isDarwin;
};
}
# TODO: select between Qt, GTK2 and GTK3

View file

@ -0,0 +1,52 @@
{ lib, stdenv, fetchFromGitHub, desktop-file-utils, libpng
, pkg-config, SDL, freetype, zlib }:
stdenv.mkDerivation rec {
pname = "caprice32";
version = "4.6.0";
# NOTE: When bumping version beyond 4.6.0, you likely need to remove
# string.patch below. The fix of this patch has already been
# done upstream but is not yet part of a release
src = fetchFromGitHub {
repo = "caprice32";
rev = "v${version}";
owner = "ColinPitrat";
sha256 = "0hng5krwgc1h9bz1xlkp2hwnvas965nd7sb3z9mb2m6x9ghxlacz";
};
nativeBuildInputs = [ desktop-file-utils pkg-config ];
buildInputs = [ libpng SDL freetype zlib ];
patches = [ ./string.patch ];
makeFlags = [
"APP_PATH=${placeholder "out"}/share/caprice32"
"RELEASE=1"
"DESTDIR=${placeholder "out"}"
"prefix=/"
];
postInstall = ''
mkdir -p $out/share/icons/
mv $out/share/caprice32/resources/freedesktop/caprice32.png $out/share/icons/
mv $out/share/caprice32/resources/freedesktop/emulators.png $out/share/icons/
desktop-file-install --dir $out/share/applications \
$out/share/caprice32/resources/freedesktop/caprice32.desktop
desktop-file-install --dir $out/share/desktop-directories \
$out/share/caprice32/resources/freedesktop/Emulators.directory
install -Dm644 $out/share/caprice32/resources/freedesktop/caprice32.menu -t $out/etc/xdg/menus/applications-merged/
'';
meta = with lib; {
description = "A complete emulation of CPC464, CPC664 and CPC6128";
homepage = "https://github.com/ColinPitrat/caprice32";
license = licenses.gpl2;
maintainers = [ ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,12 @@
diff --git a/src/configuration.h b/src/configuration.h
index 34fd690..97fb0e5 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -2,6 +2,7 @@
#define CONFIGURATION_H
#include <map>
+#include <string>
namespace config
{

View file

@ -0,0 +1,68 @@
{ lib, stdenv, fetchurl, makeDesktopItem, makeWrapper, jre
, useCCTweaked ? true
}:
let
version = "1.1.1";
rev = "af12e2e4da586275ba931eae8f40a2201251bf59";
baseUrl = "https://emux.cc/versions/${lib.substring 0 8 rev}/CCEmuX";
jar =
if useCCTweaked
then fetchurl {
url = "${baseUrl}-cct.jar";
sha256 = "0d9gzi1h5vz32fp4lfn7dam189jcm7bwbqwmlpj0c47p8l0d4lsv";
}
else fetchurl {
url = "${baseUrl}-cc.jar";
sha256 = "0ky5vxh8m1v98zllifxif8xxd25j2xdp19hjnj4xlkck71lbnb34";
};
desktopIcon = fetchurl {
url = "https://github.com/CCEmuX/CCEmuX/raw/${rev}/src/main/resources/img/icon.png";
sha256 = "1vmb6rg9k2y99j8xqfgbsvfgfi3g985rmqwrd7w3y54ffr2r99c2";
};
desktopItem = makeDesktopItem {
name = "CCEmuX";
exec = "ccemux";
icon = desktopIcon;
comment = "A modular ComputerCraft emulator";
desktopName = "CCEmuX";
genericName = "ComputerCraft Emulator";
categories = [ "Emulator" ];
};
in
stdenv.mkDerivation rec {
pname = "ccemux";
inherit version;
src = jar;
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,share/ccemux}
cp -r ${desktopItem}/share/applications $out/share/applications
install -D ${src} $out/share/ccemux/ccemux.jar
install -D ${desktopIcon} $out/share/pixmaps/ccemux.png
makeWrapper ${jre}/bin/java $out/bin/ccemux \
--add-flags "-jar $out/share/ccemux/ccemux.jar"
runHook postInstall
'';
meta = with lib; {
description = "A modular ComputerCraft emulator";
homepage = "https://github.com/CCEmuX/CCEmuX";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.mit;
maintainers = with maintainers; [ CrazedProgrammer ];
};
}

View file

@ -0,0 +1,21 @@
{ callPackage, makeWrapper, gobject-introspection, cmake
, python3Packages, gtk3, glib, libxml2, gnuplot, gnome, gdk-pixbuf, librsvg, intltool, libmirage }:
let pkg = import ./base.nix {
version = "3.2.5";
pname = "image-analyzer";
pkgSha256 = "00906lky0z1m0bdqnjmzxgcb19dzvljhddhh42lixyr53sjp94cc";
};
in callPackage pkg {
buildInputs = [ glib gtk3 libxml2 gnuplot libmirage makeWrapper
gnome.adwaita-icon-theme gdk-pixbuf librsvg intltool
python3Packages.python python3Packages.pygobject3 python3Packages.matplotlib ];
drvParams = {
nativeBuildInputs = [ gobject-introspection cmake ];
postFixup = ''
wrapProgram $out/bin/image-analyzer \
--set PYTHONPATH "$PYTHONPATH" \
--set GI_TYPELIB_PATH "$GI_TYPELIB_PATH" \
--prefix XDG_DATA_DIRS : "$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
'';
};
}

View file

@ -0,0 +1,36 @@
{ pname, version, pkgSha256 }:
{ lib, stdenv, fetchurl, cmake, pkg-config, buildInputs, drvParams ? {} }:
stdenv.mkDerivation ( rec {
inherit pname version buildInputs;
src = fetchurl {
url = "mirror://sourceforge/cdemu/${pname}-${version}.tar.xz";
sha256 = pkgSha256;
};
nativeBuildInputs = [ pkg-config cmake ];
setSourceRoot = ''
mkdir build
cd build
sourceRoot="`pwd`"
'';
configurePhase = ''
cmake ../${pname}-${version} -DCMAKE_INSTALL_PREFIX=$out -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_RPATH=ON
'';
meta = with lib; {
description = "A suite of tools for emulating optical drives and discs";
longDescription = ''
CDEmu consists of:
- a kernel module implementing a virtual drive-controller
- libmirage which is a software library for interpreting optical disc images
- a daemon which emulates the functionality of an optical drive+disc
- textmode and GTK clients for controlling the emulator
- an image analyzer to view the structure of image files
Optical media emulated by CDemu can be mounted within Linux. Automounting is also allowed.
'';
homepage = "https://cdemu.sourceforge.io/";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with lib.maintainers; [ bendlas ];
};
} // drvParams)

View file

@ -0,0 +1,16 @@
{ callPackage, python3Packages, intltool, makeWrapper }:
let pkg = import ./base.nix {
version = "3.2.5";
pname = "cdemu-client";
pkgSha256 = "1prrdhv0ia0axc6b73crszqzh802wlkihz6d100yvg7wbgmqabd7";
};
in callPackage pkg {
buildInputs = [ python3Packages.python python3Packages.dbus-python python3Packages.pygobject3
intltool makeWrapper ];
drvParams = {
postFixup = ''
wrapProgram $out/bin/cdemu \
--set PYTHONPATH "$PYTHONPATH"
'';
};
}

View file

@ -0,0 +1,9 @@
{ callPackage, glib, libao, intltool, libmirage }:
let pkg = import ./base.nix {
version = "3.2.5";
pname = "cdemu-daemon";
pkgSha256 = "16g6fv1lxkdmbsy6zh5sj54dvgwvm900fd18aq609yg8jnqm644d";
};
in callPackage pkg {
buildInputs = [ glib libao libmirage intltool ];
}

View file

@ -0,0 +1,23 @@
{ callPackage, makeWrapper, gobject-introspection, cmake
, python3Packages, gtk3, glib, libnotify, intltool, gnome, gdk-pixbuf, librsvg }:
let
pkg = import ./base.nix {
version = "3.2.5";
pname = "gcdemu";
pkgSha256 = "1nvpbq4mz8caw91q5ny9gf206g9bypavxws9nxyfcanfkc4zfkl4";
};
inherit (python3Packages) python pygobject3;
in callPackage pkg {
buildInputs = [ python pygobject3 gtk3 glib libnotify intltool makeWrapper
gnome.adwaita-icon-theme gdk-pixbuf librsvg ];
drvParams = {
nativeBuildInputs = [ gobject-introspection cmake ];
postFixup = ''
wrapProgram $out/bin/gcdemu \
--set PYTHONPATH "$PYTHONPATH" \
--set GI_TYPELIB_PATH "$GI_TYPELIB_PATH" \
--prefix XDG_DATA_DIRS : "$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
'';
# TODO AppIndicator
};
}

View file

@ -0,0 +1,18 @@
{ callPackage, gobject-introspection, cmake, pkg-config
, glib, libsndfile, zlib, bzip2, xz, libsamplerate, intltool
, pcre, util-linux, libselinux, libsepol }:
let pkg = import ./base.nix {
version = "3.2.5";
pname = "libmirage";
pkgSha256 = "0f8i2ha44rykkk3ac2q8zsw3y1zckw6qnf6zvkyrj3qqbzhrf3fm";
};
in callPackage pkg {
buildInputs = [ glib libsndfile zlib bzip2 xz libsamplerate intltool ];
drvParams = {
PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "out"}/share/gir-1.0";
PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "${placeholder "out"}/lib/girepository-1.0";
nativeBuildInputs = [ cmake gobject-introspection pkg-config ];
propagatedBuildInputs = [ pcre util-linux libselinux libsepol ];
};
}

View file

@ -0,0 +1,22 @@
{ lib, stdenv, fetchurl, kernel }:
stdenv.mkDerivation rec {
pname = "vhba";
version = "20211218";
src = fetchurl {
url = "mirror://sourceforge/cdemu/vhba-module-${version}.tar.xz";
sha256 = "sha256-csWowcRSgF5M74yv787MLSXOGXrkxnODCCgC5a3Nd7Y=";
};
makeFlags = kernel.makeFlags ++ [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=$(out)" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
meta = with lib; {
description = "Provides a Virtual (SCSI) HBA";
homepage = "https://cdemu.sourceforge.io/about/vhba/";
platforms = platforms.linux;
license = licenses.gpl2Plus;
maintainers = with lib.maintainers; [ bendlas ];
};
}

View file

@ -0,0 +1,30 @@
{ lib, cmake, fetchFromGitHub, libGL, libiconv, libX11, openal, stdenv }:
stdenv.mkDerivation rec {
pname = "cen64";
version = "unstable-2021-03-12";
src = fetchFromGitHub {
owner = "n64dev";
repo = "cen64";
rev = "1b31ca9b3c3bb783391ab9773bd26c50db2056a8";
sha256 = "0x1fz3z4ffl5xssiyxnmbhpjlf0k0fxsqn4f2ikrn17742dx4c0z";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ libGL libiconv openal libX11 ];
installPhase = ''
runHook preInstall
install -D {,$out/bin/}${pname}
runHook postInstall
'';
meta = with lib; {
description = "A Cycle-Accurate Nintendo 64 Emulator";
license = licenses.bsd3;
homepage = "https://github.com/n64dev/cen64";
maintainers = [ maintainers._414owen ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -0,0 +1,45 @@
{ branch
, libsForQt5
, fetchFromGitHub
, fetchurl
}:
let
# Fetched from https://api.citra-emu.org/gamedb, last updated 2022-05-02
# Please make sure to update this when updating citra!
compat-list = fetchurl {
name = "citra-compat-list";
url = "https://web.archive.org/web/20220502114622/https://api.citra-emu.org/gamedb/";
sha256 = "sha256-blIlaYaUQjw7Azgg+Dd7ZPEQf+ddZMO++Yxinwe+VG0=";
};
in {
nightly = libsForQt5.callPackage ./generic.nix rec {
pname = "citra-nightly";
version = "1765";
src = fetchFromGitHub {
owner = "citra-emu";
repo = "citra-nightly";
rev = "nightly-${version}";
sha256 = "0d3dfh63cmsy5idbypdz3ibydmb4a35sfv7qmxxlcpc390pp9cvq";
fetchSubmodules = true;
};
inherit branch compat-list;
};
canary = libsForQt5.callPackage ./generic.nix rec {
pname = "citra-canary";
version = "2146";
src = fetchFromGitHub {
owner = "citra-emu";
repo = "citra-canary";
rev = "canary-${version}";
sha256 = "1wnym0nklngimf5gaaa2703nz4g5iy572wlgp88h67rrh9b4f04r";
fetchSubmodules = true;
};
inherit branch compat-list;
};
}.${branch}

View file

@ -0,0 +1,108 @@
{ pname
, version
, src
, branch
, compat-list
, lib
, stdenv
, fetchFromGitHub
, cmake
, boost17x
, pkg-config
, libusb1
, zstd
, libressl
, enableSdl2 ? true, SDL2
, enableQt ? true, qtbase, qtmultimedia, wrapQtAppsHook
, enableQtTranslation ? enableQt, qttools
, enableWebService ? true
, enableCubeb ? true, libpulseaudio
, enableFfmpegAudioDecoder ? true
, enableFfmpegVideoDumper ? true
, ffmpeg
, useDiscordRichPresence ? true, rapidjson
, enableFdk ? false, fdk_aac
}:
assert lib.assertMsg (!enableFfmpegAudioDecoder || !enableFdk) "Can't enable both enableFfmpegAudioDecoder and enableFdk";
stdenv.mkDerivation rec {
inherit pname version src;
nativeBuildInputs = [
cmake
pkg-config
] ++ lib.optionals enableQt [ wrapQtAppsHook ];
buildInputs = [
boost17x
libusb1
] ++ lib.optionals enableQt [ qtbase qtmultimedia ]
++ lib.optional enableSdl2 SDL2
++ lib.optional enableQtTranslation qttools
++ lib.optional enableCubeb libpulseaudio
++ lib.optional (enableFfmpegAudioDecoder || enableFfmpegVideoDumper) ffmpeg
++ lib.optional useDiscordRichPresence rapidjson
++ lib.optional enableFdk fdk_aac;
cmakeFlags = [
"-DUSE_SYSTEM_BOOST=ON"
"-DCITRA_USE_BUNDLED_FFMPEG=OFF"
"-DCITRA_USE_BUNDLED_QT=OFF"
"-DCITRA_USE_BUNDLED_SDL2=OFF"
# We dont want to bother upstream with potentially outdated compat reports
"-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON"
"-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF" # We provide this deterministically
] ++ lib.optional (!enableSdl2) "-DENABLE_SDL2=OFF"
++ lib.optional (!enableQt) "-DENABLE_QT=OFF"
++ lib.optional enableQtTranslation "-DENABLE_QT_TRANSLATION=ON"
++ lib.optional (!enableWebService) "-DENABLE_WEB_SERVICE=OFF"
++ lib.optional (!enableCubeb) "-DENABLE_CUBEB=OFF"
++ lib.optional enableFfmpegAudioDecoder "-DENABLE_FFMPEG_AUDIO_DECODER=ON"
++ lib.optional enableFfmpegVideoDumper "-DENABLE_FFMPEG_VIDEO_DUMPER=ON"
++ lib.optional useDiscordRichPresence "-DUSE_DISCORD_PRESENCE=ON"
++ lib.optional enableFdk "-DENABLE_FDK=ON";
postPatch = ''
# Prep compatibilitylist
ln -s ${compat-list} ./dist/compatibility_list/compatibility_list.json
# We already know the submodules are present
substituteInPlace CMakeLists.txt \
--replace "check_submodules_present()" ""
# Devendoring
rm -rf externals/zstd externals/libressl
cp -r ${zstd.src} externals/zstd
tar xf ${libressl.src} -C externals/
mv externals/${libressl.name} externals/libressl
chmod -R a+w externals/zstd
'';
# Fixes https://github.com/NixOS/nixpkgs/issues/171173
postInstall = lib.optionalString (enableCubeb && enableSdl2) ''
wrapProgram "$out/bin/citra" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpulseaudio ]}
'';
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64);
homepage = "https://citra-emu.org";
description = "The ${branch} branch of an open-source emulator for the Ninteno 3DS";
longDescription = ''
A Nintendo 3DS Emulator written in C++
Using the nightly branch is recommended for general usage.
Using the canary branch is recommended if you would like to try out
experimental features, with a cost of stability.
'';
mainProgram = if enableQt then "citra-qt" else "citra";
platforms = platforms.linux;
license = licenses.gpl2Plus;
maintainers = with maintainers; [
abbradar
ashley
ivar
];
};
}

View file

@ -0,0 +1,84 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p nix nix-prefetch-git coreutils curl jq gnused
set -euo pipefail
# Will be replaced with the actual branch when running this from passthru.updateScript
BRANCH="@branch@"
if [[ ! "$(basename $PWD)" = "citra" ]]; then
echo "error: Script must be ran from citra's directory!"
exit 1
fi
getLocalVersion() {
pushd ../../../.. >/dev/null
nix eval --raw -f default.nix "$1".version
popd >/dev/null
}
getLocalHash() {
pushd ../../../.. >/dev/null
nix eval --raw -f default.nix "$1".src.drvAttrs.outputHash
popd >/dev/null
}
updateNightly() {
OLD_NIGHTLY_VERSION="$(getLocalVersion "citra-nightly")"
OLD_NIGHTLY_HASH="$(getLocalHash "citra-nightly")"
NEW_NIGHTLY_VERSION="$(curl -s ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
"https://api.github.com/repos/citra-emu/citra-nightly/releases?per_page=1" | jq -r '.[0].name' | cut -d"-" -f2 | cut -d" " -f2)"
if [[ "${OLD_NIGHTLY_VERSION}" = "${NEW_NIGHTLY_VERSION}" ]]; then
echo "citra-nightly is already up to date!"
[ "$KEEP_GOING" ] && return || exit
else
echo "citra-nightly: ${OLD_NIGHTLY_VERSION} -> ${NEW_NIGHTLY_VERSION}"
fi
echo " Fetching source code..."
NEW_NIGHTLY_HASH="$(nix-prefetch-git --quiet --fetch-submodules --rev "nightly-${NEW_NIGHTLY_VERSION}" "https://github.com/citra-emu/citra-nightly" | jq -r '.sha256')"
echo " Succesfully fetched. hash: ${NEW_NIGHTLY_HASH}"
sed -i "s/${OLD_NIGHTLY_VERSION}/${NEW_NIGHTLY_VERSION}/" ./default.nix
sed -i "s/${OLD_NIGHTLY_HASH}/${NEW_NIGHTLY_HASH}/" ./default.nix
}
updateCanary() {
OLD_CANARY_VERSION="$(getLocalVersion "citra-canary")"
OLD_CANARY_HASH="$(getLocalHash "citra-canary")"
NEW_CANARY_VERSION="$(curl -s ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
"https://api.github.com/repos/citra-emu/citra-canary/releases?per_page=1" | jq -r '.[0].name' | cut -d"-" -f2 | cut -d" " -f1)"
if [[ "${OLD_CANARY_VERSION}" = "${NEW_CANARY_VERSION}" ]]; then
echo "citra-canary is already up to date!"
[ "$KEEP_GOING" ] && return || exit
else
echo "citra-canary: ${OLD_CANARY_VERSION} -> ${NEW_CANARY_VERSION}"
fi
echo " Fetching source code..."
NEW_CANARY_HASH="$(nix-prefetch-git --quiet --fetch-submodules --rev "canary-${NEW_CANARY_VERSION}" "https://github.com/citra-emu/citra-canary" | jq -r '.sha256')"
echo " Succesfully fetched. hash: ${NEW_CANARY_HASH}"
sed -i "s/${OLD_CANARY_VERSION}/${NEW_CANARY_VERSION}/" ./default.nix
sed -i "s/${OLD_CANARY_HASH}/${NEW_CANARY_HASH}/" ./default.nix
}
if [[ "$BRANCH" = "nightly" ]]; then
updateNightly
elif [[ "$BRANCH" = "early-access" ]]; then
updateCanary
else
KEEP_GOING=1
updateNightly
updateCanary
fi

View file

@ -0,0 +1,30 @@
{ lib, stdenv, fetchurl, ncurses }:
stdenv.mkDerivation rec {
pname = "collapseos-cvm";
version = "20220316";
src = fetchurl {
url = "http://collapseos.org/files/collapseos-${version}.tar.gz";
hash = "sha256-8bt6wj93T82K9fqtuC/mctkMCzfvW0taxv6QAKeJb5g=";
};
buildInputs = [ ncurses ];
sourceRoot = "cvm";
postPatch = ''
substituteInPlace common.mk \
--replace "-lcurses" "-lncurses"
'';
installPhase = ''
runHook preInstall;
find . -type f -executable -exec install -Dt $out/bin {} \;
runHook postInstall;
'';
meta = {
description = "Virtual machine for Collapse OS (Forth operating system)";
changelog = "http://collapseos.org/files/CHANGES.txt";
downloadPage = "http://collapseos.org/files/";
homepage = "http://collapseos.org/";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ ehmry ];
mainProgram = "cos-serial";
};
}

View file

@ -0,0 +1,45 @@
{ stdenv
, lib
, fetchFromGitHub
, SDL2
}:
stdenv.mkDerivation rec {
pname = "x16-emulator";
version = "40";
src = fetchFromGitHub {
owner = "commanderx16";
repo = pname;
rev = "r${version}";
hash = "sha256-7ZzVd2NJCFNAFrS2cj6bxcq/AzO5VakoFX9o1Ac9egg=";
};
dontConfigure = true;
buildInputs = [ SDL2 ];
installPhase = ''
runHook preInstall
install -Dm 755 -t $out/bin/ x16emu
install -Dm 444 -t $out/share/doc/${pname} README.md
runHook postInstall
'';
meta = with lib; {
description = "The official emulator of CommanderX16 8-bit computer";
homepage = "https://www.commanderx16.com/forum/index.php?/home/";
license = licenses.bsd2;
maintainers = with maintainers; [ AndersonTorres ];
mainProgram = "x16emu";
inherit (SDL2.meta) platforms;
};
passthru = {
# upstream project recommends emulator and rom synchronized;
# passing through the version is useful to ensure this
inherit version;
};
}

View file

@ -0,0 +1,52 @@
{ stdenv
, lib
, fetchFromGitHub
, cc65
, python3
}:
stdenv.mkDerivation rec {
pname = "x16-rom";
version = "40";
src = fetchFromGitHub {
owner = "commanderx16";
repo = pname;
rev = "r${version}";
hash = "sha256-5oqttuTJiJOUENncOJipAar22OsI1uG3G69m+eYoSh0=";
};
nativeBuildInputs = [
cc65
python3
];
postPatch = ''
patchShebangs scripts/
'';
dontConfigure = true;
installPhase = ''
runHook preInstall
install -Dm 444 -t $out/share/${pname} build/x16/rom.bin
install -Dm 444 -t $out/share/doc/${pname} README.md
runHook postInstall
'';
meta = with lib; {
homepage = "https://www.commanderx16.com/forum/index.php?/home/";
description = "ROM file for CommanderX16 8-bit computer";
license = licenses.bsd2;
maintainers = with maintainers; [ AndersonTorres ];
inherit (cc65.meta) platforms;
};
passthru = {
# upstream project recommends emulator and rom synchronized;
# passing through the version is useful to ensure this
inherit version;
};
}

View file

@ -0,0 +1,37 @@
{ runtimeShell
, symlinkJoin
, writeTextFile
}:
{ emulator, rom }:
assert emulator.version == rom.version;
let
runScript = writeTextFile {
name = "run-x16";
text = ''
#!${runtimeShell}
defaultRom="${rom}/share/x16-rom/rom.bin"
exec "${emulator}/bin/x16emu" -rom $defaultRom "$@"
'';
executable = true;
destination = "/bin/run-x16";
};
in
symlinkJoin {
name = "run-x16-${emulator.version}";
paths = [
emulator
rom
runScript
];
}
# TODO [ AndersonTorres ]:
# 1. Parse the command line in order to allow the user to set an optional
# rom-file
# 2. generate runScript based on symlinkJoin (maybe a postBuild?)

View file

@ -0,0 +1,43 @@
{ lib, stdenv, fetchFromGitHub, poco, openssl, SDL2, SDL2_mixer }:
let
craftos2-lua = fetchFromGitHub {
owner = "MCJack123";
repo = "craftos2-lua";
rev = "v2.4.4";
sha256 = "1q63ki4sxx8bxaa6ag3xj153p7a8a12ivm0k33k935p41k6y2k64";
};
in
stdenv.mkDerivation rec {
pname = "craftos-pc";
version = "2.4.5";
src = fetchFromGitHub {
owner = "MCJack123";
repo = "craftos2";
rev = "v${version}";
sha256 = "00a4p365krbdprlv4979d13mm3alhxgzzj3vqz2g67795plf64j4";
};
buildInputs = [ poco openssl SDL2 SDL2_mixer ];
preBuild = ''
cp -R ${craftos2-lua}/* ./craftos2-lua/
chmod -R u+w ./craftos2-lua
make -C craftos2-lua linux
'';
installPhase = ''
mkdir -p $out/bin
DESTDIR=$out/bin make install
'';
meta = with lib; {
description = "An implementation of the CraftOS-PC API written in C++ using SDL";
homepage = "https://www.craftos-pc.cc";
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ maintainers.siraben ];
};
}

View file

@ -0,0 +1,24 @@
{ lib, stdenv, fetchurl, libX11, libXt, libXext, libXaw }:
stdenv.mkDerivation rec {
pname = "darcnes";
version = "9b0401";
src = fetchurl {
url = "https://web.archive.org/web/20130511081532/http://www.dridus.com/~nyef/darcnes/download/dn${version}.tgz";
sha256 = "05a7mh51rg7ydb414m3p5mm05p4nz2bgvspqzwm3bhbj7zz543k3";
};
patches = [ ./label.patch ];
buildInputs = [ libX11 libXt libXext libXaw ];
installPhase = "install -Dt $out/bin darcnes";
meta = {
homepage = "https://web.archive.org/web/20130502171725/http://www.dridus.com/~nyef/darcnes/";
description = "Sega Master System, Game Gear, SG-1000, NES, ColecoVision and Apple II emulator";
# Prohibited commercial use, credit required.
license = lib.licenses.free;
platforms = [ "i686-linux" ];
};
}

View file

@ -0,0 +1,13 @@
http://gentoo-overlays.zugaina.org/funtoo/portage/games-emulation/darcnes/files/darcnes-0401-exec-stack.patch
diff -Naur old/video_x.c new/video_x.c
--- old/video_x.c 2004-09-04 01:26:41.102187277 +0200
+++ new/video_x.c 2004-09-04 01:27:51.586427427 +0200
@@ -366,6 +366,7 @@
}
default:
+ break;
}
}

View file

@ -0,0 +1,87 @@
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, agg
, alsa-lib
, desktop-file-utils
, gtk3
, intltool
, libGLU
, libXmu
, libpcap
, libtool
, lua
, meson
, ninja
, openal
, pkg-config
, soundtouch
, tinyxml
, zlib
}:
stdenv.mkDerivation rec {
pname = "desmume";
version = "0.9.11+unstable=2021-09-22";
src = fetchFromGitHub {
owner = "TASVideos";
repo = pname;
rev = "7fc2e4b6b6a58420de65a4089d4df3934d7a46b1";
hash = "sha256-sTCyjQ31w1Lp+aa3VQ7/rdLbhjnqthce54mjKJZQIDM=";
};
nativeBuildInputs = [
desktop-file-utils
intltool
libtool
lua
meson
ninja
pkg-config
];
buildInputs = [
SDL2
agg
alsa-lib
gtk3
libGLU
libXmu
libpcap
openal
soundtouch
tinyxml
zlib
];
hardeningDisable = [ "format" ];
preConfigure = ''
cd desmume/src/frontend/posix
'';
mesonFlags = [
"-Db_pie=true"
"-Dopenal=true"
"-Dwifi=true"
];
meta = with lib; {
homepage = "https://www.github.com/TASVideos/desmume/";
description = "An open-source Nintendo DS emulator";
longDescription = ''
DeSmuME is a freeware emulator for the NDS roms & Nintendo DS Lite games
created by YopYop156 and now maintained by the TASvideos team. It supports
many homebrew nds rom demoes as well as a handful of Wireless Multiboot
demo nds roms. DeSmuME is also able to emulate nearly all of the
commercial nds rom titles which other DS Emulators aren't.
'';
license = licenses.gpl2Plus;
maintainers = [ maintainers.AndersonTorres ];
platforms = platforms.unix;
};
}
# TODO: investigate the patches
# TODO: investigate other platforms

View file

@ -0,0 +1,71 @@
{ lib
, stdenv
, fetchurl
, libarchive
, SDL
}:
stdenv.mkDerivation rec {
pname = "dgen-sdl";
version = "1.33";
src = fetchurl {
url = "https://sourceforge.net/projects/dgen/files/dgen/${version}/${pname}-${version}.tar.gz";
hash = "sha256-meLAYBfCKHPHf4gYbrzAmGckTrbgQsdjuwlLArje9h4=";
};
buildInputs = [
SDL
libarchive
];
configureFlags = [
"--enable-debug-vdp"
"--enable-debugger"
"--enable-joystick"
"--enable-pico" # experimental
"--enable-vgmdump"
"--with-cyclone=no" # Needs ASM support
"--with-cz80"
"--with-drz80=no" # Needs ASM support
"--with-dz80"
"--with-musa"
"--with-mz80"
"--with-star=no" # Needs ASM support
];
meta = with lib; {
homepage = "http://dgen.sourceforge.net/";
description = "Sega Genesis/Mega Drive emulator";
longDescription = ''
DGen/SDL is a free, open source emulator for Sega Genesis/Mega Drive
systems. DGen was originally written by Dave, then ported to SDL by Joe
Groff and Phil K. Hornung in 1998.
It features:
- Game Genie/Hex codes support
- PAL/NTSC, fullscreen modes
- Joypad/joystick support
- Mouse support
- Highly configurable controls
- OpenGL textured video output
- Portable (64bit, endian safe), runs in Windows using MinGW
- Screenshots, demos recording and playback
- Musashi (generic) and StarScream (x86only) CPU cores
- Cyclone 68000 and DrZ80 (both ARMonly) CPU cores
- CZ80 (generic) and MZ80 (generic and x86only versions)
- 16bit, 8000 to 48000Hz sound output
- Support for 8, 15, 16, 24 and 32 bpp modes
- Archived/compressed ROMs support
- M68K debugger (contributed by Edd Barrett)
- Z80 debugger
- hqx and scale2x upscaling filters
- VGM dumping
'';
license = licenses.mit;
maintainers = with maintainers; [ AndersonTorres ];
platforms = with platforms; unix;
};
}
# TODO: implement configure options

View file

@ -0,0 +1,29 @@
{ lib, stdenv, fetchzip }:
stdenv.mkDerivation rec {
pname = "dlx";
version = "2012-07-08";
src = fetchzip {
url = "https://www.davidviner.com/zip/dlx/dlx.zip";
sha256 = "0508linnar9ivy3xr99gzrb2l027ngx12dlxaxs7w67cnwqnb0dg";
};
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "LINK=${stdenv.cc.targetPrefix}cc" "CFLAGS=-O2" ];
hardeningDisable = [ "format" ];
installPhase = ''
mkdir -p $out/include/dlx $out/share/dlx/{examples,doc} $out/bin
mv masm mon dasm $out/bin/
mv *.i auto.a $out/include/dlx/
mv *.a *.m $out/share/dlx/examples/
mv README.txt MANUAL.TXT $out/share/dlx/doc/
'';
meta = with lib; {
homepage = "https://www.davidviner.com/dlx.html?name=DLX+Simulator";
description = "An DLX simulator written in C";
license = licenses.gpl2Only;
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,122 @@
{ stdenv
, lib
, fetchpatch
, pkg-config
, cmake
, bluez
, ffmpeg
, libao
, gtk2
, glib
, libGLU
, libGL
, gettext
, libpthreadstubs
, libXrandr
, libXext
, readline
, openal
, libXdmcp
, portaudio
, fetchFromGitHub
, libusb1
, libevdev
, wxGTK30
, soundtouch
, miniupnpc
, mbedtls
, curl
, lzo
, sfml
, libpulseaudio ? null
}:
stdenv.mkDerivation rec {
pname = "dolphin-emu";
version = "5.0";
src = fetchFromGitHub {
owner = "dolphin-emu";
repo = "dolphin";
rev = version;
sha256 = "07mlfnh0hwvk6xarcg315x7z2j0qbg9g7cm040df9c8psiahc3g6";
};
patches = [
# Fix build with soundtouch 2.1.2
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/dolphin-emu/raw/a1b91fdf94981e12c8889a02cba0ec2267d0f303/f/dolphin-emu-5.0-soundtouch-exception-fix.patch";
name = "dolphin-emu-5.0-soundtouch-exception-fix.patch";
sha256 = "0yd3l46nja5qiknnl30ryad98f3v8911jwnr67hn61dzx2kwbbaw";
})
# Fix build with gcc 8
(fetchpatch {
url = "https://salsa.debian.org/games-team/dolphin-emu/raw/9b7b4aeac1b60dcf28bdcafbed6bc498b2aeb0ad/debian/patches/03_gcc8.patch";
name = "03_gcc8.patch";
sha256 = "1da95gb8c95kd5cjhdvg19cv2z863lj3va5gx3bqc7g8r36glqxr";
})
];
postPatch = ''
substituteInPlace Source/Core/VideoBackends/OGL/RasterFont.cpp \
--replace " CHAR_WIDTH " " CHARWIDTH "
'';
cmakeFlags = [
"-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
"-DGTK2_INCLUDE_DIRS=${gtk2.dev}/include/gtk-2.0"
"-DENABLE_LTO=True"
];
nativeBuildInputs = [
pkg-config
cmake
];
buildInputs = [
bluez
ffmpeg
libao
libGLU
libGL
gtk2
glib
gettext
libpthreadstubs
libXrandr
libXext
readline
openal
libevdev
libXdmcp
portaudio
libpulseaudio
libevdev
libXdmcp
portaudio
libusb1
libpulseaudio
wxGTK30
soundtouch
miniupnpc
mbedtls
curl
lzo
sfml
];
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
install -D $src/Data/51-usb-device.rules $out/etc/udev/rules.d/51-usb-device.rules
'';
meta = with lib; {
homepage = "https://dolphin-emu.org/";
description = "Gamecube/Wii/Triforce emulator for x86_64 and ARMv8";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ MP2E ashkitten ];
# x86_32 is an unsupported platform.
# Enable generic build if you really want a JIT-less binary.
platforms = [ "x86_64-linux" ];
};
}

View file

@ -0,0 +1,87 @@
{ lib, stdenv, fetchFromGitHub, pkg-config, cmake
, wrapQtAppsHook, qtbase, bluez, ffmpeg, libao, libGLU, libGL, pcre, gettext
, libXrandr, libusb1, libpthreadstubs, libXext, libXxf86vm, libXinerama
, libSM, libXdmcp, readline, openal, udev, libevdev, portaudio, curl, alsa-lib
, miniupnpc, enet, mbedtls, soundtouch, sfml, xz, writeScript
, vulkan-loader ? null, libpulseaudio ? null
# - Inputs used for Darwin
, CoreBluetooth, ForceFeedback, IOKit, OpenGL, libpng, hidapi }:
stdenv.mkDerivation rec {
pname = "dolphin-emu";
version = "5.0-16380";
src = fetchFromGitHub {
owner = "dolphin-emu";
repo = "dolphin";
rev = "8335ec70e5fe253eb21509408ca6b5736ed57dfc";
sha256 = "sha256-WRQ3WfMTlIPoYrEFWLHL9KSfhzQl24AlkbWjh3a4fPE=";
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake pkg-config ]
++ lib.optional stdenv.isLinux wrapQtAppsHook;
buildInputs = [
curl ffmpeg libao libGLU libGL pcre gettext libpthreadstubs libpulseaudio
libXrandr libXext libXxf86vm libXinerama libSM readline openal libXdmcp
portaudio libusb1 libpng hidapi miniupnpc enet mbedtls soundtouch sfml xz
qtbase
] ++ lib.optionals stdenv.isLinux [
bluez udev libevdev alsa-lib vulkan-loader
] ++ lib.optionals stdenv.isDarwin [
CoreBluetooth OpenGL ForceFeedback IOKit
];
cmakeFlags = [
"-DUSE_SHARED_ENET=ON"
"-DENABLE_LTO=ON"
"-DDOLPHIN_WC_REVISION=${src.rev}"
"-DDOLPHIN_WC_DESCRIBE=${version}"
"-DDOLPHIN_WC_BRANCH=master"
] ++ lib.optionals stdenv.isDarwin [
"-DOSX_USE_DEFAULT_SEARCH_PATH=True"
];
qtWrapperArgs = lib.optionals stdenv.isLinux [
"--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
# https://bugs.dolphin-emu.org/issues/11807
# The .desktop file should already set this, but Dolphin may be launched in other ways
"--set QT_QPA_PLATFORM xcb"
];
# - Allow Dolphin to use nix-provided libraries instead of building them
postPatch = ''
sed -i -e 's,DISTRIBUTOR "None",DISTRIBUTOR "NixOS",g' CMakeLists.txt
'' + lib.optionalString stdenv.isDarwin ''
sed -i -e 's,if(NOT APPLE),if(true),g' CMakeLists.txt
sed -i -e 's,if(LIBUSB_FOUND AND NOT APPLE),if(LIBUSB_FOUND),g' \
CMakeLists.txt
'';
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
install -D $src/Data/51-usb-device.rules $out/etc/udev/rules.d/51-usb-device.rules
'';
passthru.updateScript = writeScript "dolphin-update-script" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
set -eou pipefail
json="$(curl -s https://dolphin-emu.org/update/latest/beta)"
version="$(jq -r '.shortrev' <<< "$json")"
rev="$(jq -r '.hash' <<< "$json")"
update-source-version dolphin-emu-beta "$version" --rev="$rev"
'';
meta = with lib; {
homepage = "https://dolphin-emu.org";
description = "Gamecube/Wii/Triforce emulator for x86_64 and ARMv8";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ MP2E ashkitten xfix ];
branch = "master";
broken = stdenv.isDarwin;
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,149 @@
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, cmake
, wrapQtAppsHook
, qtbase
, bluez
, ffmpeg
, libao
, libGLU
, libGL
, pcre
, gettext
, libXrandr
, libusb1
, libpthreadstubs
, libXext
, libXxf86vm
, libXinerama
, libSM
, libXdmcp
, readline
, openal
, udev
, libevdev
, portaudio
, curl
, alsa-lib
, miniupnpc
, enet
, mbedtls
, soundtouch
, sfml
, fmt
, xz
, vulkan-loader
, libpulseaudio
# - Inputs used for Darwin
, CoreBluetooth
, ForceFeedback
, IOKit
, OpenGL
, libpng
, hidapi
}:
stdenv.mkDerivation rec {
pname = "dolphin-emu-primehack";
version = "1.0.6";
src = fetchFromGitHub {
owner = "shiiion";
repo = "dolphin";
rev = version;
sha256 = "sha256-ywCh6wiBjXY5baWfu7cBgwc8w8yJaLM3QQ0FATsrweQ=";
fetchSubmodules = true;
};
nativeBuildInputs = [
pkg-config
cmake
] ++ lib.optional stdenv.isLinux wrapQtAppsHook;
buildInputs = [
curl
ffmpeg
libao
libGLU
libGL
pcre
gettext
libpthreadstubs
libpulseaudio
libXrandr
libXext
libXxf86vm
libXinerama
libSM
readline
openal
libXdmcp
portaudio
libusb1
libpng
hidapi
miniupnpc
enet
mbedtls
soundtouch
sfml
fmt
xz
qtbase
] ++ lib.optionals stdenv.isLinux [
bluez
udev
libevdev
alsa-lib
vulkan-loader
] ++ lib.optionals stdenv.isDarwin [
CoreBluetooth
OpenGL
ForceFeedback
IOKit
];
cmakeFlags = [
"-DUSE_SHARED_ENET=ON"
"-DENABLE_LTO=ON"
] ++ lib.optionals stdenv.isDarwin [
"-DOSX_USE_DEFAULT_SEARCH_PATH=True"
];
qtWrapperArgs = lib.optionals stdenv.isLinux [
"--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
# https://bugs.dolphin-emu.org/issues/11807
# The .desktop file should already set this, but Dolphin may be launched in other ways
"--set QT_QPA_PLATFORM xcb"
];
# - Allow Dolphin to use nix-provided libraries instead of building them
postPatch = ''
substituteInPlace CMakeLists.txt --replace 'DISTRIBUTOR "None"' 'DISTRIBUTOR "NixOS"'
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace CMakeLists.txt --replace 'if(NOT APPLE)' 'if(true)'
substituteInPlace CMakeLists.txt --replace 'if(LIBUSB_FOUND AND NOT APPLE)' 'if(LIBUSB_FOUND)'
'';
postInstall = ''
mv $out/bin/dolphin-emu $out/bin/dolphin-emu-primehack
mv $out/bin/dolphin-emu-nogui $out/bin/dolphin-emu-primehack-nogui
mv $out/share/applications/dolphin-emu.desktop $out/share/applications/dolphin-emu-primehack.desktop
mv $out/share/icons/hicolor/256x256/apps/dolphin-emu.png $out/share/icons/hicolor/256x256/apps/dolphin-emu-primehack.png
substituteInPlace $out/share/applications/dolphin-emu-primehack.desktop --replace 'dolphin-emu' 'dolphin-emu-primehack'
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
install -D $src/Data/51-usb-device.rules $out/etc/udev/rules.d/51-usb-device.rules
'';
meta = with lib; {
homepage = "https://github.com/shiiion/dolphin";
description = "Gamecube/Wii/Triforce emulator for x86_64 and ARMv8";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ MP2E ashkitten Madouura ];
broken = stdenv.isDarwin;
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,112 @@
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, SDL2_net
, alsa-lib
, copyDesktopItems
, fluidsynth
, gtest
, libGL
, libGLU
, libogg
, libpng
, libslirp
, makeDesktopItem
, makeWrapper
, meson
, libmt32emu
, ninja
, opusfile
, pkg-config
, libpulseaudio
, glib
, libjack2
, libsndfile
}:
stdenv.mkDerivation rec {
pname = "dosbox-staging";
version = "0.78.1";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
hash = "sha256-gozFZcJorZtbEK0joksig6qWmAMy03hmBHiyJMONfpk=";
};
nativeBuildInputs = [
copyDesktopItems
gtest
makeWrapper
meson
ninja
pkg-config
];
buildInputs = [
SDL2
SDL2_net
alsa-lib
fluidsynth
glib
libGL
libGLU
libjack2
libmt32emu
libogg
libpng
libpulseaudio
libslirp
libsndfile
opusfile
];
NIX_CFLAGS_COMPILE = [
"-I${SDL2_net}/include/SDL2"
];
desktopItems = [
(makeDesktopItem {
name = "dosbox-staging";
exec = "dosbox-staging";
icon = "dosbox-staging";
comment = "x86 dos emulator enhanced";
desktopName = "DosBox-Staging";
genericName = "DOS emulator";
categories = [ "Emulator" "Game" ];
})
];
postFixup = ''
# Rename binary, add a wrapper, and copy manual to avoid conflict with
# original dosbox. Doing it this way allows us to work with frontends and
# launchers that expect the binary to be named dosbox, but get out of the
# way of vanilla dosbox if the user desires to install that as well.
mv $out/bin/dosbox $out/bin/${pname}
makeWrapper $out/bin/dosbox-staging $out/bin/dosbox
# Create a symlink to dosbox manual instead of merely copying it
pushd $out/share/man/man1/
mv dosbox.1.gz ${pname}.1.gz
ln -s ${pname}.1.gz dosbox.1.gz
popd
'';
meta = with lib; {
homepage = "https://dosbox-staging.github.io/";
description = "A modernized DOS emulator";
longDescription = ''
DOSBox Staging is an attempt to revitalize DOSBox's development
process. It's not a rewrite, but a continuation and improvement on the
existing DOSBox codebase while leveraging modern development tools and
practices.
'';
license = licenses.gpl2Plus;
maintainers = with maintainers; [ joshuafern AndersonTorres ];
platforms = platforms.unix;
priority = 101;
};
}
# TODO: report upstream about not finding SDL2_net

View file

@ -0,0 +1,75 @@
{ lib
, stdenv
, fetchurl
, SDL
, SDL_net
, SDL_sound
, copyDesktopItems
, graphicsmagick
, libGL
, libGLU
, libpng
, makeDesktopItem
}:
stdenv.mkDerivation rec {
pname = "dosbox";
version = "0.74-3";
src = fetchurl {
url = "mirror://sourceforge/dosbox/dosbox-${version}.tar.gz";
hash = "sha256-wNE91+0u02O2jeYVR1eB6JHNWC6BYrXDZpE3UCIiJgo=";
};
nativeBuildInputs = [
copyDesktopItems
graphicsmagick
];
buildInputs = [
SDL
SDL_net
SDL_sound
libGL
libGLU
libpng
];
hardeningDisable = [ "format" ];
configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
desktopItems = [
(makeDesktopItem {
name = "dosbox";
exec = "dosbox";
icon = "dosbox";
comment = "x86 dos emulator";
desktopName = "DOSBox";
genericName = "DOS emulator";
categories = [ "Emulator" "Game" ];
})
];
postInstall = ''
mkdir -p $out/share/icons/hicolor/256x256/apps
gm convert src/dosbox.ico $out/share/icons/hicolor/256x256/apps/dosbox.png
'';
enableParallelBuilding = true;
meta = with lib; {
homepage = "http://www.dosbox.com/";
description = "A DOS emulator";
longDescription = ''
DOSBox is an emulator that recreates a MS-DOS compatible environment
(complete with Sound, Input, Graphics and even basic networking). This
environment is complete enough to run many classic MS-DOS games completely
unmodified. In order to utilize all of DOSBox's features you need to first
understand some basic concepts about the MS-DOS environment.
'';
license = licenses.gpl2Plus;
maintainers = with maintainers; [ matthewbauer ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,105 @@
{ lib
, mkDerivation
, fetchFromGitHub
, SDL2
, cmake
, curl
, extra-cmake-modules
, gtk3
, libevdev
, libpulseaudio
, mesa
, ninja
, pkg-config
, qtbase
, qttools
, sndio
, vulkan-loader
, wayland
, wrapQtAppsHook
}:
mkDerivation rec {
pname = "duckstation";
version = "0.pre+date=2022-01-18";
src = fetchFromGitHub {
owner = "stenzek";
repo = pname;
rev = "51041e47f70123eda41d999701f5651830a0a95e";
sha256 = "sha256-nlF6ctDU8KCK7MN2pniPLLqUbPUygX9rl0hjzVQ+mPo=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
ninja
pkg-config
qttools
wrapQtAppsHook
];
buildInputs = [
SDL2
curl
gtk3
libevdev
libpulseaudio
mesa
qtbase
sndio
vulkan-loader
wayland
];
cmakeFlags = [
"-DUSE_DRMKMS=ON"
"-DUSE_WAYLAND=ON"
];
postPatch = ''
substituteInPlace extras/linux-desktop-files/duckstation-qt.desktop \
--replace "duckstation-qt" "duckstation" \
--replace "TryExec=duckstation" "tryExec=duckstation-qt" \
--replace "Exec=duckstation" "Exec=duckstation-qt"
substituteInPlace extras/linux-desktop-files/duckstation-nogui.desktop \
--replace "duckstation-nogui" "duckstation" \
--replace "TryExec=duckstation" "tryExec=duckstation-nogui" \
--replace "Exec=duckstation" "Exec=duckstation-nogui"
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share $out/share/pixmaps $out/share/applications
rm bin/common-tests
cp -r bin $out/share/duckstation
ln -s $out/share/duckstation/duckstation-{qt,nogui} $out/bin/
cp ../extras/icons/icon-256px.png $out/share/pixmaps/duckstation.png
cp ../extras/linux-desktop-files/* $out/share/applications/
runHook postInstall
'';
doCheck = true;
checkPhase = ''
runHook preCheck
./bin/common-tests
runHook postCheck
'';
# Libpulseaudio fixes https://github.com/NixOS/nixpkgs/issues/171173
qtWrapperArgs = [
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpulseaudio vulkan-loader ]}"
];
meta = with lib; {
homepage = "https://github.com/stenzek/duckstation";
description = "Fast PlayStation 1 emulator for x86-64/AArch32/AArch64";
license = licenses.gpl3Only;
maintainers = with maintainers; [ guibou AndersonTorres ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,36 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, libelf
, libpcap
}:
stdenv.mkDerivation rec {
pname = "dynamips";
version = "0.2.21";
src = fetchFromGitHub {
owner = "GNS3";
repo = pname;
rev = "v${version}";
hash = "sha256-JQJa3NZ9mQqqvuTzU7XmAr1WRB4zuLIwBx18OY3GbV8=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ libelf libpcap ];
cmakeFlags = [ "-DDYNAMIPS_CODE=stable" ];
meta = with lib; {
inherit (src.meta) homepage;
description = "A Cisco router emulator";
longDescription = ''
Dynamips is an emulator computer program that was written to emulate Cisco
routers.
'';
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ primeos ];
};
}

View file

@ -0,0 +1,26 @@
{ lib
, stdenv
, fetchFromGitHub
}:
stdenv.mkDerivation rec {
pname = "emu2";
version = "0.pre+unstable=2021-09-22";
src = fetchFromGitHub {
owner = "dmsc";
repo = "emu2";
rev = "8d01b53f154d6bfc9561a44b9c281b46e00a4e87";
hash = "sha256-Jafl0Pw2k5RCF9GgpdAWcQ+HBTsiX7dOKSMCWPHQ+2E=";
};
makeFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
homepage = "https://github.com/dmsc/emu2/";
description = "A simple text-mode x86 + DOS emulator";
platforms = platforms.linux;
maintainers = with maintainers; [ AndersonTorres ];
license = licenses.gpl2Plus;
};
}

View file

@ -0,0 +1,37 @@
{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, curl, boost169, eigen
, freeimage, freetype, libGLU, libGL, SDL2, alsa-lib, libarchive
, fetchpatch }:
stdenv.mkDerivation {
pname = "emulationstation";
version = "2.0.1a";
src = fetchFromGitHub {
owner = "Aloshi";
repo = "EmulationStation";
rev = "646bede3d9ec0acf0ae378415edac136774a66c5";
sha256 = "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v";
};
patches = [
(fetchpatch {
url = "https://github.com/Aloshi/EmulationStation/commit/49ccd8fc7a7b1dfd974fc57eb13317c42842f22c.patch";
sha256 = "1v5d81l7bav0k5z4vybrc3rjcysph6lkm5pcfr6m42wlz7jmjw0p";
})
];
nativeBuildInputs = [ pkg-config cmake ];
buildInputs = [ alsa-lib boost169 curl eigen freeimage freetype libarchive libGLU libGL SDL2 ];
installPhase = ''
install -D ../emulationstation $out/bin/emulationstation
'';
meta = {
description = "A flexible emulator front-end supporting keyboardless navigation and custom system themes";
homepage = "https://emulationstation.org";
maintainers = [ lib.maintainers.edwtjo ];
license = lib.licenses.mit;
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,24 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, wrapQtAppsHook, SDL2, lua5_1, minizip, x264 }:
stdenv.mkDerivation rec {
pname = "fceux";
version = "2.6.4";
src = fetchFromGitHub {
owner = "TASEmulators";
repo = pname;
rev = "${pname}-${version}";
sha256 = "sha256-Q6r/iBlmi0z40+U6OLZCahS0io4IBBGZMP1mJH7szRM=";
};
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
buildInputs = [ SDL2 lua5_1 minizip x264 ];
meta = with lib; {
description = "A Nintendo Entertainment System (NES) Emulator";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ sbruder scubed2 ];
homepage = "http://www.fceux.com/";
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,36 @@
{ mkDerivation, lib, fetchFromGitHub, qmake, qtbase, qtdeclarative }:
mkDerivation rec {
pname = "firebird-emu";
version = "1.5";
src = fetchFromGitHub {
owner = "nspire-emus";
repo = "firebird";
rev = "v${version}";
sha256 = "sha256-T62WB6msdB6/wIulqd/468JrCEiPGUrvtpjkZyo4wiA=";
fetchSubmodules = true;
};
nativeBuildInputs = [ qmake ];
buildInputs = [ qtbase qtdeclarative ];
makeFlags = [ "INSTALL_ROOT=$(out)" ];
# Attempts to install to /usr/bin and /usr/share/applications, which Nix does
# not use.
prePatch = ''
substituteInPlace firebird.pro \
--replace '/usr/' '/'
'';
meta = {
homepage = "https://github.com/nspire-emus/firebird";
description = "Third-party multi-platform emulator of the ARM-based TI-Nspire calculators";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ pneumaticat ];
# Only tested on Linux, but likely possible to build on, e.g. macOS
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,52 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, alsa-lib
, libX11
, libevdev
, udev
, libpulseaudio
, SDL2
, libzip
, miniupnpc
}:
stdenv.mkDerivation rec {
pname = "flycast";
version = "1.3";
src = fetchFromGitHub {
owner = "flyinghead";
repo = "flycast";
rev = "v${version}";
sha256 = "sha256-FAHm8Fu/yv2rJvWCY+g50TYH4zOT6rO7F+jTL2T6EOU=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
alsa-lib
libX11
libevdev
udev
libpulseaudio
SDL2
libzip
miniupnpc
];
meta = with lib; {
homepage = "https://github.com/flyinghead/flycast";
changelog = "https://github.com/flyinghead/flycast/releases/tag/v${version}";
description = "A multi-platform Sega Dreamcast, Naomi and Atomiswave emulator";
license = licenses.gpl2Only;
platforms = platforms.unix;
maintainers = [ maintainers.ivar ];
};
}

View file

@ -0,0 +1,65 @@
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, autoreconfHook
, freetype
, gettext
, glib
, gtk2
, libGL
, libGLU
, libmpeg2
, lua
, openal
, pkg-config
, zip
, zlib
}:
stdenv.mkDerivation rec {
pname = "fs-uae";
version = "3.1.66";
src = fetchFromGitHub {
owner = "FrodeSolheim";
repo = pname;
rev = "v${version}";
hash = "sha256-zPVRPazelmNaxcoCStB0j9b9qwQDTgv3O7Bg3VlW9ys=";
};
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
SDL2
freetype
gettext
glib
gtk2
libGL
libGLU
libmpeg2
lua
openal
zip
zlib
];
meta = with lib; {
homepage = "https://fs-uae.net";
description = "An accurate, customizable Amiga Emulator";
longDescription = ''
FS-UAE integrates the most accurate Amiga emulation code available
from WinUAE. FS-UAE emulates A500, A500+, A600, A1200, A1000, A3000
and A4000 models, but you can tweak the hardware configuration and
create customized Amigas.
'';
license = licenses.gpl2Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = [ "i686-linux" "x86_64-linux" ];
};
}

View file

@ -0,0 +1,43 @@
{ lib
, stdenv
, fetchurl
, gettext
, makeWrapper
, python3
}:
stdenv.mkDerivation rec {
pname = "fs-uae-launcher";
version = "3.0.5";
src = fetchurl {
url = "https://fs-uae.net/stable/${version}/${pname}-${version}.tar.gz";
sha256 = "1dknra4ngz7bpppwqghmza1q68pn1yaw54p9ba0f42zwp427ly97";
};
nativeBuildInputs = [
gettext
makeWrapper
python3
];
buildInputs = with python3.pkgs; [
pyqt5
requests
setuptools
];
makeFlags = [ "prefix=$(out)" ];
postInstall = ''
wrapProgram $out/bin/fs-uae-launcher --set PYTHONPATH "$PYTHONPATH"
'';
meta = with lib; {
homepage = "https://fs-uae.net";
description = "Graphical front-end for the FS-UAE emulator";
license = lib.licenses.gpl2Plus;
maintainers = with maintainers; [ sander AndersonTorres ];
platforms = [ "i686-linux" "x86_64-linux" ];
};
}

View file

@ -0,0 +1,29 @@
{ lib, stdenv, fetchurl, perl, pkg-config, wrapGAppsHook
, SDL, bzip2, glib, gtk3, libgcrypt, libpng, libspectrum, libxml2, zlib
}:
stdenv.mkDerivation rec {
pname = "fuse-emulator";
version = "1.6.0";
src = fetchurl {
url = "mirror://sourceforge/${pname}/fuse-${version}.tar.gz";
sha256 = "sha256-Oo/t8v/pR8VxVhusVaWa2tTFkzj3TkSbfnpn2coEcJY=";
};
nativeBuildInputs = [ perl pkg-config wrapGAppsHook ];
buildInputs = [ SDL bzip2 glib gtk3 libgcrypt libpng libspectrum libxml2 zlib ];
configureFlags = [ "--enable-desktop-integration" ];
enableParallelBuilding = true;
meta = with lib; {
homepage = "http://fuse-emulator.sourceforge.net/";
description = "ZX Spectrum emulator";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ orivej ];
};
}

View file

@ -0,0 +1,26 @@
{ lib, stdenv, fetchurl, pkg-config, gtk2, SDL, nasm, zlib, libpng, libGLU, libGL }:
stdenv.mkDerivation rec {
pname = "gens-gs";
version = "7";
src = fetchurl {
url = "http://retrocdn.net/images/6/6d/Gens-gs-r${version}.tar.gz";
sha256 = "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ gtk2 SDL nasm zlib libpng libGLU libGL ];
# Work around build failures on recent GTK.
# See http://ubuntuforums.org/showthread.php?p=10535837
NIX_CFLAGS_COMPILE = "-UGTK_DISABLE_DEPRECATED -UGSEAL_ENABLE";
meta = with lib; {
homepage = "https://segaretro.org/Gens/GS";
description = "A Genesis/Mega Drive emulator";
platforms = [ "i686-linux" ];
license = licenses.gpl2Plus;
maintainers = [ maintainers.eelco ];
};
}

View file

@ -0,0 +1,53 @@
{ lib
, stdenv
, fetchFromGitLab
, cmake
, protobuf
}:
stdenv.mkDerivation rec {
pname = "goldberg-emu";
version = "0.2.5";
src = fetchFromGitLab {
owner = "mr_goldberg";
repo = "goldberg_emulator";
rev = version;
sha256 = "sha256-goOgMNjtDmIKOAv9sZwnPOY0WqTN90LFJ5iEp3Vkzog=";
};
# It attempts to install windows-only libraries which we never build
patches = [ ./dont-install-unsupported.patch ];
nativeBuildInputs = [ cmake ];
buildInputs = [ protobuf ];
cmakeFlags = [
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/share/goldberg"
];
preFixup = ''
mkdir -p $out/{bin,lib}
chmod +x $out/share/goldberg/tools/find_interfaces.sh
ln -s $out/share/goldberg/libsteam_api.so $out/lib
ln -s $out/share/goldberg/lobby_connect/lobby_connect $out/bin
ln -s $out/share/goldberg/tools/generate_interfaces_file $out/bin
ln -s $out/share/goldberg/tools/find_interfaces.sh $out/bin/find_interfaces
'';
meta = with lib; {
broken = stdenv.isDarwin;
homepage = "https://gitlab.com/Mr_Goldberg/goldberg_emulator";
changelog = "https://gitlab.com/Mr_Goldberg/goldberg_emulator/-/releases";
description = "Program that emulates steam online features";
longDescription = ''
Steam emulator that emulates steam online features. Lets you play games that
use the steam multiplayer apis on a LAN without steam or an internet connection.
'';
mainProgram = "lobby_connect";
license = licenses.lgpl3Only;
platforms = platforms.unix;
maintainers = [ maintainers.ivar ];
};
}

View file

@ -0,0 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index abaace2..5e3465c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -182,10 +182,10 @@ if(WIN32)
RUNTIME DESTINATION ./
)
else()
- install(TARGETS
- ${LIB_STEAMCLIENT}
- LIBRARY DESTINATION ./
- )
+ # install(TARGETS
+ #${LIB_STEAMCLIENT}
+ #LIBRARY DESTINATION ./
+ #)
endif()
if(NOT WIN32)
@@ -220,10 +220,10 @@ if(WIN32)
RUNTIME DESTINATION ./
)
else()
- install(TARGETS
- ${LIB_STEAMNETWORKINGSOCKETS}
- LIBRARY DESTINATION ./
- )
+ # install(TARGETS
+ # ${LIB_STEAMNETWORKINGSOCKETS}
+ # LIBRARY DESTINATION ./
+ # )
endif()
if(NOT WIN32)

View file

@ -0,0 +1,26 @@
diff -Naur gxemul-0.7.0-old/src/include/thirdparty/pcireg.h gxemul-0.7.0/src/include/thirdparty/pcireg.h
--- gxemul-0.7.0-old/src/include/thirdparty/pcireg.h 2021-04-22 15:04:14.000000000 -0300
+++ gxemul-0.7.0-new/src/include/thirdparty/pcireg.h 2021-06-28 18:41:13.063065322 -0300
@@ -12,9 +12,6 @@
#undef __noreturn__
#endif
-#define __attribute__(x) /* */
-#define __noreturn__ /* */
-
/*
* Copyright (c) 1995, 1996, 1999, 2000
* Christopher G. Demetriou. All rights reserved.
diff -Naur gxemul-0.7.0-old/src/include/thirdparty/sgi_arcbios.h gxemul-0.7.0/src/include/thirdparty/sgi_arcbios.h
--- gxemul-0.7.0-old/src/include/thirdparty/sgi_arcbios.h 2021-04-22 15:04:14.000000000 -0300
+++ gxemul-0.7.0-new/src/include/thirdparty/sgi_arcbios.h 2021-06-28 18:41:33.549981505 -0300
@@ -14,9 +14,6 @@
#undef __noreturn__
#endif
-#define __attribute__(x) /* */
-#define __noreturn__ /* */
-
/* $NetBSD: arcbios.h,v 1.3 2001/12/06 14:59:02 rafal Exp $ */
/*-

View file

@ -0,0 +1,47 @@
{ lib
, stdenv
, fetchurl
, libX11
}:
stdenv.mkDerivation rec {
pname = "gxemul";
version = "0.7.0";
src = fetchurl {
url = "http://gavare.se/gxemul/src/${pname}-${version}.tar.gz";
sha256 = "sha256-ecRDfG+MqQT0bTOsNgYqZf3PSpKiSEeOQIqxEpXPjoM=";
};
buildInputs = [
libX11
];
patches = [
# Fix compilation; remove when next release arrives
./0001-fix-attributes.patch
];
dontAddPrefix = true;
preConfigure = ''
export PREFIX=${placeholder "out"}
'';
meta = with lib; {
homepage = "http://gavare.se/gxemul/";
description = "Gavare's experimental emulator";
longDescription = ''
GXemul is a framework for full-system computer architecture
emulation. Several real machines have been implemented within the
framework, consisting of processors (ARM, MIPS, Motorola 88K, PowerPC, and
SuperH) and surrounding hardware components such as framebuffers,
interrupt controllers, busses, disk controllers, and serial
controllers. The emulation is working well enough to allow several
unmodified "guest" operating systems to run.
'';
license = licenses.bsd3;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,25 @@
{ lib, stdenv, fetchurl, zlib, SDL, cmake }:
stdenv.mkDerivation rec {
pname = "hatari";
version = "2.3.1";
src = fetchurl {
url = "https://download.tuxfamily.org/hatari/${version}/${pname}-${version}.tar.bz2";
sha256 = "sha256-RKL2LKmV442eCHSAaVbwucPMhOqJ4BaaY4SbY807ZL0=";
};
# For pthread_cancel
cmakeFlags = [ "-DCMAKE_EXE_LINKER_FLAGS=-lgcc_s" ];
nativeBuildInputs = [ cmake ];
buildInputs = [ zlib SDL ];
meta = {
homepage = "http://hatari.tuxfamily.org/";
description = "Atari ST/STE/TT/Falcon emulator";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ ];
};
}

View file

@ -0,0 +1,27 @@
{ lib
, stdenv
, fetchurl
}:
stdenv.mkDerivation rec {
pname = "hercules";
version = "3.13";
src = fetchurl {
url = "http://downloads.hercules-390.eu/${pname}-${version}.tar.gz";
sha256 = "0zg6rwz8ib4alibf8lygi8qn69xx8n92kbi8b3jhi1ymb32mf349";
};
meta = with lib; {
homepage = "http://www.hercules-390.eu";
description = "IBM mainframe emulator";
longDescription = ''
Hercules is an open source software implementation of the mainframe
System/370 and ESA/390 architectures, in addition to the latest 64-bit
z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and
Mac OS X.
'';
license = licenses.qpl;
maintainers = [ maintainers.anna328p ];
};
}

View file

@ -0,0 +1,78 @@
{ stdenv, lib, writeText, fetchurl, upx, libGLU, glib, gtk2, alsa-lib, libSM, libX11, gdk-pixbuf, pango, libXinerama, mpg123, runtimeShell }:
let
libPath = lib.makeLibraryPath [ stdenv.cc.cc libGLU glib gtk2 alsa-lib libSM libX11 gdk-pixbuf pango libXinerama ];
in stdenv.mkDerivation {
pname = "kega-fusion";
version = "3.63x";
src = fetchurl {
url = "http://www.carpeludum.com/download/Fusion363x.tar.gz";
sha256 = "14s6czy20h5khyy7q95hd7k77v17ssafv9l6lafkiysvj2nmw94g";
};
plugins = fetchurl {
url = "http://www.carpeludum.com/download/PluginsLinux.tar.gz";
sha256 = "0d623cvh6n5ijj3wb64g93mxx2xbichsn7hj7brbb0ndw5cs70qj";
};
runner = writeText "kega-fusion" ''
#!${runtimeShell} -ex
kega_libdir="@out@/lib/kega-fusion"
kega_localdir="$HOME/.Kega Fusion"
# create local plugins directory if not present
mkdir -p "$kega_localdir/Plugins"
# create links for every included plugin
if [ $(ls -1A $kega_libdir/plugins | wc -l) -gt 0 ]; then
for i in $kega_libdir/plugins/*; do
if [ ! -e "$kega_localdir/Plugins/$(basename "$i")" ]; then
ln -sf "$i" "$kega_localdir/Plugins/"
fi
done
fi
# copy configuration file if not present
if ! [ -f "$kega_localdir/Fusion.ini" ]; then
cat > "$kega_localdir/Fusion.ini" <<EOF
ALSADeviceName=default
libmpg123path=${lib.getLib mpg123}/lib/libmpg123.so.0
EOF
else
sed -i 's,^\(libmpg123path=\).*,\1${lib.getLib mpg123}/lib/libmpg123.so.0,' "$kega_localdir/Fusion.ini"
fi
# here we go!
exec "$kega_libdir/Fusion" "$@"
'';
dontStrip = true;
dontPatchELF = true;
nativeBuildInputs = [ upx ];
installPhase = ''
upx -d Fusion
install -Dm755 Fusion "$out/lib/kega-fusion/Fusion"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${libPath}" "$out/lib/kega-fusion/Fusion"
tar -xaf $plugins
mkdir -p "$out/lib/kega-fusion/plugins"
cp -r Plugins/*.rpi "$out/lib/kega-fusion/plugins"
mkdir -p "$out/bin"
substitute "$runner" "$out/bin/kega-fusion" --subst-var out
chmod +x "$out/bin/kega-fusion"
'';
meta = with lib; {
description = "Sega SG1000, SC3000, SF7000, Master System, Game Gear, Genesis/Megadrive, SVP, Pico, SegaCD/MegaCD and 32X emulator";
homepage = "https://www.carpeludum.com/kega-fusion/";
maintainers = with maintainers; [ abbradar ];
license = licenses.unfreeRedistributable;
platforms = [ "i686-linux" ];
};
}

View file

@ -0,0 +1,26 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, SDL2 }:
stdenv.mkDerivation rec {
pname = "lambda-delta";
version = "0.98.3";
src = fetchFromGitHub {
owner = "dseagrav";
repo = "ld";
rev = version;
sha256 = "02m43fj9dzc1i1jl01qwnhjiq1rh03jw1xq59sx2h3bhn7dk941x";
};
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ SDL2 ];
configureFlags = [ "--without-SDL1" ];
meta = with lib; {
description = "LMI (Lambda Lisp Machine) emulator";
homepage = "https://github.com/dseagrav/ld";
license = licenses.gpl2;
maintainers = with maintainers; [ siraben ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,19 @@
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "libdsk";
version = "1.5.18";
src = fetchurl {
url = "https://www.seasip.info/Unix/LibDsk/${pname}-${version}.tar.gz";
sha256 = "sha256-43HUMQ35nwOwaQP8F1vO7zFccxHrQqJhZ6D5zzYhB5A=";
};
meta = with lib; {
description = "A library for accessing discs and disc image files";
homepage = "http://www.seasip.info/Unix/LibDsk/";
license = licenses.gpl2Plus;
maintainers = [ ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,26 @@
{ lib, stdenv, fetchFromGitHub, cmake, libX11 }:
stdenv.mkDerivation rec {
pname = "maiko";
version = "2021-04-14";
src = fetchFromGitHub {
owner = "Interlisp";
repo = "maiko";
rev = "91fe7d51f9d607bcedde0e78e435ee188a8c84c0";
hash = "sha256-Y+ngep/xHw6RCU8XVRYSWH6S+9hJ74z50pGpIqS2CjM=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ libX11 ];
installPhase = ''
runHook preInstall
find . -maxdepth 1 -executable -type f -exec install -Dt $out/bin '{}' \;
runHook postInstall
'';
meta = with lib; {
description = "Medley Interlisp virtual machine";
homepage = "https://interlisp.org/";
license = licenses.mit;
maintainers = with maintainers; [ ehmry ];
inherit (libX11.meta) platforms;
};
}

View file

@ -0,0 +1,37 @@
From 54aebffc4584ee68149d4b5b64ceaa79a82b8427 Mon Sep 17 00:00:00 2001
From: Thiago Kenji Okada <thiagokokada@gmail.com>
Date: Sat, 9 Apr 2022 13:16:08 +0100
Subject: [PATCH] Revert "Added PDF documentation to dist.mak"
This reverts commit c0e93076232e794c919231e4386445d78b2d80b1.
---
dist.mak | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/dist.mak b/dist.mak
index edbb4cd67cb..c378dfdf708 100644
--- a/dist.mak
+++ b/dist.mak
@@ -109,7 +109,7 @@ GEN_FOLDERS := $(addprefix $(STAGEDIR)/,$(CREATED_DIRS))
COPY_BINARIES := $(addprefix $(STAGEDIR)/,$(addsuffix $(EXE),$(BINARIES)))
COPY_FILES := $(addprefix $(STAGEDIR)/,$(COPIED_FILES))
-all: $(COPY_BINARIES) $(COPY_FILES) $(STAGEDIR)/docs/MAME.pdf
+all: $(COPY_BINARIES) $(COPY_FILES)
clean:
$(SILENT) rm -rf $(STAGEDIR)
@@ -124,10 +124,4 @@ $(STAGEDIR)/%: $(BINDIR)/% | $(GEN_FOLDERS)
$(STAGEDIR)/%: % | $(GEN_FOLDERS)
$(call COPY,$<,$@)
-$(STAGEDIR)/docs/MAME.pdf: docs/build/latex/MAME.pdf | $(GEN_FOLDERS)
- $(call COPY,$<,$@)
-
-docs/build/latex/MAME.pdf:
- $(MAKE) -C docs latexpdf
-
.PHONY: all clean
--
2.33.1

View file

@ -0,0 +1,156 @@
{ lib
, stdenv
, alsa-lib
, CoreAudioKit
, expat
, fetchFromGitHub
, flac
, fontconfig
, ForceFeedback
, glm
, installShellFiles
, libjpeg
, libpcap
, libpulseaudio
, libXi
, libXinerama
, lua5_3
, makeDesktopItem
, makeWrapper
, pkg-config
, portaudio
, portmidi
, pugixml
, python3
, qtbase
, rapidjson
, SDL2
, SDL2_ttf
, utf8proc
, which
, writeScript
, zlib
}:
let
desktopItem = makeDesktopItem {
name = "MAME";
exec = "mame${lib.optionalString stdenv.is64bit "64"}";
desktopName = "MAME";
genericName = "MAME is a multi-purpose emulation framework";
categories = [ "System" "Emulator" ];
};
dest = "$out/opt/mame";
in
stdenv.mkDerivation rec {
pname = "mame";
version = "0.243";
src = fetchFromGitHub {
owner = "mamedev";
repo = "mame";
rev = "mame${builtins.replaceStrings [ "." ] [ "" ] version}";
sha256 = "sha256-dUgYLNvgvolz9M0ySkGJIZjVMBQwejkxsZ6npg8rIqk=";
};
hardeningDisable = [ "fortify" ];
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"CXX=${stdenv.cc.targetPrefix}c++"
"TOOLS=1"
"USE_LIBSDL=1"
# "USE_SYSTEM_LIB_ASIO=1"
"USE_SYSTEM_LIB_EXPAT=1"
"USE_SYSTEM_LIB_FLAC=1"
"USE_SYSTEM_LIB_GLM=1"
"USE_SYSTEM_LIB_JPEG=1"
"USE_SYSTEM_LIB_LUA=1"
"USE_SYSTEM_LIB_PORTAUDIO=1"
"USE_SYSTEM_LIB_PORTMIDI=1"
"USE_SYSTEM_LIB_PUGIXML=1"
"USE_SYSTEM_LIB_RAPIDJSON=1"
"USE_SYSTEM_LIB_UTF8PROC=1"
"USE_SYSTEM_LIB_ZLIB=1"
];
dontWrapQtApps = true;
# https://docs.mamedev.org/initialsetup/compilingmame.html
buildInputs = [
expat
zlib
flac
lua5_3
portmidi
portaudio
utf8proc
libjpeg
rapidjson
pugixml
glm
SDL2
SDL2_ttf
qtbase
]
++ lib.optionals stdenv.isLinux [ alsa-lib libpulseaudio libXinerama libXi fontconfig ]
++ lib.optionals stdenv.isDarwin [ libpcap CoreAudioKit ForceFeedback ];
nativeBuildInputs = [ python3 pkg-config which makeWrapper installShellFiles ];
patches = [
# MAME is now generating the PDF documentation on its release script since commit:
# https://github.com/mamedev/mame/commit/c0e93076232e794c919231e4386445d78b2d80b1
# however this needs sphinx+latex to build, and it is available in the website
# anyway for those who need it
./0001-Revert-Added-PDF-documentation-to-dist.mak.patch
# by default MAME assumes that paths with stock resources
# are relative and that you run MAME changing to
# install directory, so we add absolute paths here
./emuopts.patch
];
postPatch = ''
substituteInPlace src/emu/emuopts.cpp \
--subst-var-by mame ${dest}
'';
installPhase = ''
make -f dist.mak PTR64=${lib.optionalString stdenv.is64bit "1"}
mkdir -p ${dest}
mv build/release/*/Release/mame/* ${dest}
mkdir -p $out/bin
find ${dest} -maxdepth 1 -executable -type f -exec mv -t $out/bin {} \;
install -Dm755 src/osd/sdl/taputil.sh $out/bin/taputil.sh
installManPage ${dest}/docs/man/*.1 ${dest}/docs/man/*.6
mv artwork plugins samples ${dest}
'' + lib.optionalString stdenv.isLinux ''
mkdir -p $out/share
ln -s ${desktopItem}/share/applications $out/share
'';
enableParallelBuilding = true;
passthru.updateScript = writeScript "mame-update-script" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl common-updater-scripts jq
set -eu -o pipefail
latest_version=$(curl -s https://api.github.com/repos/mamedev/mame/releases/latest | jq --raw-output .tag_name)
update-source-version mame "''${latest_version/mame0/0.}"
'';
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
description = "Is a multi-purpose emulation framework";
homepage = "https://www.mamedev.org/";
license = with licenses; [ bsd3 gpl2Plus ];
platforms = platforms.unix;
maintainers = with maintainers; [ thiagokokada ];
};
}

View file

@ -0,0 +1,29 @@
diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp
index c42fcef848..d1bddae060 100644
--- a/src/emu/emuopts.cpp
+++ b/src/emu/emuopts.cpp
@@ -36,16 +36,16 @@ const options_entry emu_options::s_option_entries[] =
{ nullptr, nullptr, OPTION_HEADER, "CORE SEARCH PATH OPTIONS" },
{ OPTION_HOMEPATH, ".", OPTION_STRING, "path to base folder for plugin data (read/write)" },
{ OPTION_MEDIAPATH ";rp;biospath;bp", "roms", OPTION_STRING, "path to ROM sets and hard disk images" },
- { OPTION_HASHPATH ";hash_directory;hash", "hash", OPTION_STRING, "path to software definition files" },
- { OPTION_SAMPLEPATH ";sp", "samples", OPTION_STRING, "path to audio sample sets" },
- { OPTION_ARTPATH, "artwork", OPTION_STRING, "path to artwork files" },
- { OPTION_CTRLRPATH, "ctrlr", OPTION_STRING, "path to controller definitions" },
- { OPTION_INIPATH, ".;ini;ini/presets", OPTION_STRING, "path to ini files" },
- { OPTION_FONTPATH, ".", OPTION_STRING, "path to font files" },
+ { OPTION_HASHPATH ";hash_directory;hash", "hash;@mame@/hash", OPTION_STRING, "path to software definition files" },
+ { OPTION_SAMPLEPATH ";sp", "samples;@mame@/samples", OPTION_STRING, "path to audio sample sets" },
+ { OPTION_ARTPATH, "artwork;@mame@/artwork", OPTION_STRING, "path to artwork files" },
+ { OPTION_CTRLRPATH, "ctrlr;@mame@/ctrlr", OPTION_STRING, "path to controller definitions" },
+ { OPTION_INIPATH, ".;ini;ini/presets;@mame@/ini/presets", OPTION_STRING, "path to ini files" },
+ { OPTION_FONTPATH, ".;@mame@", OPTION_STRING, "path to font files" },
{ OPTION_CHEATPATH, "cheat", OPTION_STRING, "path to cheat files" },
{ OPTION_CROSSHAIRPATH, "crosshair", OPTION_STRING, "path to crosshair files" },
- { OPTION_PLUGINSPATH, "plugins", OPTION_STRING, "path to plugin files" },
- { OPTION_LANGUAGEPATH, "language", OPTION_STRING, "path to UI translation files" },
+ { OPTION_PLUGINSPATH, "plugins;@mame@/plugins", OPTION_STRING, "path to plugin files" },
+ { OPTION_LANGUAGEPATH, "language;@mame@/language", OPTION_STRING, "path to UI translation files" },
{ OPTION_SWPATH, "software", OPTION_STRING, "path to loose software" },
// output directory options

View file

@ -0,0 +1,98 @@
{ lib
, stdenv
, fetchurl
, SDL2
, SDL2_net
, alsa-lib
, flac
, freeglut
, libGL
, libGLU
, libX11
, libcdio
, libjack2
, libsamplerate
, libsndfile
, pkg-config
, zlib
, libiconv
}:
stdenv.mkDerivation rec {
pname = "mednafen";
version = "1.29.0";
src = fetchurl {
url = "https://mednafen.github.io/releases/files/${pname}-${version}.tar.xz";
hash = "sha256-2j+88Ch3+b4PAov6XRy1npU6QEm5D+fjk4ijOG2fNi4=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
SDL2
SDL2_net
flac
freeglut
libcdio
libjack2
libsamplerate
libsndfile
zlib
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
libGL
libGLU
libX11
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
hardeningDisable = [ "pic" "format" ];
enableParallelBuilding = true;
postInstall = ''
mkdir -p $out/share/doc
mv Documentation $out/share/doc/mednafen
'';
meta = with lib; {
homepage = "https://mednafen.github.io/";
description = "A portable, CLI-driven, SDL+OpenGL-based, multi-system emulator";
longDescription = ''
Mednafen is a portable, utilizing OpenGL and SDL,
argument(command-line)-driven multi-system emulator. Mednafen has the
ability to remap hotkey functions and virtual system inputs to a keyboard,
a joystick, or both simultaneously. Save states are supported, as is
real-time game rewinding. Screen snapshots may be taken, in the PNG file
format, at the press of a button. Mednafen can record audiovisual movies
in the QuickTime file format, with several different lossless codecs
supported.
The following systems are supported (refer to the emulation module
documentation for more details):
- Apple II/II+
- Atari Lynx
- Neo Geo Pocket (Color)
- WonderSwan
- GameBoy (Color)
- GameBoy Advance
- Nintendo Entertainment System
- Super Nintendo Entertainment System/Super Famicom
- Virtual Boy
- PC Engine/TurboGrafx 16 (CD)
- SuperGrafx
- PC-FX
- Sega Game Gear
- Sega Genesis/Megadrive
- Sega Master System
- Sega Saturn (experimental, x86_64 only)
- Sony PlayStation
'';
license = licenses.gpl2Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,21 @@
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "mednafen-server";
version = "0.5.2";
src = fetchurl {
url = "https://mednafen.github.io/releases/files/mednafen-server-${version}.tar.xz";
sha256 = "0xm7dj5nwnrsv69r72rcnlw03jm0l8rmrg3s05gjfvxyqmlb36dq";
};
postInstall = "install -m 644 -Dt $out/share/mednafen-server standard.conf";
meta = with lib; {
description = "Netplay server for Mednafen";
homepage = "https://mednafen.github.io/";
license = licenses.gpl2;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,41 @@
{ stdenv
, lib
, fetchFromGitHub
, autoreconfHook
, pkg-config
, mednafen
, gtk3
, wrapGAppsHook
}:
stdenv.mkDerivation rec {
pname = "mednaffe";
version = "0.9.2";
src = fetchFromGitHub {
owner = "AmatCoder";
repo = "mednaffe";
rev = version;
sha256 = "sha256-zvSAt6CMcgdoPpTTA5sPlQaWUw9LUMsR2Xg9jM2UaWY=";
};
nativeBuildInputs = [ autoreconfHook pkg-config wrapGAppsHook ];
buildInputs = [ gtk3 mednafen ];
enableParallelBuilding = true;
preFixup = ''
gappsWrapperArgs+=(
--prefix PATH ':' "${mednafen}/bin"
)
'';
meta = with lib; {
description = "GTK-based frontend for mednafen emulator";
homepage = "https://github.com/AmatCoder/mednaffe";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ sheenobu yana AndersonTorres ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,43 @@
{ lib
, fetchFromGitHub
, mkDerivation
, cmake
, libepoxy
, libarchive
, libpcap
, libslirp
, pkg-config
, qtbase
, SDL2
}:
mkDerivation rec {
pname = "melonDS";
version = "0.9.4";
src = fetchFromGitHub {
owner = "Arisotura";
repo = pname;
rev = version;
sha256 = "sha256-FSacau7DixU6R4eKNIYVRZiMb/GhijTzHbcGlZ6WG/I=";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [
libepoxy
libarchive
libslirp
qtbase
SDL2
];
qtWrapperArgs = [ "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpcap ]}" ];
meta = with lib; {
homepage = "http://melonds.kuribo64.net/";
description = "Work in progress Nintendo DS emulator";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ artemist benley shamilton xfix ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,87 @@
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, cmake
, libepoxy
, ffmpeg_4
, imagemagick
, libedit
, libelf
, libzip
, makeDesktopItem
, minizip
, pkg-config
, qtbase
, qtmultimedia
, qttools
, wrapQtAppsHook
}:
stdenv.mkDerivation rec {
pname = "mgba";
version = "0.9.3";
src = fetchFromGitHub {
owner = "mgba-emu";
repo = "mgba";
rev = version;
hash = "sha256-0ZtoyyoD+YjplJlPFpZgIg5119j/6X8ZaSZP+UpX5K0=";
};
nativeBuildInputs = [
cmake
pkg-config
wrapQtAppsHook
];
buildInputs = [
SDL2
libepoxy
ffmpeg_4
imagemagick
libedit
libelf
libzip
minizip
qtbase
qtmultimedia
qttools
];
desktopItems = [
(makeDesktopItem {
name = "mgba";
exec = "mgba-qt";
icon = "mgba";
comment = "A Game Boy Advance Emulator";
desktopName = "mgba";
genericName = "Game Boy Advance Emulator";
categories = [ "Game" "Emulator" ];
startupNotify = false;
})
];
meta = with lib; {
homepage = "https://mgba.io";
description = "A modern GBA emulator with a focus on accuracy";
longDescription = ''
mGBA is a new Game Boy Advance emulator written in C.
The project started in April 2013 with the goal of being fast enough to
run on lower end hardware than other emulators support, without
sacrificing accuracy or portability. Even in the initial version, games
generally play without problems. It is loosely based on the previous
GBA.js emulator, although very little of GBA.js can still be seen in mGBA.
Other goals include accurate enough emulation to provide a development
environment for homebrew software, a good workflow for tool-assist
runners, and a modern feature set for emulators that older emulators may
not support.
'';
license = licenses.mpl20;
maintainers = with maintainers; [ MP2E AndersonTorres ];
platforms = platforms.linux;
};
}
# TODO: use desktopItem functions

View file

@ -0,0 +1,42 @@
{lib, stdenv, fetchurl, fetchpatch, boost, dash, freetype, libpng, pkg-config, SDL, which, zlib, nasm }:
stdenv.mkDerivation rec {
pname = "mupen64plus";
version = "2.5.9";
src = fetchurl {
url = "https://github.com/mupen64plus/mupen64plus-core/releases/download/${version}/mupen64plus-bundle-src-${version}.tar.gz";
sha256 = "1a21n4gqdvag6krwcjm5bnyw5phrlxw6m0mk73jy53iq03f3s96m";
};
patches = [
# Pull upstream fix for -fno-common toolchains:
# https://github.com/mupen64plus/mupen64plus-core/pull/736
(fetchpatch {
name = "fno-common.patch";
url = "https://github.com/mupen64plus/mupen64plus-core/commit/39975200ad4926cfc79c96609b64696289065502.patch";
sha256 = "0kdshp9xdkharn3d1g1pvxhh761pa1v5w07iq0wf9l380r2m6gbv";
# a/something -> a/source/mupen64plus-core/something
stripLen = 1;
extraPrefix = "source/mupen64plus-core/";
})
];
nativeBuildInputs = [ pkg-config nasm ];
buildInputs = [ boost dash freetype libpng SDL which zlib ];
buildPhase = ''
dash m64p_build.sh PREFIX="$out" COREDIR="$out/lib/" PLUGINDIR="$out/lib/mupen64plus" SHAREDIR="$out/share/mupen64plus"
'';
installPhase = ''
dash m64p_install.sh DESTDIR="$out" PREFIX=""
'';
meta = with lib; {
description = "A Nintendo 64 Emulator";
license = licenses.gpl2Plus;
homepage = "http://www.mupen64plus.org/";
maintainers = [ maintainers.sander ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -0,0 +1,18 @@
diff -wbBur rdanbrook-nestopia-f1dde9b/Makefile rdanbrook-nestopia-f1dde9b.my/Makefile
--- rdanbrook-nestopia-f1dde9b/Makefile 2013-01-20 20:10:25.000000000 +0400
+++ rdanbrook-nestopia-f1dde9b.my/Makefile 2013-01-21 15:18:54.727577673 +0400
@@ -197,11 +197,11 @@
install -m 0644 NstDatabase.xml $(DATADIR)
install -m 0644 source/unix/icons/*.png $(DATADIR)/icons
install -m 0644 source/unix/icons/*.svg $(DATADIR)/icons
- install -m 0644 source/unix/icons/nestopia.svg $(PREFIX)/share/pixmaps
- xdg-desktop-menu install --novendor $(DATADIR)/nestopia.desktop
+ install -m 0644 source/unix/icons/nestopia.svg $(PREFIX)/share/pixmaps/nestopia.svg
+ install -Dm0644 $(DATADIR)/nestopia.desktop $(PREFIX)/share/applications/nestopia.desktop
uninstall:
- xdg-desktop-menu uninstall $(DATADIR)/nestopia.desktop
+ rm $(PREFIX)/share/applications/nestopia.desktop
rm $(PREFIX)/share/pixmaps/nestopia.svg
rm $(BINDIR)/$(BIN)
rm -rf $(DATADIR)

View file

@ -0,0 +1,72 @@
{ lib, stdenv, fetchFromGitHub, pkg-config, SDL2, alsa-lib, gtk3
, makeWrapper, libGLU, libGL, libarchive, libao, unzip, xdg-utils
, libepoxy, gdk-pixbuf, gnome, wrapGAppsHook
}:
stdenv.mkDerivation rec {
version = "1.47";
pname = "nestopia";
src = fetchFromGitHub {
owner = "rdanbrook";
repo = "nestopia";
rev = version;
sha256 = "0frr0gvjh5mxzdhj0ii3sh671slgnzlm8naqlc4h87rx4p4sz2y2";
};
# nondeterministic failures when creating directories
enableParallelBuilding = false;
hardeningDisable = [ "format" ];
buildInputs = [
SDL2
alsa-lib
libepoxy
gtk3
gdk-pixbuf
libGLU libGL
libarchive
libao
xdg-utils
gnome.adwaita-icon-theme
];
nativeBuildInputs = [
pkg-config
makeWrapper
wrapGAppsHook
unzip
];
installPhase = ''
mkdir -p $out/{bin,share/nestopia}
make install PREFIX=$out
'';
preFixup = ''
for f in $out/bin/*; do
wrapProgram $f \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share"
done
'';
patches = [
#(fetchpatch {
# url = "https://github.com/rdanbrook/nestopia/commit/f4bc74ac4954328b25e961e7afb7337377084079.patch";
# name = "gcc6.patch";
# sha256 = "1jy0c85xsfk9hrv5a6v0kk48d94864qb62yyni9fp93kyl33y2p4";
#})
./gcc6.patch
./build-fix.patch
];
meta = {
homepage = "http://0ldsk00l.ca/nestopia/";
description = "NES emulator with a focus on accuracy";
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ MP2E ];
};
}

View file

@ -0,0 +1,92 @@
From f4bc74ac4954328b25e961e7afb7337377084079 Mon Sep 17 00:00:00 2001
From: David Seifert <soap@gentoo.org>
Date: Sat, 31 Dec 2016 18:21:18 +0200
Subject: [PATCH] Fix compiling in C++14 mode
* Left shifting a negative signed is undefined behaviour
* Fix incorrect printf() specifiers found with -Wformat
---
source/core/NstCore.hpp | 4 ++--
source/unix/gtkui/gtkui.cpp | 2 +-
source/unix/gtkui/gtkui.h | 1 -
source/unix/gtkui/gtkui_cheats.cpp | 8 ++++----
source/unix/video.cpp | 2 +-
5 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/source/core/NstCore.hpp b/source/core/NstCore.hpp
index 50e20f6..420cc4a 100644
--- a/source/core/NstCore.hpp
+++ b/source/core/NstCore.hpp
@@ -279,14 +279,14 @@ namespace Nes
template<typename T>
inline long signed_shl(T v,uint c)
{
- enum {NATIVE = T(-7) << 1 == -14};
+ enum {NATIVE = -(T(7) << 1) == -14};
return Helper::ShiftSigned<T,NATIVE>::Left( v, c );
}
template<typename T>
inline long signed_shr(T v,uint c)
{
- enum {NATIVE = T(-7) >> 1 == -4 || T(-7) >> 1 == -3};
+ enum {NATIVE = -(T(7) >> 1) == -4 || -(T(7) >> 1) == -3};
return Helper::ShiftSigned<T,NATIVE>::Right( v, c );
}
diff --git a/source/unix/gtkui/gtkui.cpp b/source/unix/gtkui/gtkui.cpp
index 3cfeeab..d4a5e2d 100644
--- a/source/unix/gtkui/gtkui.cpp
+++ b/source/unix/gtkui/gtkui.cpp
@@ -438,7 +438,7 @@ void gtkui_message(const char* message) {
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
- message);
+ "%s", message);
gtk_dialog_run(GTK_DIALOG(messagewindow));
gtk_widget_destroy(messagewindow);
}
diff --git a/source/unix/gtkui/gtkui_cheats.cpp b/source/unix/gtkui/gtkui_cheats.cpp
index afc01b0..e7b691a 100644
--- a/source/unix/gtkui/gtkui_cheats.cpp
+++ b/source/unix/gtkui/gtkui_cheats.cpp
@@ -373,7 +373,7 @@ void gtkui_cheats_fill_tree(char *filename) {
else if (node.GetChild(L"address")) { // Raw
char rawbuf[11];
snprintf(rawbuf, sizeof(rawbuf),
- "%04x %02x %02x",
+ "%04lu %02lu %02lu",
node.GetChild(L"address").GetUnsignedValue(),
node.GetChild(L"value").GetUnsignedValue(),
node.GetChild(L"compare").GetUnsignedValue());
@@ -545,13 +545,13 @@ gboolean gtkui_cheats_scan_list(GtkTreeModel *model, GtkTreePath *path, GtkTreeI
int addr, value, compare;
char buf[5];
- snprintf(buf, sizeof(buf), "%c%c%c%c\0", rawcode[0], rawcode[1], rawcode[2], rawcode[3]);
+ snprintf(buf, sizeof(buf), "%c%c%c%c", rawcode[0], rawcode[1], rawcode[2], rawcode[3]);
sscanf(buf, "%x", &addr);
- snprintf(buf, sizeof(buf), "%c%c\0", rawcode[5], rawcode[6]);
+ snprintf(buf, sizeof(buf), "%c%c", rawcode[5], rawcode[6]);
sscanf(buf, "%x", &value);
- snprintf(buf, sizeof(buf), "%c%c\0", rawcode[8], rawcode[9]);
+ snprintf(buf, sizeof(buf), "%c%c", rawcode[8], rawcode[9]);
sscanf(buf, "%x", &compare);
code.address = addr;
diff --git a/source/unix/video.cpp b/source/unix/video.cpp
index 3eff19d..c34bb22 100644
--- a/source/unix/video.cpp
+++ b/source/unix/video.cpp
@@ -757,7 +757,7 @@ void video_screenshot(const char* filename) {
if (filename == NULL) {
// Set the filename
char sshotpath[512];
- snprintf(sshotpath, sizeof(sshotpath), "%sscreenshots/%s-%d-%d.png", nstpaths.nstdir, nstpaths.gamename, time(NULL), rand() % 899 + 100);
+ snprintf(sshotpath, sizeof(sshotpath), "%sscreenshots/%s-%ld-%d.png", nstpaths.nstdir, nstpaths.gamename, time(NULL), rand() % 899 + 100);
// Save the file
lodepng_encode32_file(sshotpath, (const unsigned char*)pixels, rendersize.w, rendersize.h);

View file

@ -0,0 +1,199 @@
{ stdenv
, lib
, fetchFromGitHub
, enable16Bit ? true
, enable32Bit ? true
, enableSDL ? true
, withSDLVersion ? "2"
, SDL
, SDL_ttf
, SDL_mixer
, SDL2
, SDL2_ttf
, SDL2_mixer
, enableX11 ? stdenv.hostPlatform.isLinux
, automake
, autoconf
, autoconf-archive
, libtool
, pkg-config
, unzip
, gtk2
, libusb1
, libXxf86vm
, nasm
, libICE
, libSM
# HAXM build succeeds but the binary segfaults, seemingly due to the missing HAXM kernel module
# Enable once there is a HAXM kernel module option in NixOS? Or somehow bind it to the system kernel having HAXM?
# Or leave it disabled by default?
# https://github.com/intel/haxm/blob/master/docs/manual-linux.md
, enableHAXM ? false
}:
assert lib.assertMsg (enable16Bit || enable32Bit)
"Must enable 16-Bit and/or 32-Bit system variant.";
assert lib.assertMsg (enableSDL || enableX11)
"Must enable SDL and/or X11 graphics interfaces.";
assert lib.assertOneOf "withSDLVersion" withSDLVersion [ "1" "2" ];
assert enableHAXM -> (lib.assertMsg enableX11
"Must enable X11 graphics interface for HAXM build.");
let
inherit (lib) optional optionals optionalString;
inherit (lib.strings) concatStringsSep concatMapStringsSep;
isSDL2 = (withSDLVersion == "2");
sdlInfix = optionalString isSDL2 "2";
sdlDeps1 = [
SDL
SDL_ttf
SDL_mixer
];
sdlDeps2 = [
SDL2
SDL2_ttf
SDL2_mixer
];
sdlDepsBuildonly = if isSDL2 then sdlDeps1 else sdlDeps2;
sdlDepsTarget = if isSDL2 then sdlDeps2 else sdlDeps1;
sdlMakefileSuffix =
if stdenv.hostPlatform.isWindows then "win"
else if stdenv.hostPlatform.isDarwin then "mac"
else "unix";
sdlMakefiles = concatMapStringsSep " " (x: x + "." + sdlMakefileSuffix)
(optionals enable16Bit [
"Makefile"
] ++ optionals enable32Bit [
"Makefile21"
]);
sdlBuildFlags = concatStringsSep " "
(optionals enableSDL [
"SDL_VERSION=${withSDLVersion}"
]);
sdlBins = concatStringsSep " "
(optionals enable16Bit [
"np2kai"
] ++ optionals enable32Bit [
"np21kai"
]);
x11ConfigureFlags = concatStringsSep " "
((
if ((enableHAXM && (enable16Bit || enable32Bit)) || (enable16Bit && enable32Bit)) then [
"--enable-build-all"
] else if enableHAXM then [
"--enable-haxm"
] else if enable32Bit then [
"--enable-ia32"
] else [ ]
) ++ optionals (!isSDL2) [
"--enable-sdl"
"--enable-sdlmixer"
"--enable-sdlttf"
"--enable-sdl2=no"
"--enable-sdl2mixer=no"
"--enable-sdl2ttf=no"
]);
x11BuildFlags = concatStringsSep " " [
"SDL2_CONFIG=sdl2-config"
"SDL_CONFIG=sdl-config"
"SDL_CFLAGS=\"$(sdl${sdlInfix}-config --cflags)\""
"SDL_LIBS=\"$(sdl${sdlInfix}-config --libs) -lSDL${sdlInfix}_mixer -lSDL${sdlInfix}_ttf\""
];
x11Bins = concatStringsSep " "
(optionals enable16Bit [
"xnp2kai"
] ++ optionals enable32Bit [
"xnp21kai"
] ++ optionals enableHAXM [
"xnp21kai_haxm"
]);
in
stdenv.mkDerivation rec {
pname = "np2kai";
version = "0.86rev22"; #update src.rev to commit rev accordingly
src = fetchFromGitHub rec {
owner = "AZO234";
repo = "NP2kai";
rev = "4a317747724669343e4c33ebdd34783fb7043221";
sha256 = "0kxysxhx6jyk82mx30ni0ydzmwdcbnlxlnarrlq018rsnwb4md72";
};
configurePhase = ''
export GIT_VERSION=${builtins.substring 0 7 src.rev}
buildFlags="$buildFlags ''${enableParallelBuilding:+-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES}"
'' + optionalString enableX11 ''
cd x11
substituteInPlace Makefile.am \
--replace 'GIT_VERSION :=' 'GIT_VERSION ?='
./autogen.sh ${x11ConfigureFlags}
./configure ${x11ConfigureFlags}
cd ..
'';
nativeBuildInputs = sdlDepsBuildonly
++ optionals enableX11 [
automake
autoconf
autoconf-archive
libtool
pkg-config
unzip
nasm
];
buildInputs = sdlDepsTarget
++ optionals enableX11 [
gtk2
libICE
libSM
libusb1
libXxf86vm
];
enableParallelBuilding = true;
# TODO Remove when bumping past rev22
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-D_DARWIN_C_SOURCE";
buildPhase = optionalString enableSDL ''
cd sdl2
for mkfile in ${sdlMakefiles}; do
substituteInPlace $mkfile \
--replace 'GIT_VERSION :=' 'GIT_VERSION ?='
echo make -f $mkfile $buildFlags ${sdlBuildFlags} clean
make -f $mkfile $buildFlags ${sdlBuildFlags} clean
make -f $mkfile $buildFlags ${sdlBuildFlags}
done
cd ..
'' + optionalString enableX11 ''
cd x11
make $buildFlags ${x11BuildFlags}
cd ..
'';
installPhase = optionalString enableSDL ''
cd sdl2
for emu in ${sdlBins}; do
install -D -m 755 $emu $out/bin/$emu
done
cd ..
'' + optionalString enableX11 ''
cd x11
for emu in ${x11Bins}; do
install -D -m 755 $emu $out/bin/$emu
done
cd ..
'';
meta = with lib; {
description = "A PC-9801 series emulator";
homepage = "https://github.com/AZO234/NP2kai";
license = licenses.mit;
maintainers = with maintainers; [ OPNA2608 ];
platforms = platforms.x86;
};
}

View file

@ -0,0 +1,27 @@
{ lib, stdenv, fetchFromGitHub, SDL2 }:
stdenv.mkDerivation {
pname = "oberon-risc-emu";
version = "unstable-2020-08-18";
src = fetchFromGitHub {
owner = "pdewacht";
repo = "oberon-risc-emu";
rev = "26c8ac5737c71811803c87ad51f1f0d6e62e71fe";
sha256 = "1iriix3cfcpbkjb5xjb4ysh592xppgprwzp3b6qhwcx44g7kdvxq";
};
buildInputs = [ SDL2 ];
installPhase = ''
mkdir -p $out/bin
mv risc $out/bin
'';
meta = with lib; {
homepage = "https://github.com/pdewacht/oberon-risc-emu/";
description = "Emulator for the Oberon RISC machine";
license = licenses.isc;
maintainers = with maintainers; [ siraben ];
};
}

View file

@ -0,0 +1,9 @@
# This file substitutes $sourceRoot/build/custom.mk
VERSION_EXEC:=false
SYMLINK_FOR_BINARY:=false
INSTALL_CONTRIB:=true
INSTALL_BASE:=${out}
INSTALL_DOC_DIR:=${INSTALL_BASE}/share/doc/openmsx
INSTALL_SHARE_DIR:=${INSTALL_BASE}/share/openmsx
INSTALL_BINARY_DIR:=${INSTALL_BASE}/bin

View file

@ -0,0 +1,75 @@
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, SDL2
, SDL2_image
, SDL2_ttf
, alsa-lib
, freetype
, glew
, libGL
, libogg
, libpng
, libtheora
, libvorbis
, python
, tcl
, zlib
}:
stdenv.mkDerivation rec {
pname = "openmsx";
version = "17.0";
src = fetchFromGitHub {
owner = "openMSX";
repo = "openMSX";
rev = "RELEASE_${builtins.replaceStrings ["."] ["_"] version}";
sha256 = "sha256-9PdUNahJZ2O6ASkzLW/uudP3hiIzTDpxzFy6Pjb8JiU=";
fetchSubmodules = true;
};
nativeBuildInputs = [
pkg-config
python
];
buildInputs = [
SDL2
SDL2_image
SDL2_ttf
alsa-lib
freetype
glew
libGL
libogg
libpng
libtheora
libvorbis
tcl
zlib
];
postPatch = ''
cp ${./custom-nix.mk} build/custom.mk
'';
dontAddPrefix = true;
# Many thanks @mthuurne from OpenMSX project for providing support to
# Nixpkgs! :)
TCL_CONFIG="${tcl}/lib/";
meta = with lib; {
homepage = "https://openmsx.org";
description = "The MSX emulator that aims for perfection";
longDescription = ''
OpenMSX is an emulator for the MSX home computer system. Its goal is
to emulate all aspects of the MSX with 100% accuracy.
'';
license = with licenses; [ bsd2 boost gpl2Plus ];
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,29 @@
{ stdenv, lib, fetchzip, wxGTK31, coreutils, SDL2, openal, alsa-lib, pkg-config
, autoreconfHook, withNetworking ? true, withALSA ? true }:
stdenv.mkDerivation rec {
pname = "pcem";
version = "17";
src = fetchzip {
url = "https://pcem-emulator.co.uk/files/PCemV${version}Linux.tar.gz";
stripRoot = false;
sha256 = "067pbnc15h6a4pnnym82klr1w8qwfm6p0pkx93gx06wvwqsxvbdv";
};
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ wxGTK31 coreutils SDL2 openal ]
++ lib.optional withALSA alsa-lib;
configureFlags = [ "--enable-release-build" ]
++ lib.optional withNetworking "--enable-networking"
++ lib.optional withALSA "--enable-alsa";
meta = with lib; {
description = "Emulator for IBM PC computers and clones";
homepage = "https://pcem-emulator.co.uk/";
license = licenses.gpl2Only;
maintainers = [ maintainers.terin ];
platforms = platforms.linux ++ platforms.windows;
};
}

View file

@ -0,0 +1,110 @@
{ alsa-lib
, cmake
, fetchFromGitHub
, fmt
, gettext
, glib
, gtk3
, harfbuzz
, lib
, libaio
, libpcap
, libpng
, libpulseaudio
, libsamplerate
, libXdmcp
, openssl
, pcre
, perl
, pkg-config
, portaudio
, SDL2
, soundtouch
, stdenv
, udev
, vulkan-headers
, vulkan-loader
, wrapGAppsHook
, wxGTK
, zlib
, wayland
}:
stdenv.mkDerivation rec {
pname = "pcsx2";
version = "1.7.2731";
src = fetchFromGitHub {
owner = "PCSX2";
repo = "pcsx2";
fetchSubmodules = true;
rev = "v${version}";
hash = "sha256-b3cK3ly9J44YMy/cNprlDCSsu8+DrlhRSLXv5xMouWo=";
};
cmakeFlags = [
"-DDISABLE_ADVANCE_SIMD=TRUE"
"-DDISABLE_PCSX2_WRAPPER=TRUE"
"-DPACKAGE_MODE=TRUE"
"-DWAYLAND_API=TRUE"
"-DXDG_STD=TRUE"
"-DUSE_VULKAN=TRUE"
];
nativeBuildInputs = [ cmake perl pkg-config vulkan-headers wrapGAppsHook ];
buildInputs = [
alsa-lib
fmt
gettext
glib
gtk3
harfbuzz
libaio
libpcap
libpng
libpulseaudio
libsamplerate
libXdmcp
openssl
pcre
portaudio
SDL2
soundtouch
udev
vulkan-loader
wayland
wxGTK
zlib
];
# Wayland doesn't seem to work right now (crashes when booting a game).
# Try removing `--prefix GDK_BACKEND : x11` on the next update.
# (This may be solved when the project finshes migrating to Qt)
preFixup = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]}
--prefix GDK_BACKEND : x11
)
'';
meta = with lib; {
description = "Playstation 2 emulator";
longDescription = ''
PCSX2 is an open-source PlayStation 2 (AKA PS2) emulator. Its purpose
is to emulate the PS2 hardware, using a combination of MIPS CPU
Interpreters, Recompilers and a Virtual Machine which manages hardware
states and PS2 system memory. This allows you to play PS2 games on your
PC, with many additional features and benefits.
'';
homepage = "https://pcsx2.net";
maintainers = with maintainers; [ hrdinka govanify ];
# PCSX2's source code is released under LGPLv3+. It However ships
# additional data files and code that are licensed differently.
# This might be solved in future, for now we should stick with
# license.free
license = licenses.free;
platforms = platforms.x86_64;
};
}

View file

@ -0,0 +1,76 @@
From 351be6b3f2ad10d86ec4ae711db5a1067acc592a Mon Sep 17 00:00:00 2001
From: Zane van Iperen <zane@zanevaniperen.com>
Date: Sun, 7 Nov 2021 15:17:07 +1000
Subject: [PATCH] libpcsxcore: fix build with ffmpeg 4
---
libpcsxcore/cdriso.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c
index f89678e..6314482 100644
--- a/libpcsxcore/cdriso.c
+++ b/libpcsxcore/cdriso.c
@@ -266,14 +266,14 @@ static int decode_compressed_cdda_track(FILE* outfile, const char* infilepath, s
}
if (!decoded_frame) {
- if (!(decoded_frame = avcodec_alloc_frame())) {
+ if (!(decoded_frame = av_frame_alloc())) {
SysMessage(_(" -> Error allocating audio frame buffer. This track will not be available."));
avformat_close_input(&inAudioFormat);
- avcodec_free_frame(&decoded_frame);
+ av_frame_free(&decoded_frame);
return 1; // error decoding frame
}
} else {
- avcodec_get_frame_defaults(decoded_frame);
+ av_frame_unref(decoded_frame);
}
len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
if (len > 0 && got_frame) {
@@ -285,7 +285,7 @@ static int decode_compressed_cdda_track(FILE* outfile, const char* infilepath, s
fwrite(decoded_frame->data[0], 1, data_size, outfile);
}
av_free_packet(&avpkt);
- //avcodec_free_frame(&decoded_frame);
+ //av_frame_free(&decoded_frame);
} while (moreFrames >= 0); // TODO: check for possible leaks
// file will be closed later on, now just flush it
@@ -294,7 +294,7 @@ static int decode_compressed_cdda_track(FILE* outfile, const char* infilepath, s
avformat_close_input(&inAudioFormat);
//avcodec_close(c);
//av_free(c);
- avcodec_free_frame(&decoded_frame);
+ av_frame_free(&decoded_frame);
return 0;
}
#endif
@@ -340,12 +340,12 @@ static int decode_compressed_cdda_track(FILE* outfile, FILE* infile, enum AVCode
while (avpkt.size > 0) {
int got_frame = 0;
if (!decoded_frame) {
- if (!(decoded_frame = avcodec_alloc_frame())) {
+ if (!(decoded_frame = av_frame_alloc())) {
SysPrintf(" -> Error allocating audio frame buffer. Track will not be available.");
return 1; // error decoding frame
}
} else {
- avcodec_get_frame_defaults(decoded_frame);
+ av_frame_unref(decoded_frame);
}
len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
@@ -383,7 +383,7 @@ static int decode_compressed_cdda_track(FILE* outfile, FILE* infile, enum AVCode
avcodec_close(c);
av_free(c);
- avcodec_free_frame(&decoded_frame);
+ av_frame_free(&decoded_frame);
return 0;
}
#endif
--
2.31.1

View file

@ -0,0 +1,96 @@
{ lib, stdenv, fetchurl, autoreconfHook, intltool, pkg-config, gtk3, SDL2, xorg
, wrapGAppsHook, libcdio, nasm, ffmpeg, file
, fetchpatch }:
stdenv.mkDerivation rec {
pname = "pcsxr";
version = "1.9.94";
# codeplex does not support direct downloading
src = fetchurl {
url = "mirror://debian/pool/main/p/pcsxr/pcsxr_${version}.orig.tar.xz";
sha256 = "0q7nj0z687lmss7sgr93ij6my4dmhkm2nhjvlwx48dn2lxl6ndla";
};
patches = [
( fetchpatch {
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/01_fix-i386-exec-stack.patch";
sha256 = "17497wjxd6b92bj458s2769d9bpp68ydbvmfs9gp51yhnq4zl81x";
})
( fetchpatch {
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/02_disable-ppc-auto-dynarec.patch";
sha256 = "0v8n79z034w6cqdrzhgd9fkdpri42mzvkdjm19x4asz94gg2i2kf";
})
( fetchpatch {
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/03_fix-plugin-dir.patch";
sha256 = "0vkl0mv6whqaz79kvvvlmlmjpynyq4lh352j3bbxcr0vjqffxvsy";
})
( fetchpatch {
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/04_update-homedir-symlinks.patch";
sha256 = "18r6n025ybr8fljfsaqm4ap31wp8838j73lrsffi49fkis60dp4j";
})
( fetchpatch {
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/05_format-security.patch";
sha256 = "03m4kfc9bk5669hf7ji1anild08diliapx634f9cigyxh72jcvni";
})
( fetchpatch {
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/06_warnings.patch";
sha256 = "0iz3g9ihnhisfgrzma9l74y4lhh57na9h41bmiam1millb796g71";
})
( fetchpatch {
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/07_non-linux-ip-addr.patch";
sha256 = "14vb9l0l4nzxcymhjjs4q57nmsncmby9qpdr7c19rly5wavm4k77";
})
( fetchpatch {
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/08_reproducible.patch";
sha256 = "1cx9q59drsk9h6l31097lg4aanaj93ysdz5p88pg9c7wvxk1qz06";
})
./uncompress2.patch
./0001-libpcsxcore-fix-build-with-ffmpeg-4.patch
];
nativeBuildInputs = [ autoreconfHook intltool pkg-config wrapGAppsHook ];
buildInputs = [
gtk3 SDL2 xorg.libXv xorg.libXtst libcdio nasm ffmpeg file
xorg.libXxf86vm
];
# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: AboutDlg.o:/build/pcsxr/gui/Linux.h:42: multiple definition of `cfgfile';
# LnxMain.o:/build/pcsxr/gui/Linux.h:42: first defined here
NIX_CFLAGS_COMPILE = "-fcommon";
dynarecTarget =
if stdenv.isx86_64 then "x86_64"
else if stdenv.isi686 then "x86"
else "no"; #debian patch 2 says ppc doesn't work
configureFlags = [
"--enable-opengl"
"--enable-ccdda"
"--enable-libcdio"
"--enable-dynarec=${dynarecTarget}"
];
postInstall = ''
mkdir -p "$out/share/doc/${pname}-${version}"
cp README \
AUTHORS \
doc/keys.txt \
doc/tweaks.txt \
ChangeLog.df \
ChangeLog \
"$out/share/doc/${pname}-${version}"
'';
meta = with lib; {
broken = stdenv.isDarwin;
description = "Playstation 1 emulator";
homepage = "https://github.com/iCatButler/pcsxr";
maintainers = with maintainers; [ rardiol ];
license = licenses.gpl2Plus;
platforms = platforms.all;
};
}

View file

@ -0,0 +1,20 @@
--- a/libpcsxcore/cdriso.c
+++ b/libpcsxcore/cdriso.c
@@ -1219,7 +1219,7 @@
return ret;
}
-static int uncompress2(void *out, unsigned long *out_size, void *in, unsigned long in_size)
+static int uncompress3(void *out, unsigned long *out_size, void *in, unsigned long in_size)
{
static z_stream z;
int ret = 0;
@@ -1298,7 +1298,7 @@
if (is_compressed) {
cdbuffer_size_expect = sizeof(compr_img->buff_raw[0]) << compr_img->block_shift;
cdbuffer_size = cdbuffer_size_expect;
- ret = uncompress2(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size);
+ ret = uncompress3(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size);
if (ret != 0) {
SysPrintf("uncompress failed with %d for block %d, sector %d\n",
ret, block, sector);

View file

@ -0,0 +1,72 @@
{ mkDerivation
, fetchFromGitHub
, SDL2
, cmake
, ffmpeg
, glew
, lib
, libzip
, pkg-config
, python3
, qtbase
, qtmultimedia
, snappy
, zlib
}:
mkDerivation rec {
pname = "ppsspp";
version = "1.12.3";
src = fetchFromGitHub {
owner = "hrydgard";
repo = pname;
rev = "v${version}";
fetchSubmodules = true;
sha256 = "sha256-S16rTB0svksW5MwrPV/+qpTK4uKZ7mFcmbOyEmMmzhY=";
};
postPatch = ''
substituteInPlace git-version.cmake --replace unknown ${src.rev}
substituteInPlace UI/NativeApp.cpp --replace /usr/share $out/share
'';
nativeBuildInputs = [ cmake pkg-config python3 ];
buildInputs = [
SDL2
ffmpeg
glew
libzip
qtbase
qtmultimedia
snappy
zlib
];
cmakeFlags = [
"-DHEADLESS=OFF"
"-DOpenGL_GL_PREFERENCE=GLVND"
"-DUSE_SYSTEM_FFMPEG=ON"
"-DUSE_SYSTEM_LIBZIP=ON"
"-DUSE_SYSTEM_SNAPPY=ON"
"-DUSING_QT_UI=ON"
];
installPhase = ''
runHook preInstall
mkdir -p $out/share/ppsspp
install -Dm555 PPSSPPQt $out/bin/ppsspp
mv assets $out/share/ppsspp
runHook postInstall
'';
meta = with lib; {
homepage = "https://www.ppsspp.org/";
description = "A HLE Playstation Portable emulator, written in C++";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.linux;
};
}
# TODO: add SDL headless port

View file

@ -0,0 +1,24 @@
{ lib, fetchFromGitHub, rustPlatform }:
rustPlatform.buildRustPackage rec {
pname = "proton-caller";
version = "3.1.0";
src = fetchFromGitHub {
owner = "caverym";
repo = pname;
rev = version;
sha256 = "sha256-eyHFKAGx8du4osoGDsMFzVE/TC/ZMPsx6mrWUPDCLJ4=";
};
cargoSha256 = "sha256-/4+r5rvRUqQL8EVIg/22ZytXyE4+SV4UEcXiEw4795U=";
meta = with lib; {
description = "Run Windows programs with Proton";
changelog = "https://github.com/caverym/proton-caller/releases/tag/${version}";
homepage = "https://github.com/caverym/proton-caller";
license = licenses.mit;
maintainers = with maintainers; [ kho-dialga ];
mainProgram = "proton-call";
};
}

View file

@ -0,0 +1,64 @@
{ mkDerivation
, stdenv
, lib
, fetchFromGitHub
, fetchpatch
, nix-update-script
, qtbase
, qtsvg
, qttools
, autoreconfHook
, cmake
, pkg-config
, ffmpeg
, libGLU
, alsa-lib
, libX11
, libXrandr
, sndio
}:
mkDerivation rec {
pname = "punes";
version = "0.109";
src = fetchFromGitHub {
owner = "punesemu";
repo = "puNES";
rev = "v${version}";
sha256 = "sha256-6aRtR/d8nhzmpN9QKSZ62jye7qjfO+FpRMCXkX4Yubk=";
};
postPatch = ''
substituteInPlace configure.ac \
--replace '`$PKG_CONFIG --variable=host_bins Qt5Core`/lrelease' '${qttools.dev}/bin/lrelease'
'';
nativeBuildInputs = [ autoreconfHook cmake pkg-config qttools ];
buildInputs = [ ffmpeg qtbase qtsvg libGLU ]
++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libX11 libXrandr ]
++ lib.optionals stdenv.hostPlatform.isBSD [ sndio ];
dontUseCmakeConfigure = true;
enableParallelBuilding = true;
configureFlags = [
"--prefix=${placeholder "out"}"
"--without-opengl-nvidia-cg"
"--with-ffmpeg"
];
passthru.updateScript = nix-update-script {
attrPath = pname;
};
meta = with lib; {
description = "Qt-based Nintendo Entertainment System emulator and NSF/NSFe Music Player";
homepage = "https://github.com/punesemu/puNES";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ OPNA2608 ];
platforms = with platforms; linux ++ freebsd ++ openbsd ++ windows;
};
}

View file

@ -0,0 +1,25 @@
{ lib, fetchPypi, buildPythonApplication }:
buildPythonApplication rec {
pname = "py65";
version = "1.1.0";
format = "wheel";
src = fetchPypi {
inherit pname version format;
sha256 = "Q7rjiHJ/Ew985vut/8fVAf/wWYW5aBPSvNPm8A6g1zg=";
};
meta = with lib; {
homepage = "https://py65.readthedocs.io/";
description = "Emulate 6502-based microcomputer systems in Python";
longDescription = ''
Py65 includes a program called Py65Mon that functions as a machine
language monitor. This kind of program is sometimes also called a
debugger. Py65Mon provides a command line with many convenient commands
for interacting with the simulated 6502-based system.
'';
license = licenses.bsd3;
maintainers = with maintainers; [ AndersonTorres ];
};
}

View file

@ -0,0 +1,21 @@
{ fetchFromGitHub, lib, stdenv, cmake, qt4 }:
stdenv.mkDerivation {
pname = "resim";
version = "unstable-2016-11-11";
src = fetchFromGitHub {
owner = "itszor";
repo = "resim";
rev = "cdc7808ceb7ba4ac00d0d08ca646b58615059150";
sha256 = "1743lngqxd7ai4k6cd4d1cf9h60z2pnvr2iynfs1zlpcj3w1hx0c";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ qt4 ];
installPhase = ''
mkdir -pv $out/{lib,bin}
cp -v libresim/libarmsim.so $out/lib/libarmsim.so
cp -v vc4emul/vc4emul $out/bin/vc4emul
'';
meta.license = lib.licenses.mit;
}

View file

@ -0,0 +1,892 @@
{ lib
, stdenv
, alsa-lib
, boost
, bzip2
, cmake
, curl
, fetchFromGitHub
, ffmpeg
, fluidsynth
, gcc10Stdenv
, gettext
, hexdump
, hidapi
, icu
, libaio
, libevdev
, libGL
, libGLU
, libjpeg
, libpcap
, libpng
, libvorbis
, libxml2
, libzip
, makeWrapper
, nasm
, openssl
, pcre
, pkg-config
, portaudio
, python3
, retroarch
, SDL
, sfml
, snappy
, udev
, which
, xorg
, xxd
, xz
, zlib
}:
let
hashesFile = builtins.fromJSON (builtins.readFile ./hashes.json);
getCoreSrc = core:
fetchFromGitHub (builtins.getAttr core hashesFile);
mkLibRetroCore =
{ core
, description
# Check https://github.com/libretro/libretro-core-info for license information
, license
, stdenvOverride ? stdenv
, src ? (getCoreSrc core)
, broken ? false
, version ? "unstable-2022-04-21"
, platforms ? retroarch.meta.platforms
# The resulting core file is based on core name
# Setting `normalizeCore` to `true` will convert `-` to `_` on the core filename
, normalizeCore ? true
, ...
}@args:
stdenvOverride.mkDerivation (
let
inherit (stdenvOverride) hostPlatform;
d2u = if normalizeCore then (lib.replaceChars [ "-" ] [ "_" ]) else (x: x);
in
(rec {
pname = "libretro-${core}";
inherit version src;
buildInputs = [ zlib ] ++ args.extraBuildInputs or [ ];
nativeBuildInputs = [ makeWrapper ] ++ args.extraNativeBuildInputs or [ ];
makefile = "Makefile.libretro";
makeFlags = [
"platform=${{
linux = "unix";
darwin = "osx";
windows = "win";
}.${hostPlatform.parsed.kernel.name} or hostPlatform.parsed.kernel.name}"
"ARCH=${{
armv7l = "arm";
armv6l = "arm";
i686 = "x86";
}.${hostPlatform.parsed.cpu.name} or hostPlatform.parsed.cpu.name}"
] ++ (args.makeFlags or [ ]);
coreDir = "${placeholder "out"}/lib/retroarch/cores";
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $coreDir
mv ${d2u args.core}_libretro${hostPlatform.extensions.sharedLibrary} $coreDir
makeWrapper ${retroarch}/bin/retroarch $out/bin/retroarch-${core} \
--add-flags "-L $coreDir/${d2u core}_libretro${hostPlatform.extensions.sharedLibrary} $@"
runHook postInstall
'';
enableParallelBuilding = true;
passthru = {
inherit core;
libretroCore = "/lib/retroarch/cores";
};
meta = with lib; {
inherit broken description license platforms;
homepage = "https://www.libretro.com/";
maintainers = with maintainers; [ edwtjo hrdinka MP2E thiagokokada ];
};
}) // builtins.removeAttrs args [ "core" "src" "description" "license" "makeFlags" ]
);
in
{
inherit mkLibRetroCore;
atari800 = mkLibRetroCore {
core = "atari800";
description = "Port of Atari800 to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
makeFlags = [ "GIT_VERSION=" ];
};
beetle-gba = mkLibRetroCore {
core = "mednafen-gba";
src = getCoreSrc "beetle-gba";
description = "Port of Mednafen's GameBoy Advance core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
beetle-lynx = mkLibRetroCore {
core = "mednafen-lynx";
src = getCoreSrc "beetle-lynx";
description = "Port of Mednafen's Lynx core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
beetle-ngp = mkLibRetroCore {
core = "mednafen-ngp";
src = getCoreSrc "beetle-ngp";
description = "Port of Mednafen's NeoGeo Pocket core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
beetle-pce-fast = mkLibRetroCore {
core = "mednafen-pce-fast";
src = getCoreSrc "beetle-pce-fast";
description = "Port of Mednafen's PC Engine core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
beetle-pcfx = mkLibRetroCore {
core = "mednafen-pcfx";
src = getCoreSrc "beetle-pcfx";
description = "Port of Mednafen's PCFX core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
beetle-psx = mkLibRetroCore {
core = "mednafen-psx";
src = getCoreSrc "beetle-psx";
description = "Port of Mednafen's PSX Engine core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
makeFlags = [ "HAVE_HW=0" "HAVE_LIGHTREC=1" ];
};
beetle-psx-hw = mkLibRetroCore {
core = "mednafen-psx-hw";
src = getCoreSrc "beetle-psx";
description = "Port of Mednafen's PSX Engine (with HW accel) core to libretro";
license = lib.licenses.gpl2Only;
extraBuildInputs = [ libGL libGLU ];
makefile = "Makefile";
makeFlags = [ "HAVE_VULKAN=1" "HAVE_OPENGL=1" "HAVE_HW=1" "HAVE_LIGHTREC=1" ];
};
beetle-saturn = mkLibRetroCore {
core = "mednafen-saturn";
src = getCoreSrc "beetle-saturn";
description = "Port of Mednafen's Saturn core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
platforms = [ "x86_64-linux" "aarch64-linux" ];
};
beetle-snes = mkLibRetroCore {
core = "mednafen-snes";
src = getCoreSrc "beetle-snes";
description = "Port of Mednafen's SNES core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
beetle-supergrafx = mkLibRetroCore {
core = "mednafen-supergrafx";
src = getCoreSrc "beetle-supergrafx";
description = "Port of Mednafen's SuperGrafx core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
beetle-vb = mkLibRetroCore {
core = "mednafen-vb";
src = getCoreSrc "beetle-vb";
description = "Port of Mednafen's VirtualBoy core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
beetle-wswan = mkLibRetroCore {
core = "mednafen-wswan";
src = getCoreSrc "beetle-wswan";
description = "Port of Mednafen's WonderSwan core to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
blastem = mkLibRetroCore {
core = "blastem";
description = "Port of BlastEm to libretro";
license = lib.licenses.gpl3Only;
};
bluemsx = mkLibRetroCore {
core = "bluemsx";
description = "Port of BlueMSX to libretro";
license = lib.licenses.gpl2Only;
};
bsnes = mkLibRetroCore {
core = "bsnes";
description = "Port of bsnes to libretro";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
};
bsnes-hd =
let
# linux = bsd
# https://github.com/DerKoun/bsnes-hd/blob/f0b6cf34e9780d53516977ed2de64137a8bcc3c5/bsnes/GNUmakefile#L37
platform = if stdenv.isDarwin then "macos" else "linux";
in
mkLibRetroCore {
core = "bsnes-hd-beta";
src = getCoreSrc "bsnes-hd";
description = "Port of bsnes-hd to libretro";
license = lib.licenses.gpl3Only;
makefile = "GNUmakefile";
makeFlags = [
"-C"
"bsnes"
"target=libretro"
"platform=${platform}"
];
extraBuildInputs = [ xorg.libX11 xorg.libXext ];
postBuild = "cd bsnes/out";
};
bsnes-mercury = mkLibRetroCore {
core = "bsnes-mercury-accuracy";
src = getCoreSrc "bsnes-mercury";
description = "Fork of bsnes with HLE DSP emulation restored";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
makeFlags = [ "PROFILE=accuracy" ];
};
bsnes-mercury-balanced = mkLibRetroCore {
core = "bsnes-mercury-balanced";
src = getCoreSrc "bsnes-mercury";
description = "Fork of bsnes with HLE DSP emulation restored";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
makeFlags = [ "PROFILE=balanced" ];
};
bsnes-mercury-performance = mkLibRetroCore {
core = "bsnes-mercury-performance";
src = getCoreSrc "bsnes-mercury";
description = "Fork of bsnes with HLE DSP emulation restored";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
makeFlags = [ "PROFILE=performance" ];
};
citra = mkLibRetroCore {
core = "citra";
description = "Port of Citra to libretro";
stdenvOverride = gcc10Stdenv;
license = lib.licenses.gpl2Plus;
extraBuildInputs = [ libGLU libGL boost ffmpeg nasm ];
makefile = "Makefile";
makeFlags = [ "HAVE_FFMPEG_STATIC=0" ];
};
desmume = mkLibRetroCore {
core = "desmume";
description = "libretro wrapper for desmume NDS emulator";
license = lib.licenses.gpl2Plus;
extraBuildInputs = [ libpcap libGLU libGL xorg.libX11 ];
preBuild = "cd desmume/src/frontend/libretro";
makeFlags = lib.optional stdenv.hostPlatform.isAarch32 "platform=armv-unix"
++ lib.optional (!stdenv.hostPlatform.isx86) "DESMUME_JIT=0";
};
desmume2015 = mkLibRetroCore {
core = "desmume2015";
description = "libretro wrapper for desmume NDS emulator from 2015";
license = lib.licenses.gpl2Plus;
extraBuildInputs = [ libpcap libGLU libGL xorg.libX11 ];
makeFlags = lib.optional stdenv.hostPlatform.isAarch32 "platform=armv-unix"
++ lib.optional (!stdenv.hostPlatform.isx86) "DESMUME_JIT=0";
preBuild = "cd desmume";
};
dolphin = mkLibRetroCore {
core = "dolphin";
description = "Port of Dolphin to libretro";
license = lib.licenses.gpl2Plus;
extraNativeBuildInputs = [ cmake curl pkg-config ];
extraBuildInputs = [
libGLU
libGL
pcre
sfml
gettext
hidapi
libevdev
udev
] ++ (with xorg; [ libSM libX11 libXi libpthreadstubs libxcb xcbutil libXext libXrandr libXinerama libXxf86vm ]);
makefile = "Makefile";
cmakeFlags = [
"-DLIBRETRO=ON"
"-DLIBRETRO_STATIC=1"
"-DENABLE_QT=OFF"
"-DENABLE_LTO=OFF"
"-DUSE_UPNP=OFF"
"-DUSE_DISCORD_PRESENCE=OFF"
];
dontUseCmakeBuildDir = true;
};
dosbox = mkLibRetroCore {
core = "dosbox";
description = "Port of DOSBox to libretro";
license = lib.licenses.gpl2Only;
stdenvOverride = gcc10Stdenv;
};
eightyone = mkLibRetroCore {
core = "81";
src = getCoreSrc "eightyone";
description = "Port of EightyOne to libretro";
license = lib.licenses.gpl3Only;
};
fbalpha2012 = mkLibRetroCore {
core = "fbalpha2012";
description = "Port of Final Burn Alpha ~2012 to libretro";
license = "Non-commercial";
makefile = "makefile.libretro";
preBuild = "cd svn-current/trunk";
};
fbneo = mkLibRetroCore {
core = "fbneo";
description = "Port of FBNeo to libretro";
license = "Non-commercial";
makefile = "Makefile";
preBuild = "cd src/burner/libretro";
};
fceumm = mkLibRetroCore {
core = "fceumm";
description = "FCEUmm libretro port";
license = lib.licenses.gpl2Only;
};
flycast = mkLibRetroCore {
core = "flycast";
description = "Flycast libretro port";
license = lib.licenses.gpl2Only;
extraBuildInputs = [ libGL libGLU ];
makefile = "Makefile";
makeFlags = lib.optional stdenv.hostPlatform.isAarch64 [ "platform=arm64" ];
platforms = [ "aarch64-linux" "x86_64-linux" ];
};
fmsx = mkLibRetroCore {
core = "fmsx";
description = "FMSX libretro port";
license = "Non-commercial";
makefile = "Makefile";
};
freeintv = mkLibRetroCore {
core = "freeintv";
description = "FreeIntv libretro port";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
};
gambatte = mkLibRetroCore {
core = "gambatte";
description = "Gambatte libretro port";
license = lib.licenses.gpl2Only;
};
genesis-plus-gx = mkLibRetroCore {
core = "genesis-plus-gx";
description = "Enhanced Genesis Plus libretro port";
license = "Non-commercial";
};
gpsp = mkLibRetroCore {
core = "gpsp";
description = "Port of gpSP to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
gw = mkLibRetroCore {
core = "gw";
description = "Port of Game and Watch to libretro";
license = lib.licenses.zlib;
makefile = "Makefile";
};
handy = mkLibRetroCore {
core = "handy";
description = "Port of Handy to libretro";
license = lib.licenses.zlib;
makefile = "Makefile";
};
hatari = mkLibRetroCore {
core = "hatari";
description = "Port of Hatari to libretro";
license = lib.licenses.gpl2Only;
extraBuildInputs = [ SDL zlib ];
extraNativeBuildInputs = [ which ];
dontConfigure = true;
makeFlags = [ "EXTERNAL_ZLIB=1" ];
};
mame = mkLibRetroCore {
core = "mame";
description = "Port of MAME to libretro";
license = with lib.licenses; [ bsd3 gpl2Plus ];
extraBuildInputs = [ alsa-lib libGLU libGL portaudio python3 xorg.libX11 ];
};
mame2000 = mkLibRetroCore {
core = "mame2000";
description = "Port of MAME ~2000 to libretro";
license = "MAME";
makefile = "Makefile";
makeFlags = lib.optional (!stdenv.hostPlatform.isx86) "IS_X86=0";
enableParallelBuilding = false;
};
mame2003 = mkLibRetroCore {
core = "mame2003";
description = "Port of MAME ~2003 to libretro";
license = "MAME";
makefile = "Makefile";
enableParallelBuilding = false;
};
mame2003-plus = mkLibRetroCore {
core = "mame2003-plus";
description = "Port of MAME ~2003+ to libretro";
license = "MAME";
makefile = "Makefile";
enableParallelBuilding = false;
};
mame2010 = mkLibRetroCore {
core = "mame2010";
description = "Port of MAME ~2010 to libretro";
license = "MAME";
makefile = "Makefile";
makeFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "PTR64=1" "ARM_ENABLED=1" "X86_SH2DRC=0" "FORCE_DRC_C_BACKEND=1" ];
enableParallelBuilding = false;
};
mame2015 = mkLibRetroCore {
core = "mame2015";
description = "Port of MAME ~2015 to libretro";
license = "MAME";
makeFlags = [ "PYTHON=python3" ];
extraNativeBuildInputs = [ python3 ];
extraBuildInputs = [ alsa-lib ];
makefile = "Makefile";
enableParallelBuilding = false;
};
mame2016 = mkLibRetroCore {
core = "mame2016";
description = "Port of MAME ~2016 to libretro";
license = with lib.licenses; [ bsd3 gpl2Plus ];
extraNativeBuildInputs = [ python3 ];
extraBuildInputs = [ alsa-lib ];
makeFlags = [ "PYTHON_EXECUTABLE=python3" ];
postPatch = ''
# Prevent the failure during the parallel building of:
# make -C 3rdparty/genie/build/gmake.linux -f genie.make obj/Release/src/host/lua-5.3.0/src/lgc.o
mkdir -p 3rdparty/genie/build/gmake.linux/obj/Release/src/host/lua-5.3.0/src
'';
enableParallelBuilding = false;
};
melonds = mkLibRetroCore {
core = "melonds";
description = "Port of MelonDS to libretro";
license = lib.licenses.gpl3Only;
extraBuildInputs = [ libGL libGLU ];
makefile = "Makefile";
};
mesen = mkLibRetroCore {
core = "mesen";
description = "Port of Mesen to libretro";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
preBuild = "cd Libretro";
};
mesen-s = mkLibRetroCore {
core = "mesen-s";
description = "Port of Mesen-S to libretro";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
preBuild = "cd Libretro";
normalizeCore = false;
};
meteor = mkLibRetroCore {
core = "meteor";
description = "Port of Meteor to libretro";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
preBuild = "cd libretro";
};
mgba = mkLibRetroCore {
core = "mgba";
description = "Port of mGBA to libretro";
license = lib.licenses.mpl20;
};
mupen64plus = mkLibRetroCore {
core = "mupen64plus-next";
src = getCoreSrc "mupen64plus";
description = "Libretro port of Mupen64 Plus, GL only";
license = lib.licenses.gpl3Only;
extraBuildInputs = [ libGLU libGL libpng nasm xorg.libX11 ];
makefile = "Makefile";
};
neocd = mkLibRetroCore {
core = "neocd";
description = "NeoCD libretro port";
license = lib.licenses.lgpl3Only;
makefile = "Makefile";
};
nestopia = mkLibRetroCore {
core = "nestopia";
description = "Nestopia libretro port";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
preBuild = "cd libretro";
};
np2kai = mkLibRetroCore rec {
core = "np2kai";
src = getCoreSrc core;
description = "Neko Project II kai libretro port";
license = lib.licenses.mit;
makeFlags = [
# See https://github.com/AZO234/NP2kai/tags
"NP2KAI_VERSION=rev.22"
"NP2KAI_HASH=${src.rev}"
];
preBuild = "cd sdl";
};
o2em = mkLibRetroCore {
core = "o2em";
description = "Port of O2EM to libretro";
license = lib.licenses.artistic1;
makefile = "Makefile";
};
opera = mkLibRetroCore {
core = "opera";
description = "Opera is a port of 4DO/libfreedo to libretro";
license = "Non-commercial";
makefile = "Makefile";
makeFlags = [ "CC_PREFIX=${stdenv.cc.targetPrefix}" ];
};
parallel-n64 = mkLibRetroCore {
core = "parallel-n64";
description = "Parallel Mupen64plus rewrite for libretro.";
license = lib.licenses.gpl3Only;
extraBuildInputs = [ libGLU libGL libpng ];
makefile = "Makefile";
postPatch = lib.optionalString stdenv.hostPlatform.isAarch64 ''
sed -i -e '1 i\CPUFLAGS += -DARM_FIX -DNO_ASM -DARM_ASM -DDONT_WANT_ARM_OPTIMIZATIONS -DARM64' Makefile \
&& sed -i -e 's,CPUFLAGS :=,,g' Makefile
'';
};
pcsx2 = mkLibRetroCore {
core = "pcsx2";
description = "Port of PCSX2 to libretro";
license = lib.licenses.gpl3Plus;
extraNativeBuildInputs = [
cmake
gettext
pkg-config
];
extraBuildInputs = [
libaio
libGL
libGLU
libpcap
libpng
libxml2
xz
xxd
];
makefile = "Makefile";
cmakeFlags = [
"-DLIBRETRO=ON"
];
postPatch = ''
# remove ccache
substituteInPlace CMakeLists.txt --replace "ccache" ""
'';
postBuild = "cd /build/source/build/pcsx2";
platforms = lib.platforms.x86;
};
pcsx_rearmed = mkLibRetroCore {
core = "pcsx_rearmed";
description = "Port of PCSX ReARMed with GNU lightning to libretro";
license = lib.licenses.gpl2Only;
dontConfigure = true;
};
picodrive = mkLibRetroCore {
core = "picodrive";
description = "Fast MegaDrive/MegaCD/32X emulator";
license = "MAME";
extraBuildInputs = [ libpng SDL ];
SDL_CONFIG = "${lib.getDev SDL}/bin/sdl-config";
dontAddPrefix = true;
configurePlatforms = [ ];
makeFlags = lib.optional stdenv.hostPlatform.isAarch64 [ "platform=aarch64" ];
};
play = mkLibRetroCore {
core = "play";
description = "Port of Play! to libretro";
license = lib.licenses.bsd2;
extraBuildInputs = [ boost bzip2 curl openssl icu libGL libGLU xorg.libX11 ];
extraNativeBuildInputs = [ cmake ];
makefile = "Makefile";
cmakeFlags = [ "-DBUILD_PLAY=OFF" "-DBUILD_LIBRETRO_CORE=ON" ];
postBuild = "cd Source/ui_libretro";
};
ppsspp = mkLibRetroCore {
core = "ppsspp";
description = "ppsspp libretro port";
license = lib.licenses.gpl2Plus;
extraNativeBuildInputs = [ cmake pkg-config python3 ];
extraBuildInputs = [ libGLU libGL libzip ffmpeg snappy xorg.libX11 ];
makefile = "Makefile";
cmakeFlags = [
"-DLIBRETRO=ON"
"-DUSE_SYSTEM_FFMPEG=ON"
"-DUSE_SYSTEM_SNAPPY=ON"
"-DUSE_SYSTEM_LIBZIP=ON"
"-DOpenGL_GL_PREFERENCE=GLVND"
];
postBuild = "cd lib";
};
prboom = mkLibRetroCore {
core = "prboom";
description = "Prboom libretro port";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
prosystem = mkLibRetroCore {
core = "prosystem";
description = "Port of ProSystem to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
quicknes = mkLibRetroCore {
core = "quicknes";
description = "QuickNES libretro port";
license = lib.licenses.lgpl21Plus;
makefile = "Makefile";
};
sameboy = mkLibRetroCore {
core = "sameboy";
description = "SameBoy libretro port";
license = lib.licenses.mit;
extraNativeBuildInputs = [ which hexdump ];
preBuild = "cd libretro";
makefile = "Makefile";
};
scummvm = mkLibRetroCore {
core = "scummvm";
description = "Libretro port of ScummVM";
license = lib.licenses.gpl2Only;
extraBuildInputs = [ fluidsynth libjpeg libvorbis libGLU libGL SDL ];
makefile = "Makefile";
preConfigure = "cd backends/platform/libretro/build";
};
smsplus-gx = mkLibRetroCore {
core = "smsplus";
src = getCoreSrc "smsplus-gx";
description = "SMS Plus GX libretro port";
license = lib.licenses.gpl2Plus;
};
snes9x = mkLibRetroCore {
core = "snes9x";
description = "Port of SNES9x git to libretro";
license = "Non-commercial";
makefile = "Makefile";
preBuild = "cd libretro";
};
snes9x2002 = mkLibRetroCore {
core = "snes9x2002";
description = "Optimized port/rewrite of SNES9x 1.39 to Libretro";
license = "Non-commercial";
makefile = "Makefile";
};
snes9x2005 = mkLibRetroCore {
core = "snes9x2005";
description = "Optimized port/rewrite of SNES9x 1.43 to Libretro";
license = "Non-commercial";
makefile = "Makefile";
};
snes9x2005-plus = mkLibRetroCore {
core = "snes9x2005-plus";
src = getCoreSrc "snes9x2005";
description = "Optimized port/rewrite of SNES9x 1.43 to Libretro, with Blargg's APU";
license = "Non-commercial";
makefile = "Makefile";
makeFlags = [ "USE_BLARGG_APU=1" ];
};
snes9x2010 = mkLibRetroCore {
core = "snes9x2010";
description = "Optimized port/rewrite of SNES9x 1.52+ to Libretro";
license = "Non-commercial";
};
stella = mkLibRetroCore {
core = "stella";
description = "Port of Stella to libretro";
license = lib.licenses.gpl2Only;
extraBuildInputs = [ libpng pkg-config SDL ];
makefile = "Makefile";
preBuild = "cd src/libretro";
dontConfigure = true;
};
stella2014 = mkLibRetroCore {
core = "stella2014";
description = "Port of Stella to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
swanstation = mkLibRetroCore {
core = "swanstation";
description = "Port of SwanStation (a fork of DuckStation) to libretro";
license = lib.licenses.gpl3Only;
extraNativeBuildInputs = [ cmake ];
makefile = "Makefile";
cmakeFlags = [
"-DBUILD_LIBRETRO_CORE=ON"
];
};
tgbdual = mkLibRetroCore {
core = "tgbdual";
description = "Port of TGBDual to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
};
thepowdertoy = mkLibRetroCore {
core = "thepowdertoy";
description = "Port of The Powder Toy to libretro";
license = lib.licenses.gpl3Only;
extraNativeBuildInputs = [ cmake ];
makefile = "Makefile";
postBuild = "cd src";
};
tic80 = mkLibRetroCore {
core = "tic80";
description = "Port of TIC-80 to libretro";
license = lib.licenses.mit;
extraNativeBuildInputs = [ cmake pkg-config libGL libGLU ];
makefile = "Makefile";
cmakeFlags = [
"-DBUILD_LIBRETRO=ON"
"-DBUILD_DEMO_CARTS=OFF"
"-DBUILD_PRO=OFF"
"-DBUILD_PLAYER=OFF"
"-DBUILD_SDL=OFF"
"-DBUILD_SOKOL=OFF"
];
preConfigure = "cd core";
postBuild = "cd lib";
};
vba-m = mkLibRetroCore {
core = "vbam";
src = getCoreSrc "vba-m";
description = "vanilla VBA-M libretro port";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
preBuild = "cd src/libretro";
};
vba-next = mkLibRetroCore {
core = "vba-next";
description = "VBA-M libretro port with modifications for speed";
license = lib.licenses.gpl2Only;
};
vecx = mkLibRetroCore {
core = "vecx";
description = "Port of Vecx to libretro";
license = lib.licenses.gpl3Only;
extraBuildInputs = [ libGL libGLU ];
};
virtualjaguar = mkLibRetroCore {
core = "virtualjaguar";
description = "Port of VirtualJaguar to libretro";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
};
yabause = mkLibRetroCore {
core = "yabause";
description = "Port of Yabause to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
# Disable SSE for non-x86. DYNAREC doesn't build on aarch64.
makeFlags = lib.optional (!stdenv.hostPlatform.isx86) "HAVE_SSE=0";
preBuild = "cd yabause/src/libretro";
};
}

View file

@ -0,0 +1,139 @@
{ lib
, stdenv
, enableNvidiaCgToolkit ? false
, withGamemode ? stdenv.isLinux
, withVulkan ? stdenv.isLinux
, alsa-lib
, AppKit
, fetchFromGitHub
, ffmpeg_4
, Foundation
, freetype
, gamemode
, libdrm
, libGL
, libGLU
, libobjc
, libpulseaudio
, libv4l
, libX11
, libXdmcp
, libXext
, libxkbcommon
, libxml2
, libXxf86vm
, makeWrapper
, mesa
, nvidia_cg_toolkit
, pkg-config
, python3
, SDL2
, udev
, vulkan-loader
, wayland
, which
}:
let
version = "1.10.3";
libretroCoreInfo = fetchFromGitHub {
owner = "libretro";
repo = "libretro-core-info";
sha256 = "sha256-wIIMEWrria8bZe/rcoJwDA9aCMWwbkDQFyEU80TZXFQ=";
rev = "v${version}";
};
runtimeLibs = lib.optional withVulkan vulkan-loader
++ lib.optional withGamemode gamemode.lib;
in
stdenv.mkDerivation rec {
pname = "retroarch-bare";
inherit version;
src = fetchFromGitHub {
owner = "libretro";
repo = "RetroArch";
sha256 = "sha256-nAv1yv0laqlOmB8UUkK5wSYy/ySqXloEErm+yV30bbA=";
rev = "v${version}";
};
patches = [
./disable-menu_show_core_updater.patch
./use-fixed-paths-on-libretro_info_path.patch
];
postPatch = ''
substituteInPlace "frontend/drivers/platform_unix.c" \
--replace "@libretro_directory@" "$out/lib" \
--replace "@libretro_info_path@" "$out/share/libretro/info"
substituteInPlace "frontend/drivers/platform_darwin.m" \
--replace "@libretro_directory@" "$out/lib" \
--replace "@libretro_info_path@" "$out/share/libretro/info"
'';
nativeBuildInputs = [ pkg-config ] ++
lib.optional stdenv.isLinux wayland ++
lib.optional (runtimeLibs != [ ]) makeWrapper;
buildInputs = [ ffmpeg_4 freetype libxml2 libGLU libGL python3 SDL2 which ] ++
lib.optional enableNvidiaCgToolkit nvidia_cg_toolkit ++
lib.optional withVulkan vulkan-loader ++
lib.optionals stdenv.isDarwin [ libobjc AppKit Foundation ] ++
lib.optionals stdenv.isLinux [
alsa-lib
libX11
libXdmcp
libXext
libXxf86vm
libdrm
libpulseaudio
libv4l
libxkbcommon
mesa
udev
wayland
];
enableParallelBuilding = true;
configureFlags = lib.optionals stdenv.isLinux [ "--enable-kms" "--enable-egl" ];
postInstall = ''
mkdir -p $out/share/libretro/info
# TODO: ideally each core should have its own core information
cp -r ${libretroCoreInfo}/* $out/share/libretro/info
'' + lib.optionalString (runtimeLibs != [ ]) ''
wrapProgram $out/bin/retroarch \
--prefix LD_LIBRARY_PATH ':' ${lib.makeLibraryPath runtimeLibs}
'' + lib.optionalString stdenv.isDarwin ''
# https://github.com/libretro/RetroArch/blob/master/retroarch-apple-packaging.sh
app=$out/Applications/RetroArch.app
mkdir -p $app/Contents/MacOS
cp -r pkg/apple/OSX/* $app/Contents
cp $out/bin/retroarch $app/Contents/MacOS
# FIXME: using Info_Metal.plist results in input not working
# mv $app/Contents/Info_Metal.plist $app/Contents/Info.plist
substituteInPlace $app/Contents/Info.plist \
--replace '${"\${EXECUTABLE_NAME}"}' 'RetroArch' \
--replace '$(PRODUCT_BUNDLE_IDENTIFIER)' 'com.libretro.RetroArch' \
--replace '${"\${PRODUCT_NAME}"}' 'RetroArch' \
--replace '${"\${MACOSX_DEPLOYMENT_TARGET}"}' '10.13'
cp media/retroarch.icns $app/Contents/Resources/
'';
preFixup = "rm $out/bin/retroarch-cg2glsl";
# Workaround for the following error affecting newer versions of Clang:
# ./config.def.h:xxx:x: error: 'TARGET_OS_TV' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
NIX_CFLAGS_COMPILE = lib.optional stdenv.cc.isClang [ "-Wno-undef-prefix" ];
meta = with lib; {
homepage = "https://libretro.com";
description = "Multi-platform emulator frontend for libretro cores";
license = licenses.gpl3Plus;
platforms = platforms.unix;
changelog = "https://github.com/libretro/RetroArch/blob/v${version}/CHANGES.md";
maintainers = with maintainers; [ MP2E edwtjo matthewbauer kolbycrouch thiagokokada ];
};
}

View file

@ -0,0 +1,25 @@
From 546b343294209abbb193883ab76b679b7f99c6d3 Mon Sep 17 00:00:00 2001
From: Thiago Kenji Okada <thiagokokada@gmail.com>
Date: Sat, 20 Nov 2021 16:03:50 -0300
Subject: [PATCH] Disable "menu_show_core_updater"
---
retroarch.cfg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroarch.cfg b/retroarch.cfg
index cdcb199c9f..ab72f3920f 100644
--- a/retroarch.cfg
+++ b/retroarch.cfg
@@ -681,7 +681,7 @@
# menu_show_online_updater = true
# If disabled, will hide the ability to update cores (and core info files) inside the menu.
-# menu_show_core_updater = true
+menu_show_core_updater = false
# If disabled, the libretro core will keep running in the background when we
# are in the menu.
--
2.31.1

View file

@ -0,0 +1,26 @@
diff --git a/retroarch.cfg b/retroarch.cfg
index cdcb199c9f..08b9b1cf10 100644
--- a/retroarch.cfg
+++ b/retroarch.cfg
@@ -681,7 +681,7 @@
# menu_show_online_updater = true
# If disabled, will hide the ability to update cores (and core info files) inside the menu.
-# menu_show_core_updater = true
+menu_show_core_updater = false
# If disabled, the libretro core will keep running in the background when we
# are in the menu.
@@ -823,10 +823,10 @@
# rgui_browser_directory =
# Core directory for libretro core implementations.
-# libretro_directory =
+libretro_directory = @libretro_directory@
# Core info directory for libretro core information.
-# libretro_info_path =
+libretro_info_path = @libretro_info_path@
# Path to content database directory.
# content_database_path =

View file

@ -0,0 +1,28 @@
diff --git a/configuration.c b/configuration.c
index e6a3841324..afb1d6e2ce 100644
--- a/configuration.c
+++ b/configuration.c
@@ -1456,7 +1456,7 @@ static struct config_path_setting *populate_settings_path(
SETTING_PATH("core_options_path",
settings->paths.path_core_options, false, NULL, true);
SETTING_PATH("libretro_info_path",
- settings->paths.path_libretro_info, false, NULL, true);
+ settings->paths.path_libretro_info, false, NULL, false);
SETTING_PATH("content_database_path",
settings->paths.path_content_database, false, NULL, true);
SETTING_PATH("cheat_database_path",
diff --git a/frontend/drivers/platform_unix.c b/frontend/drivers/platform_unix.c
index 722e1c595c..e7313ee038 100644
--- a/frontend/drivers/platform_unix.c
+++ b/frontend/drivers/platform_unix.c
@@ -1825,8 +1825,8 @@ static void frontend_unix_get_env(int *argc,
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], base_path,
"core_info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
#else
- fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], base_path,
- "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
+ fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], "@libretro_info_path@",
+ "", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG], base_path,
"autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));

View file

@ -0,0 +1,488 @@
{
"atari800": {
"owner": "libretro",
"repo": "libretro-atari800",
"rev": "beab30e7ea10b7ed14d0514064f47d16f76cd995",
"sha256": "r9MsnasNhhYdFyr2VHJXkTXssB5U00JW6wN/+i+SNUk="
},
"beetle-gba": {
"owner": "libretro",
"repo": "beetle-gba-libretro",
"rev": "38182572571a48cb58057cde64b915237c4e2d58",
"sha256": "4xnXWswozlcXBNI1lbGSNW/gAdIeLLO9Bf1SxOFLhSo="
},
"beetle-lynx": {
"owner": "libretro",
"repo": "beetle-lynx-libretro",
"rev": "de0d520d679cb92767876d4e98da908b1ea6a2d6",
"sha256": "BszU5bnlHBOwQSZOM9P4WIP863rS5RluNWvGBFxqzYs="
},
"beetle-ngp": {
"owner": "libretro",
"repo": "beetle-ngp-libretro",
"rev": "facf8e1f5440c5d289258ee3c483710f3bf916fb",
"sha256": "vDKDt7MvCB9XQYP291cwcEPDxfNIVgNSWtBYz9PVgcw="
},
"beetle-pce-fast": {
"owner": "libretro",
"repo": "beetle-pce-fast-libretro",
"rev": "e8801687f232a6f8828b3ff5dadbc9fe1b0076fc",
"sha256": "YM+URLnMqsdmk/5yqCg8U4mPpgtmj5qne2CrbTpTeN8="
},
"beetle-pcfx": {
"owner": "libretro",
"repo": "beetle-pcfx-libretro",
"rev": "bfc0954e14b261a04dcf8dbe0df8798f16ae3f3c",
"sha256": "XzCb1lZFYgsg+3eQ1OqyycNxCgLtZFA30rno3ytdnoM="
},
"beetle-psx": {
"owner": "libretro",
"repo": "beetle-psx-libretro",
"rev": "5a24d54d30dd00d817d267cf92fd5b3f4640928f",
"sha256": "uG1BhElNW75PnfM+rEYfbl97iwRT89hnl84yvlgx6fg="
},
"beetle-saturn": {
"owner": "libretro",
"repo": "beetle-saturn-libretro",
"rev": "dd18f9c477106263b3b7b050f4970d331ff7b23a",
"sha256": "RN5dmORtNOjIklSz/n11lz37bZ4IcPD7cyRcBGS4Oi8="
},
"beetle-snes": {
"owner": "libretro",
"repo": "beetle-bsnes-libretro",
"rev": "d770563fc3c4bd9abb522952cefb4aa923ba0b91",
"sha256": "zHPtfgp9hc8Q4gXJ5VgfJLWLeYjCsQhkfU1T5RM7AL0="
},
"beetle-supergrafx": {
"owner": "libretro",
"repo": "beetle-supergrafx-libretro",
"rev": "59991a98c232b1a8350a9d67ac554c5b22771d3c",
"sha256": "zv3dAPWrj6hkNaFQ5vUKm5Orcrb2XO48WSkAFiAVUO0="
},
"beetle-vb": {
"owner": "libretro",
"repo": "beetle-vb-libretro",
"rev": "246555f8ed7e0b9e5748b2ee2ed6743187c61393",
"sha256": "96lQlDqx2bvFeovqGGkemxqS2zlHw92O6YeTEGlgf34="
},
"beetle-wswan": {
"owner": "libretro",
"repo": "beetle-wswan-libretro",
"rev": "d1fb3f399a2bc16b9ad0f2e8c8ba9f7051cd26bd",
"sha256": "p9mJv7zBFjNh1sh5iAjBZzxP6k8ydUNDXLQIjHl9doQ="
},
"blastem": {
"owner": "libretro",
"repo": "blastem",
"rev": "0786858437ed71996f43b7af0fbe627eb88152fc",
"sha256": "uEP5hSgLAle1cLv/EM7D11TJMAggu7pqWxfrUt3rhEg="
},
"bluemsx": {
"owner": "libretro",
"repo": "bluemsx-libretro",
"rev": "92d0c41b4973854114c7b2d06ab727a266d404c5",
"sha256": "dL4k+zG8L4KK4lwf9eXPVGk/u5xQn2htIEpoKyj9kQI="
},
"bsnes": {
"owner": "libretro",
"repo": "bsnes-libretro",
"rev": "26c583e1c5d09253b6c61e2b9d418e8758eef632",
"sha256": "Qa0ScFHcEgBUoWouNoW4JINZ2aHjNATndxhcwKw476Q="
},
"bsnes-hd": {
"owner": "DerKoun",
"repo": "bsnes-hd",
"rev": "65f24e56c37f46bb752190024bd4058e64ad77d1",
"sha256": "1dk2i71NOLeTTOZjVll8wrkr5dIH5bGSGUeeHqWjZHE="
},
"bsnes-mercury": {
"owner": "libretro",
"repo": "bsnes-mercury",
"rev": "4ba6d8d88e57d3193d95e1bcf39e8d31121f76d4",
"sha256": "w2MVslgRlxW4SMzgcXP4gXr9A8B07N7LNrB1LXzk1Zk="
},
"citra": {
"owner": "libretro",
"repo": "citra",
"rev": "44e01f99016008eff18bc7a28234d1098382358d",
"sha256": "vIrUStv+VM8pYeznnWSVBRfSA71/B7VIY7B/syymGzE=",
"fetchSubmodules": true
},
"desmume": {
"owner": "libretro",
"repo": "desmume",
"rev": "5d0ae2be2c9fb6362af528b3722e81323318eb9f",
"sha256": "4bJ6fLZ+fV7SnZ71YT3JFcXFOgmskNUCmCHwc2QNl0A="
},
"desmume2015": {
"owner": "libretro",
"repo": "desmume2015",
"rev": "af397ff3d1f208c27f3922cc8f2b8e08884ba893",
"sha256": "kEb+og4g7rJvCinBZKcb42geZO6W8ynGsTG9yqYgI+U="
},
"dolphin": {
"owner": "libretro",
"repo": "dolphin",
"rev": "6a0b6ee8a4d5363e669f5faf43abc8f17e4278a8",
"sha256": "TeeHnttGmCeOTDTK/gJM+RpusjDDndapZAa3T+oLiq0="
},
"dosbox": {
"owner": "libretro",
"repo": "dosbox-libretro",
"rev": "74cd17ed0ff810ff78cb8c1f1e45513bfe8a0f32",
"sha256": "0PIloW7j/87asDJ8IDw4r3r4muxNF+RbvkIRPLZQvRc="
},
"eightyone": {
"owner": "libretro",
"repo": "81-libretro",
"rev": "2e34567a320cba27b9162b1776db4de3cdb7cf03",
"sha256": "vjrHRLzc9Fy0MwV9d+LlcJTGJfVsRauEig8R+erBtfw="
},
"fbalpha2012": {
"owner": "libretro",
"repo": "fbalpha2012",
"rev": "7f8860543a81ba79c0e1ce1aa219af44568c628a",
"sha256": "r1lH+CR+nVRCPkVo0XwLi35/ven/FEkNhWUTA6cUVxc="
},
"fbneo": {
"owner": "libretro",
"repo": "fbneo",
"rev": "e4625a196b9232ba93a156e3a5164aa11193f20a",
"sha256": "/5JmwuLWWBQWXnqCMjKzOC2XG6wo5a6xgQOYX1P1zcw="
},
"fceumm": {
"owner": "libretro",
"repo": "libretro-fceumm",
"rev": "b3c35b6515b2b6a789c589f976a4a323ebebe3eb",
"sha256": "zwFQGQyO0Vj/IBM1k8JB3D/jB3OwDuGdSHLavr8Fxgw="
},
"flycast": {
"owner": "libretro",
"repo": "flycast",
"rev": "4c293f306bc16a265c2d768af5d0cea138426054",
"sha256": "9IxpRBY1zifhOebLJSDMA/wiOfcZj+KOiPrgmjiFxvo="
},
"fmsx": {
"owner": "libretro",
"repo": "fmsx-libretro",
"rev": "11fa9f3c08cde567394c41320ca76798c2c64670",
"sha256": "1u5c5oDIjjXEquh6UBv2H1F/Ln7h44DTF1ohDG0Qnww="
},
"freeintv": {
"owner": "libretro",
"repo": "freeintv",
"rev": "295dd3c9e4b2d4f652f6a6a904afbe90a8187068",
"sha256": "tz0X6AfD7IL3Y50vjgSO5r6sDhu++6Gj8Rp7de5OqMk="
},
"gambatte": {
"owner": "libretro",
"repo": "gambatte-libretro",
"rev": "15536214cdce31894d374b2ffa2494543057082b",
"sha256": "cTSoK6rezRajnuWPt7WkYn3SWL0sTu7h5X3Ig1KukDA="
},
"genesis-plus-gx": {
"owner": "libretro",
"repo": "Genesis-Plus-GX",
"rev": "7520ac8aae7b08262c0472e724e6ef0bfe41d285",
"sha256": "wKcO/dulgZKgXTuHdcQvfSrfxSI5UA0az6qMLtP4K6g="
},
"gpsp": {
"owner": "libretro",
"repo": "gpsp",
"rev": "f0f0b31f9ab95946965b75fed8d31e19290f3d43",
"sha256": "aiegBSpQDyXzVkyWuUpI66QvA1tqS8PQ8+75U89K10A="
},
"gw": {
"owner": "libretro",
"repo": "gw-libretro",
"rev": "d08a08154ce8ed8e9de80582c108f157e4c6b226",
"sha256": "PWd/r4BBmhiNqJdV6OaXHr4XCdR1GyVipq3zvyBcqEs="
},
"handy": {
"owner": "libretro",
"repo": "libretro-handy",
"rev": "517bb2d02909271836604c01c8f09a79ad605297",
"sha256": "Igf/OvmnCzoWjCZBoep7T0pXsoBKq3NJpXlYhE7nr3s="
},
"hatari": {
"owner": "libretro",
"repo": "hatari",
"rev": "e5e36a5262cfeadc3d1c7b411b7a70719c4f293c",
"sha256": "T4I3NVEMBKr5HLs60x48VNRl2TMnhqvaF+LTtYQ7qdU="
},
"mame": {
"owner": "libretro",
"repo": "mame",
"rev": "b7dd999590717638ceade2e24d16d63147aa12ad",
"sha256": "QgENNjykhO+WSxAb//J+R7QP3/rZnxqv7sarO4eBYuc="
},
"mame2000": {
"owner": "libretro",
"repo": "mame2000-libretro",
"rev": "dd9d6612c29bf5b29bc2f94cab2d43fe3dcd69ee",
"sha256": "X0fP0bNBk2hqXVdRspylLIjZO563aMXkyX4qgx/3Vr8="
},
"mame2003": {
"owner": "libretro",
"repo": "mame2003-libretro",
"rev": "3eb27d5f161522cf873c0642f14b8e2267b3820f",
"sha256": "TQ4FwboKeEP58hOL2hYs4OYes2o0wSKFSp4CqZV5r6I="
},
"mame2003-plus": {
"owner": "libretro",
"repo": "mame2003-plus-libretro",
"rev": "e5ee29ecb8182952f861f22516e5791625fe2671",
"sha256": "YunfAITR/Etm8lvEab/HigZoBz+ayJQ7ezjItWI/HvE="
},
"mame2010": {
"owner": "libretro",
"repo": "mame2010-libretro",
"rev": "932e6f2c4f13b67b29ab33428a4037dee9a236a8",
"sha256": "HSZRSnc+0300UE9fPcUOMrXABlxHhTewkFPTqQ4Srxs="
},
"mame2015": {
"owner": "libretro",
"repo": "mame2015-libretro",
"rev": "e6a7aa4d53726e61498f68d6b8e2c092a2169fa2",
"sha256": "IgiLxYYuUIn3YE+kQCXzgshES2VNpUHn0Qjsorw0w/s="
},
"mame2016": {
"owner": "libretro",
"repo": "mame2016-libretro",
"rev": "01058613a0109424c4e7211e49ed83ac950d3993",
"sha256": "IsM7f/zlzvomVOYlinJVqZllUhDfy4NNTeTPtNmdVak="
},
"melonds": {
"owner": "libretro",
"repo": "melonds",
"rev": "e93ec3e462d3dfc1556781510a3cee113f02abb2",
"sha256": "NDrsqX17OKw1/PIZSrWAxhVl+Qk/xG7lCnr6Ts+7YJ4="
},
"mesen": {
"owner": "libretro",
"repo": "mesen",
"rev": "bb9ea02eba28682986044a6f49329ec533aa26ba",
"sha256": "G2NQDpByvI9RFEwrRiKXcMnPtVtqpvEoZgk7/fk5qCU="
},
"mesen-s": {
"owner": "libretro",
"repo": "mesen-s",
"rev": "b0b53409eecb696fb13f411ffde72e8f576feb09",
"sha256": "lDHyeIsVsI5+ZK8EJI50alrFuu0uJmxscda5bR1UmQQ="
},
"meteor": {
"owner": "libretro",
"repo": "meteor-libretro",
"rev": "e533d300d0561564451bde55a2b73119c768453c",
"sha256": "zMkgzUz2rk0SD5ojY4AqaDlNM4k4QxuUxVBRBcn6TqQ="
},
"mgba": {
"owner": "libretro",
"repo": "mgba",
"rev": "5d48e0744059ebf38a4e937b256ffd5df4e0d103",
"sha256": "OYw2nlldFx5B7WX0E8Gbgfp1j4h65ZxyKDS9tneHXQg="
},
"mupen64plus": {
"owner": "libretro",
"repo": "mupen64plus-libretro-nx",
"rev": "6e9dcd2cd9d23d3e79eaf2349bf7e9f25ad45bf1",
"sha256": "rs/VL2K6aS8Rl01IyxUiWipzLEzg+7+fbXxI0qN5X/I="
},
"neocd": {
"owner": "libretro",
"repo": "neocd_libretro",
"rev": "327aeceecdf71c8a0c0af3d6dc53686c94fe44ad",
"sha256": "cY0P+0EQ0b9df+YT2EMvrxjp5L+DwIg31rEJqchU+hc="
},
"nestopia": {
"owner": "libretro",
"repo": "nestopia",
"rev": "a9e197f2583ef4f36e9e77d930a677e63a2c2f62",
"sha256": "QqmWSk8Ejf7QMJk0cVBgpnyqcK6oLjCnnXMXInuWfYc="
},
"np2kai": {
"owner": "AZO234",
"repo": "NP2kai",
"rev": "2b09ea6a589cdcae27bca27160b3f82638fbb45d",
"sha256": "M3kGA1TU3xui6of9XgUspI+Zf+hjYP1d2mgKwxsy3IQ=",
"fetchSubmodules": true
},
"o2em": {
"owner": "libretro",
"repo": "libretro-o2em",
"rev": "641f06d67d192a0677ec861fcb731d3ce8da0f87",
"sha256": "s3FreOziXeGhUyQdSoOywZldD21m3+OXK0EJ2Z8rXiY="
},
"opera": {
"owner": "libretro",
"repo": "opera-libretro",
"rev": "3849c969c64b82e622a7655b327fa94bc5a4c7cc",
"sha256": "McSrvjrYTemqAAnfHELf9qXC6n6Dg4kNsUDA7e2DvkE="
},
"parallel-n64": {
"owner": "libretro",
"repo": "parallel-n64",
"rev": "b804ab1a199d6ff1f8fef4aa7dfcf663990e430b",
"sha256": "zAet6hYa/79CBbvwZNTNs/ayWuHHlwg+0Y4BAUFddBc="
},
"pcsx2": {
"owner": "libretro",
"repo": "pcsx2",
"rev": "0251730a21d7238856d79aa25e2942b48edb38f6",
"sha256": "a/lWLBCww4QwxdO7Sbvmfq0XF9FnP4xzF51ljsWk46I="
},
"pcsx_rearmed": {
"owner": "libretro",
"repo": "pcsx_rearmed",
"rev": "e24732050e902bd5402b2b7da7c391d2ca8fa799",
"sha256": "tPz5E3QO6FucjYOzdjbY2FHLPz1Fmms10tdt7rZIW8U="
},
"picodrive": {
"owner": "libretro",
"repo": "picodrive",
"rev": "7ff457f2f833570013f2a7e2608ac40632e0735d",
"sha256": "xEG5swvvWFhvosC1XpFaZphESNaf4AtX+6UE02B57j8=",
"fetchSubmodules": true
},
"play": {
"owner": "jpd002",
"repo": "Play-",
"rev": "39eb5c2eb6da65dc76b1c4d1319175a68120a77a",
"sha256": "EF3p0lvHjKGt4pxtTAkDM+uHsnW72lN+Ki8BaZIk/BQ=",
"fetchSubmodules": true
},
"ppsspp": {
"owner": "hrydgard",
"repo": "ppsspp",
"rev": "83b8211abf7fb705835eb1ccf8feae04816ae96c",
"sha256": "8K4bz/GUnE8GrlAVFULMXLC+i3ZYvR28EpehEg6up4s=",
"fetchSubmodules": true
},
"prboom": {
"owner": "libretro",
"repo": "libretro-prboom",
"rev": "b22a6b19fd976a14374db9083baea9c91b079106",
"sha256": "NmEWRTHaZjV2Y6Wrc3WOamXCnOawKc2ja1KBDxokRiY="
},
"prosystem": {
"owner": "libretro",
"repo": "prosystem-libretro",
"rev": "fbf62c3dacaac694f7ec26cf9be10a51b27271e7",
"sha256": "Opb6CUeT/bnaTg4MJo7DNsVyaPa73PLbIor25HHWzZ0="
},
"quicknes": {
"owner": "libretro",
"repo": "QuickNES_Core",
"rev": "e6f08c165af45fc2d2f26c80ba0cfc33e26f9cfe",
"sha256": "JQtlqN3mvIwKy6iN9opHPHnh0E7AIn9JVitIfXklI/I="
},
"sameboy": {
"owner": "libretro",
"repo": "sameboy",
"rev": "b154b7d3d885a3cf31203f0b8f50d3b37c8b742b",
"sha256": "tavGHiNpRiPkibi66orMf93cnCqQCD8XhSl/36nl/9M="
},
"scummvm": {
"owner": "libretro",
"repo": "scummvm",
"rev": "2fb2e4c551c9c1510c56f6e890ee0300b7b3fca3",
"sha256": "wrlFqu+ONbYH4xMFDByOgySobGrkhVc7kYWI4JzA4ew="
},
"smsplus-gx": {
"owner": "libretro",
"repo": "smsplus-gx",
"rev": "9de9847dc8ba458e9522d5ae8b87bf71ad437257",
"sha256": "XzqQ/3XH5L79UQep+DZ+mDHnUJKZQXzjNCZNZw2mGvY="
},
"snes9x": {
"owner": "snes9xgit",
"repo": "snes9x",
"rev": "3c729a9763263bc3a69f48370e43ae05e672970a",
"sha256": "01M6Wvbu1omMwh3Xg4RGh028jirGs7mLpxwKJgMRQxA="
},
"snes9x2002": {
"owner": "libretro",
"repo": "snes9x2002",
"rev": "c4397de75a5f11403d154abd935e39fe969bca94",
"sha256": "yL4SIRR1Er+7Iq3YPfoe5ES47nvyA3UmGK+upLzKiFA="
},
"snes9x2005": {
"owner": "libretro",
"repo": "snes9x2005",
"rev": "23f759bc4bf2e39733296f7749e446418e3cd0f3",
"sha256": "/bZrMp7NHgdYvA3Tw1ZoWXRg7VxmatRUX5cCJsU3NCY="
},
"snes9x2010": {
"owner": "libretro",
"repo": "snes9x2010",
"rev": "c98224bc74aa0bbf355d128b22e4a2a4e94215b0",
"sha256": "mf5msdwdcRRfFWHwmWLS/qKd7gNlLwexGEB6wB6TfhE="
},
"stella": {
"owner": "stella-emu",
"repo": "stella",
"rev": "efb2a9f299cad241e12d811580f28d75b6c3438d",
"sha256": "QYwDTd8EZUMXJiuSJtoW8XQXgl+Wx0lPkNLOwzM5bzA="
},
"stella2014": {
"owner": "libretro",
"repo": "stella2014-libretro",
"rev": "1351a4fe2ca6b1f3a66c7db0df2ec268ab002d41",
"sha256": "/sVDOfP5CE8k808lhmH3tT47oZ1ka3pgDG5LglfPmHc="
},
"swanstation": {
"owner": "libretro",
"repo": "swanstation",
"rev": "0e53a5ac09a30d73d78b628f7e4954ebe5615801",
"sha256": "vOu99fsm2oeSi96tWR+vV5suZSYCyXJVgOdvjnKbNhg="
},
"tgbdual": {
"owner": "libretro",
"repo": "tgbdual-libretro",
"rev": "1e0c4f931d8c5e859e6d3255d67247d7a2987434",
"sha256": "0wHv9DpKuzJ/q5vERqCo4GBLre2ggClBIWSjGnMLQq8="
},
"thepowdertoy": {
"owner": "libretro",
"repo": "ThePowderToy",
"rev": "ac620c0a89a18774c3ad176a8a1bc596df23ff57",
"sha256": "C/X1DbmnucRddemEYml2zN3qr5yoXY3b+nvqfpboS0M="
},
"tic80": {
"owner": "libretro",
"repo": "tic-80",
"rev": "e9f62f85a154796c6baaee8a9f6fd0cfdd447019",
"sha256": "JTAoIqxqpaLjsQiIpJ4wQsREI5/rTxVxDywoL3oLI4Q=",
"fetchSubmodules": true
},
"vba-m": {
"owner": "libretro",
"repo": "vbam-libretro",
"rev": "254f6effebe882b7d3d29d9e417c6aeeabc08026",
"sha256": "vJWjdqJ913NLGL4G15sRPqO/wp9xPsuhUMLUuAbDRKk="
},
"vba-next": {
"owner": "libretro",
"repo": "vba-next",
"rev": "4191e09e2b0fcf175a15348c1fa8a12bbc6320dd",
"sha256": "IG2oH4F17tlSv1cXYZobggb37tFNE53JOHzan/X0+ws="
},
"vecx": {
"owner": "libretro",
"repo": "libretro-vecx",
"rev": "141af284202c86ed0d4ce9030c76954a144287cf",
"sha256": "p5vMuG2vr3BTJOQWNcTPb89MlkVrRvJNTIJSU8r9zfU="
},
"virtualjaguar": {
"owner": "libretro",
"repo": "virtualjaguar-libretro",
"rev": "263c979be4ca757c43fb525bd6f0887998e57041",
"sha256": "6Q6Y0IFUWS9ZPhnAK3EUo4hMGPdBn8eNEYCK/zLgAKU="
},
"yabause": {
"owner": "libretro",
"repo": "yabause",
"rev": "17dfcd8de4700341d972993501d3a043925675ce",
"sha256": "xwW7Oe3Cy3yC0xC5acLW6OGUIG+dKd1mwiXK5ZAumdo="
}
}

View file

@ -0,0 +1,36 @@
{ stdenv, pkgs, lib, runtimeShell, cores ? [ ] }:
let
script = exec: ''
#!${runtimeShell}
nohup sh -c "pkill -SIGTSTP kodi" &
# https://forum.kodi.tv/showthread.php?tid=185074&pid=1622750#pid1622750
nohup sh -c "sleep 10 && ${exec} '$@' -f;pkill -SIGCONT kodi"
'';
scriptSh = exec: pkgs.writeScript ("kodi-"+exec.name) (script exec.path);
execs = map (core: rec { name = core.core; path = core+"/bin/retroarch-"+name;}) cores;
in
stdenv.mkDerivation {
pname = "kodi-retroarch-advanced-launchers";
version = "0.2";
dontBuild = true;
buildCommand = ''
mkdir -p $out/bin
${lib.concatMapStrings (exec: "ln -s ${scriptSh exec} $out/bin/kodi-${exec.name};") execs}
'';
meta = {
description = "Kodi retroarch advanced launchers";
longDescription = ''
These retroarch launchers are intended to be used with
advanced (emulation) launcher for Kodi since device input is
otherwise caught by both Kodi and the retroarch process.
'';
license = lib.licenses.gpl3;
};
}

View file

@ -0,0 +1,173 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=../../../../ -i python3 -p "python3.withPackages (ps: with ps; [ requests nix-prefetch-github ])" -p "git"
import json
import sys
import subprocess
from pathlib import Path
SCRIPT_PATH = Path(__file__).absolute().parent
HASHES_PATH = SCRIPT_PATH / "hashes.json"
CORES = {
"atari800": {"repo": "libretro-atari800"},
"beetle-gba": {"repo": "beetle-gba-libretro"},
"beetle-lynx": {"repo": "beetle-lynx-libretro"},
"beetle-ngp": {"repo": "beetle-ngp-libretro"},
"beetle-pce-fast": {"repo": "beetle-pce-fast-libretro"},
"beetle-pcfx": {"repo": "beetle-pcfx-libretro"},
"beetle-psx": {"repo": "beetle-psx-libretro"},
"beetle-saturn": {"repo": "beetle-saturn-libretro"},
"beetle-snes": {"repo": "beetle-bsnes-libretro"},
"beetle-supergrafx": {"repo": "beetle-supergrafx-libretro"},
"beetle-vb": {"repo": "beetle-vb-libretro"},
"beetle-wswan": {"repo": "beetle-wswan-libretro"},
"blastem": {"repo": "blastem"},
"bluemsx": {"repo": "bluemsx-libretro"},
"bsnes": {"repo": "bsnes-libretro"},
"bsnes-hd": {"repo": "bsnes-hd", "owner": "DerKoun"},
"bsnes-mercury": {"repo": "bsnes-mercury"},
"citra": { "repo": "citra", "fetch_submodules": True },
"desmume": {"repo": "desmume"},
"desmume2015": {"repo": "desmume2015"},
"dolphin": {"repo": "dolphin"},
"dosbox": {"repo": "dosbox-libretro"},
"eightyone": {"repo": "81-libretro"},
"fbalpha2012": {"repo": "fbalpha2012"},
"fbneo": {"repo": "fbneo"},
"fceumm": {"repo": "libretro-fceumm"},
"flycast": {"repo": "flycast"},
"fmsx": {"repo": "fmsx-libretro"},
"freeintv": {"repo": "freeintv"},
"gambatte": {"repo": "gambatte-libretro"},
"genesis-plus-gx": {"repo": "Genesis-Plus-GX"},
"gpsp": {"repo": "gpsp"},
"gw": {"repo": "gw-libretro"},
"handy": {"repo": "libretro-handy"},
"hatari": {"repo": "hatari"},
"mame": {"repo": "mame"},
"mame2000": {"repo": "mame2000-libretro"},
"mame2003": {"repo": "mame2003-libretro"},
"mame2003-plus": {"repo": "mame2003-plus-libretro"},
"mame2010": {"repo": "mame2010-libretro"},
"mame2015": {"repo": "mame2015-libretro"},
"mame2016": {"repo": "mame2016-libretro"},
"melonds": {"repo": "melonds"},
"mesen": {"repo": "mesen"},
"mesen-s": {"repo": "mesen-s"},
"meteor": {"repo": "meteor-libretro"},
"mgba": {"repo": "mgba"},
"mupen64plus": {"repo": "mupen64plus-libretro-nx"},
"neocd": {"repo": "neocd_libretro"},
"nestopia": {"repo": "nestopia"},
"np2kai": {"repo": "NP2kai", "owner": "AZO234", "fetch_submodules": True},
"o2em": {"repo": "libretro-o2em"},
"opera": {"repo": "opera-libretro"},
"parallel-n64": {"repo": "parallel-n64"},
"pcsx2": {"repo": "pcsx2"},
"pcsx_rearmed": {"repo": "pcsx_rearmed"},
"picodrive": {"repo": "picodrive", "fetch_submodules": True},
"play": {"repo": "Play-", "owner": "jpd002", "fetch_submodules": True},
"ppsspp": {"repo": "ppsspp", "owner": "hrydgard", "fetch_submodules": True},
"prboom": {"repo": "libretro-prboom"},
"prosystem": {"repo": "prosystem-libretro"},
"quicknes": {"repo": "QuickNES_Core"},
"sameboy": {"repo": "sameboy"},
"scummvm": {"repo": "scummvm"},
"smsplus-gx": {"repo": "smsplus-gx"},
"snes9x": {"repo": "snes9x", "owner": "snes9xgit"},
"snes9x2002": {"repo": "snes9x2002"},
"snes9x2005": {"repo": "snes9x2005"},
"snes9x2010": {"repo": "snes9x2010"},
"stella": {"repo": "stella", "owner": "stella-emu"},
"stella2014": {"repo": "stella2014-libretro"},
"swanstation": {"repo": "swanstation"},
"tgbdual": {"repo": "tgbdual-libretro"},
"thepowdertoy": {"repo": "ThePowderToy"},
"tic80": {"repo": "tic-80", "fetch_submodules": True},
"vba-m": {"repo": "vbam-libretro"},
"vba-next": {"repo": "vba-next"},
"vecx": {"repo": "libretro-vecx"},
"virtualjaguar": {"repo": "virtualjaguar-libretro"},
"yabause": {"repo": "yabause"},
}
def info(*msg):
print(*msg, file=sys.stderr)
def get_repo_hash_fetchFromGitHub(
repo,
owner="libretro",
deep_clone=False,
fetch_submodules=False,
leave_dot_git=False,
rev=None,
):
extra_args = []
if deep_clone:
extra_args.append("--deep-clone")
else:
extra_args.append("--no-deep-clone")
if fetch_submodules:
extra_args.append("--fetch-submodules")
else:
extra_args.append("--no-fetch-submodules")
if leave_dot_git:
extra_args.append("--leave-dot-git")
else:
extra_args.append("--no-leave-dot-git")
if rev:
extra_args.append("--rev")
extra_args.append(rev)
result = subprocess.run(
["nix-prefetch-github", owner, repo, *extra_args],
check=True,
capture_output=True,
text=True,
)
j = json.loads(result.stdout)
# Remove False values
return {k: v for k, v in j.items() if v}
def get_repo_hash(fetcher="fetchFromGitHub", **kwargs):
if fetcher == "fetchFromGitHub":
return get_repo_hash_fetchFromGitHub(**kwargs)
else:
raise ValueError(f"Unsupported fetcher: {fetcher}")
def get_repo_hashes(cores_to_update=[]):
with open(HASHES_PATH) as f:
repo_hashes = json.loads(f.read())
for core, repo in CORES.items():
if core in cores_to_update:
info(f"Getting repo hash for '{core}'...")
repo_hashes[core] = get_repo_hash(**repo)
else:
info(f"Skipping '{core}'...")
return repo_hashes
def main():
# If you don't want to update all cores, pass the name of the cores you
# want to update on the command line. E.g.:
# $ ./update.py citra snes9x
if len(sys.argv) > 1:
cores_to_update = sys.argv[1:]
else:
cores_to_update = CORES.keys()
repo_hashes = get_repo_hashes(cores_to_update)
info(f"Generating '{HASHES_PATH}'...")
with open(HASHES_PATH, "w") as f:
f.write(json.dumps(dict(sorted(repo_hashes.items())), indent=4))
f.write("\n")
info("Finished!")
if __name__ == "__main__":
main()

Some files were not shown because too many files have changed in this diff Show more