summary refs log tree commit diff
path: root/pkgs/games/snis
diff options
context:
space:
mode:
authorAlexandra <74795488+alyaeanyx@users.noreply.github.com>2022-01-24 01:03:07 +0100
committerGitHub <noreply@github.com>2022-01-24 01:03:07 +0100
commit27e10a3b92e9df8b899dd09b1dafab28f2303ff1 (patch)
tree1cf1c2a236c2aa9f2ee36427d53c4753a32b5b0a /pkgs/games/snis
parent635d6e8cfe68fbfe84a1c4548ade01bbc1d5d3dc (diff)
downloadnixpkgs-27e10a3b92e9df8b899dd09b1dafab28f2303ff1.tar
nixpkgs-27e10a3b92e9df8b899dd09b1dafab28f2303ff1.tar.gz
nixpkgs-27e10a3b92e9df8b899dd09b1dafab28f2303ff1.tar.bz2
nixpkgs-27e10a3b92e9df8b899dd09b1dafab28f2303ff1.tar.lz
nixpkgs-27e10a3b92e9df8b899dd09b1dafab28f2303ff1.tar.xz
nixpkgs-27e10a3b92e9df8b899dd09b1dafab28f2303ff1.tar.zst
nixpkgs-27e10a3b92e9df8b899dd09b1dafab28f2303ff1.zip
snis: init at 20211017 (#142034)
Diffstat (limited to 'pkgs/games/snis')
-rw-r--r--pkgs/games/snis/default.nix73
1 files changed, 73 insertions, 0 deletions
diff --git a/pkgs/games/snis/default.nix b/pkgs/games/snis/default.nix
new file mode 100644
index 00000000000..ed09ed46eff
--- /dev/null
+++ b/pkgs/games/snis/default.nix
@@ -0,0 +1,73 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkg-config
+, coreutils
+, portaudio
+, libbsd
+, libpng
+, libvorbis
+, SDL2
+, makeWrapper
+, lua5_2
+, glew
+, openssl
+, picotts
+, alsa-utils
+, espeak-classic
+, sox
+, libopus
+, openscad
+}:
+
+stdenv.mkDerivation {
+  pname = "snis_launcher";
+  version = "unstable-2021-10-17";
+
+  src = fetchFromGitHub {
+    owner = "smcameron";
+    repo = "space-nerds-in-space";
+    rev = "e70d3c63e33c940feb53c8d818ce2d8ea2aadf00";
+    sha256 = "sha256-HVCb1iFn7GWNpedtFCgLyd0It8s4PEmUwDfb8ap1TDc=";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "OPUSARCHIVE=libopus.a" "OPUSARCHIVE=" \
+      --replace "-I./opus-1.3.1/include" "-I${libopus.dev}/include/opus"
+    substituteInPlace snis_launcher \
+      --replace "PREFIX=." "PREFIX=$out"
+    substituteInPlace snis_text_to_speech.sh \
+      --replace "pico2wave" "${sox}/bin/pico2wave" \
+      --replace "espeak" "${espeak-classic}/bin/espeak" \
+      --replace "play" "${sox}/bin/play" \
+      --replace "aplay" "${alsa-utils}/bin/aplay" \
+      --replace "/bin/rm" "${coreutils}/bin/rm"
+  '';
+
+  nativeBuildInputs = [ pkg-config openscad makeWrapper ];
+  buildInputs = [ coreutils portaudio libbsd libpng libvorbis SDL2 lua5_2 glew openssl picotts sox alsa-utils libopus ];
+
+  postBuild = ''
+    make models -j$NIX_BUILD_CORES
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out
+    cp -R share $out/share
+    cp -R bin $out/bin
+    cp snis_launcher $out/bin/
+    # without this, snis_client crashes on Wayland
+    wrapProgram $out/bin/snis_client --set SDL_VIDEODRIVER x11
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Space Nerds In Space, a multi-player spaceship bridge simulator";
+    homepage = "https://smcameron.github.io/space-nerds-in-space/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ alyaeanyx ];
+    platforms = platforms.linux;
+  };
+}