diff --git a/pkgs/misc/emulators/ares/default.nix b/pkgs/misc/emulators/ares/default.nix new file mode 100644 index 000000000000..33a7858455d6 --- /dev/null +++ b/pkgs/misc/emulators/ares/default.nix @@ -0,0 +1,84 @@ +{ lib +, stdenv +, fetchFromGitHub +, pkg-config +, alsa-lib +, gtksourceview3 +, libXv +, openal +, libpulseaudio +, libao +, udev +, SDL2 +}: + +stdenv.mkDerivation rec { + pname = "ares"; + version = "126"; + + src = fetchFromGitHub { + owner = "ares-emulator"; + repo = "ares"; + rev = "v${version}"; + sha256 = "1rj4vmz8lvpmfc6wni7222kagnw9f6jda9rcb6qky2kpizlp2d24"; + }; + + parallel-rdp = fetchFromGitHub { + owner = "Themaister"; + repo = "parallel-rdp-standalone"; + rev = "0dcebe11ee79288441e40e145c8f340d81f52316"; + sha256 = "1avp4wyfkhk5yfjqx5w3jbqghn2mq5la7k9248kjmnp9n9lip6w9"; + }; + + patches = [ + ./fix-ruby.patch + ]; + + enableParallelBuilding = true; + dontConfigure = true; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + alsa-lib + gtksourceview3 + libXv + openal + libpulseaudio + libao + udev + SDL2 + ]; + + buildPhase = '' + runHook preBuild + + rm -rf ares/n64/vulkan/parallel-rdp + ln -sf ${parallel-rdp} ares/n64/vulkan/parallel-rdp + make -C desktop-ui -j $NIX_BUILD_CORES openmp=true vulkan=true local=false hiro=gtk3 + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,share/{applications,ares,pixmaps}} + cp desktop-ui/out/ares $out/bin + cp desktop-ui/resource/ares.desktop $out/share/applications + cp desktop-ui/resource/{ares{.ico,.png},font.png} $out/share/pixmaps + cp -r ares/{Shaders,System} $out/share/ares + + runHook postInstall + ''; + + 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.all; + }; +} diff --git a/pkgs/misc/emulators/ares/fix-ruby.patch b/pkgs/misc/emulators/ares/fix-ruby.patch new file mode 100644 index 000000000000..01bd57ebaadd --- /dev/null +++ b/pkgs/misc/emulators/ares/fix-ruby.patch @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 884890c46ac9..2015ad06a285 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32219,6 +32219,8 @@ with pkgs; antimicrox = libsForQt5.callPackage ../tools/misc/antimicrox { }; + ares = callPackage ../misc/emulators/ares { }; + atari800 = callPackage ../misc/emulators/atari800 { }; ataripp = callPackage ../misc/emulators/atari++ { };