about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/games
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/games')
-rw-r--r--nixpkgs/pkgs/tools/games/ajour/default.nix81
-rw-r--r--nixpkgs/pkgs/tools/games/gamemode/default.nix104
-rw-r--r--nixpkgs/pkgs/tools/games/gamemode/preload-nix-workaround.patch12
-rw-r--r--nixpkgs/pkgs/tools/games/joystickwake/default.nix26
-rw-r--r--nixpkgs/pkgs/tools/games/minecraft/amidst/default.nix34
-rw-r--r--nixpkgs/pkgs/tools/games/minecraft/fabric-installer/default.nix35
-rw-r--r--nixpkgs/pkgs/tools/games/minecraft/optifine/default.nix39
-rw-r--r--nixpkgs/pkgs/tools/games/weidu/default.nix65
8 files changed, 396 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/games/ajour/default.nix b/nixpkgs/pkgs/tools/games/ajour/default.nix
new file mode 100644
index 000000000000..702ea28a6975
--- /dev/null
+++ b/nixpkgs/pkgs/tools/games/ajour/default.nix
@@ -0,0 +1,81 @@
+{ lib
+, fetchFromGitHub
+, rustPlatform
+, autoPatchelfHook
+, cmake
+, makeWrapper
+, pkg-config
+, python3
+, expat
+, freetype
+, kdialog
+, zenity
+, openssl
+, libX11
+, libxcb
+, libXcursor
+, libXi
+, libxkbcommon
+, libXrandr
+, vulkan-loader
+, wayland
+}:
+
+let
+  rpathLibs = [
+    libXcursor
+    libXi
+    libxkbcommon
+    libXrandr
+    libX11
+    vulkan-loader
+    wayland
+  ];
+
+in rustPlatform.buildRustPackage rec {
+  pname = "Ajour";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "casperstorm";
+    repo = "ajour";
+    rev = version;
+    sha256 = "0xmjr8brjmkk13dsn3yvcl5ss6b214hpka0idk072n46qsyhg2wh";
+  };
+
+  cargoSha256 = "06d1h2c2abg56567znxh65d4ddpi6wvxip9rbzkmdnzgy3b3y2wl";
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    cmake
+    makeWrapper
+    pkg-config
+    python3
+  ];
+
+  buildInputs = [
+    expat
+    freetype
+    openssl
+    libxcb
+    libX11
+  ];
+
+  fixupPhase = ''
+    patchelf --set-rpath "${lib.makeLibraryPath rpathLibs}:$(patchelf --print-rpath $out/bin/ajour)" $out/bin/ajour
+    wrapProgram $out/bin/ajour --prefix PATH ":" ${lib.makeBinPath [ zenity kdialog ]}
+  '';
+
+  meta = with lib; {
+    description = "World of Warcraft addon manager written in Rust";
+    longDescription = ''
+      Ajour is a World of Warcraft addon manager written in Rust with a
+      strong focus on performance and simplicity. The project is
+      completely advertisement free, privacy respecting and open source.
+    '';
+    homepage = "https://github.com/casperstorm/ajour";
+    changelog = "https://github.com/casperstorm/ajour/blob/master/CHANGELOG.md";
+    license = licenses.mit;
+    maintainers = with maintainers; [ hexa ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/games/gamemode/default.nix b/nixpkgs/pkgs/tools/games/gamemode/default.nix
new file mode 100644
index 000000000000..e9fdec592204
--- /dev/null
+++ b/nixpkgs/pkgs/tools/games/gamemode/default.nix
@@ -0,0 +1,104 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, libgamemode32
+, meson
+, ninja
+, pkg-config
+, dbus
+, inih
+, systemd
+, appstream
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gamemode";
+  version = "1.6.1";
+
+  src = fetchFromGitHub {
+    owner = "FeralInteractive";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-P00OnZiPZyxBu9zuG+3JNorXHBhJZy+cKPjX+duZrJ0=";
+  };
+
+  outputs = [ "out" "dev" "lib" "man" "static" ];
+
+  patches = [
+    # Run executables from PATH instead of /usr/bin
+    # See https://github.com/FeralInteractive/gamemode/pull/323
+    (fetchpatch {
+      url = "https://github.com/FeralInteractive/gamemode/commit/be44b7091baa33be6dda60392e4c06c2f398ee72.patch";
+      sha256 = "TlDUETs4+N3pvrVd0FQGlGmC+6ByhJ2E7gKXa7suBtE=";
+    })
+
+    # Fix loading shipped config when using a prefix other than /usr
+    # See https://github.com/FeralInteractive/gamemode/pull/324
+    (fetchpatch {
+      url = "https://github.com/FeralInteractive/gamemode/commit/b29aa903ce5acc9141cfd3960c98ccb047eca872.patch";
+      sha256 = "LwBzBJQ7dfm2mFVSOSPjJP+skgV5N6h77i66L1Sq+ZM=";
+    })
+
+    # Add @libraryPath@ template variable to fix loading the PRELOAD library
+    ./preload-nix-workaround.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace data/gamemoderun \
+      --subst-var-by libraryPath ${lib.makeLibraryPath ([
+        (placeholder "lib")
+      ] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
+        # Support wrapping 32bit applications on a 64bit linux system
+        libgamemode32
+      ])}
+  '';
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    dbus
+    inih
+    systemd
+  ];
+
+  mesonFlags = [
+    # libexec is just a way to package binaries without including them
+    # in PATH. It doesn't make sense to install them to $lib
+    # (the default behaviour in the meson hook).
+    "--libexecdir=${placeholder "out"}/libexec"
+
+    "-Dwith-systemd-user-unit-dir=lib/systemd/user"
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    appstream
+  ];
+
+  # Move static libraries to $static so $lib only contains dynamic libraries.
+  postInstall = ''
+    moveToOutput lib/*.a "$static"
+  '';
+
+  # Add $lib/lib to gamemoded & gamemode-simulate-game's rpath since
+  # they use dlopen to load libgamemode. Can't use makeWrapper since
+  # it would break the security wrapper in the NixOS module.
+  postFixup = ''
+    for bin in "$out/bin/gamemoded" "$out/bin/gamemode-simulate-game"; do
+      patchelf --set-rpath "$lib/lib:$(patchelf --print-rpath "$bin")" "$bin"
+    done
+  '';
+
+  meta = with lib; {
+    description = "Optimise Linux system performance on demand";
+    homepage = "https://github.com/FeralInteractive/GameMode";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ kira-bruneau ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/games/gamemode/preload-nix-workaround.patch b/nixpkgs/pkgs/tools/games/gamemode/preload-nix-workaround.patch
new file mode 100644
index 000000000000..06989ff984ab
--- /dev/null
+++ b/nixpkgs/pkgs/tools/games/gamemode/preload-nix-workaround.patch
@@ -0,0 +1,12 @@
+diff --git a/data/gamemoderun b/data/gamemoderun
+index 573b3e4..6f2799e 100755
+--- a/data/gamemoderun
++++ b/data/gamemoderun
+@@ -5,5 +5,6 @@ GAMEMODEAUTO_NAME="libgamemodeauto.so.0"
+ 
+ # ld will find the right path to load the library, including for 32-bit apps.
+ LD_PRELOAD="${GAMEMODEAUTO_NAME}${LD_PRELOAD:+:$LD_PRELOAD}"
++LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+ 
+-exec env LD_PRELOAD="${LD_PRELOAD}" $GAMEMODERUNEXEC "$@"
++exec env LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" $GAMEMODERUNEXEC "$@"
diff --git a/nixpkgs/pkgs/tools/games/joystickwake/default.nix b/nixpkgs/pkgs/tools/games/joystickwake/default.nix
new file mode 100644
index 000000000000..01800aff8493
--- /dev/null
+++ b/nixpkgs/pkgs/tools/games/joystickwake/default.nix
@@ -0,0 +1,26 @@
+{ lib, python3, fetchFromGitHub }:
+python3.pkgs.buildPythonApplication rec {
+  pname = "joystickwake";
+  version = "0.2.4";
+
+  src = fetchFromGitHub {
+    owner = "foresto";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0j8xwfmzzmc9s88zvzc3lv67821r6x28vy6vli3srvx859wprppd";
+  };
+
+  propagatedBuildInputs = with python3.pkgs; [ pyudev xlib ];
+
+  meta = with lib; {
+    description = "A joystick-aware screen waker";
+    longDescription = ''
+      Linux gamers often find themselves unexpectedly staring at a blank screen, because their display server fails to recognize game controllers as input devices, allowing the screen blanker to activate during gameplay.
+      This program works around the problem by temporarily disabling screen blankers when joystick activity is detected.
+    '';
+    homepage = "https://github.com/foresto/joystickwake";
+    maintainers = with maintainers; [ bertof ];
+    license = licenses.mit;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/games/minecraft/amidst/default.nix b/nixpkgs/pkgs/tools/games/minecraft/amidst/default.nix
new file mode 100644
index 000000000000..8ec65a1dd391
--- /dev/null
+++ b/nixpkgs/pkgs/tools/games/minecraft/amidst/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, stdenv
+, fetchurl
+, makeWrapper
+, jre }:
+
+stdenv.mkDerivation rec {
+  pname = "amidst";
+  version = "4.7";
+
+  src = fetchurl { # TODO: Compile from src
+    url = "https://github.com/toolbox4minecraft/amidst/releases/download/v${version}/amidst-v${lib.replaceStrings [ "." ] [ "-" ] version}.jar";
+    sha256 = "sha256-oecRjD7JUuvFym8N/hSE5cbAFQojS6yxOuxpwWRlW9M=";
+  };
+
+  dontUnpack = true;
+
+  nativeBuildInputs = [ jre makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/{bin,lib/amidst}
+    cp $src $out/lib/amidst/amidst.jar
+    makeWrapper ${jre}/bin/java $out/bin/amidst \
+      --add-flags "-jar $out/lib/amidst/amidst.jar"
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/toolbox4minecraft/amidst";
+    description = "Advanced Minecraft Interface and Data/Structure Tracking";
+    license = licenses.gpl3Only;
+    maintainers = [ maintainers.ivar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/games/minecraft/fabric-installer/default.nix b/nixpkgs/pkgs/tools/games/minecraft/fabric-installer/default.nix
new file mode 100644
index 000000000000..ef978875049e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/games/minecraft/fabric-installer/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, stdenv
+, fetchurl
+, makeWrapper
+, jre }:
+
+stdenv.mkDerivation rec {
+  pname = "fabric-installer";
+  version = "0.7.4";
+
+  src = fetchurl {
+    url = "https://maven.fabricmc.net/net/fabricmc/fabric-installer/${version}/fabric-installer-${version}.jar";
+    sha256 = "0s3nmwpq1qg90c27qh4anvvsg4yzsgcp6kwsb35fsiaaakxn0b8r";
+  };
+
+  dontUnpack = true;
+
+  nativeBuildInputs = [ jre makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/{bin,lib/fabric}
+
+    cp $src $out/lib/fabric/fabric-installer.jar
+    makeWrapper ${jre}/bin/java $out/bin/fabric-installer \
+      --add-flags "-jar $out/lib/fabric/fabric-installer.jar"
+  '';
+
+  meta = with lib; {
+    homepage = "https://fabricmc.net/";
+    description = "A lightweight, experimental modding toolchain for Minecraft";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ivar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/games/minecraft/optifine/default.nix b/nixpkgs/pkgs/tools/games/minecraft/optifine/default.nix
new file mode 100644
index 000000000000..06425e6b67ef
--- /dev/null
+++ b/nixpkgs/pkgs/tools/games/minecraft/optifine/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, stdenv
+, fetchurl
+, makeWrapper
+, jre }:
+
+stdenv.mkDerivation rec {
+  pname = "optifine";
+  version = "1.16.5_HD_U_G8";
+
+  src = fetchurl {
+    url = "https://optifine.net/download?f=OptiFine_${version}.jar";
+    sha256 = "0ks91d6n4vkgb5ykdrc67br2c69nqjr0xhp7rrkybg24xn8bqxiw";
+  };
+
+  dontUnpack = true;
+
+  nativeBuildInputs = [ jre makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/{bin,lib/optifine}
+    cp $src $out/lib/optifine/optifine.jar
+
+    makeWrapper ${jre}/bin/java $out/bin/optifine \
+      --add-flags "-jar $out/lib/optifine/optifine.jar"
+  '';
+
+  meta = with lib; {
+    homepage = "https://optifine.net/";
+    description = "A Minecraft optimization mod";
+    longDescription = ''
+      OptiFine is a Minecraft optimization mod.
+      It allows Minecraft to run faster and look better with full support for HD textures and many configuration options.
+    '';
+    license = licenses.unfree;
+    maintainers = [ maintainers.ivar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/games/weidu/default.nix b/nixpkgs/pkgs/tools/games/weidu/default.nix
new file mode 100644
index 000000000000..d325746dc8ca
--- /dev/null
+++ b/nixpkgs/pkgs/tools/games/weidu/default.nix
@@ -0,0 +1,65 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, elkhound
+, ocaml-ng
+, perl
+, which
+}:
+
+let
+  # 1. Needs ocaml >= 4.04 and <= 4.11
+  # 2. ocaml 4.10 defaults to safe (immutable) strings so we need a version with
+  #    that disabled as weidu is strongly dependent on mutable strings
+  ocaml' = ocaml-ng.ocamlPackages_4_10.ocaml.overrideAttrs (old: {
+    configureFlags = old.configureFlags ++ [
+      # https://github.com/WeiDUorg/weidu/issues/197
+      "--disable-force-safe-string"
+    ];
+  });
+
+in
+stdenv.mkDerivation rec {
+  pname = "weidu";
+  version = "247.00";
+
+  src = fetchFromGitHub {
+    owner = "WeiDUorg";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-vAIIYn0urQnnL82mdfwJtahrS3uWPFferm+0F13TKcw=";
+  };
+
+  postPatch = ''
+    substitute sample.Configuration Configuration \
+      --replace /usr/bin ${lib.makeBinPath [ ocaml' ]} \
+      --replace elkhound ${elkhound}/bin/elkhound
+
+    mkdir -p obj/{.depend,x86_LINUX}
+  '';
+
+  nativeBuildInputs = [ elkhound ocaml' perl which ];
+
+  buildFlags = [ "weidu" "weinstall" "tolower" ];
+
+  installPhase = ''
+    runHook preInstall
+
+    for b in tolower weidu weinstall; do
+      install -Dm555 $b.asm.exe $out/bin/$b
+    done
+
+    install -Dm444 -t $out/share/doc/weidu README* COPYING
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "InfinityEngine Modding Engine";
+    homepage = "https://weidu.org";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ peterhoeg ];
+    # should work fine on both Darwin and Windows
+    platforms = platforms.linux;
+  };
+}