about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorMadoura <madouura@gmail.com>2021-12-15 07:10:49 -0600
committerMadoura <madouura@gmail.com>2021-12-15 07:10:49 -0600
commitb83dac8bd1650fbaa8bf210cca3bc283495db14d (patch)
treee2c70e05f57b3630f19af15f04d61bd1e9161a60 /pkgs/misc
parentaef12c8678fd5e927edba764bd04f3ba2930ae15 (diff)
ares: init at 126
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/emulators/ares/default.nix84
-rw-r--r--pkgs/misc/emulators/ares/fix-ruby.patch27
2 files changed, 111 insertions, 0 deletions
diff --git a/pkgs/misc/emulators/ares/default.nix b/pkgs/misc/emulators/ares/default.nix
new file mode 100644
index 0000000000000..33a7858455d67
--- /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 0000000000000..01bd57ebaaddf
--- /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