aboutsummaryrefslogtreecommitdiff
path: root/pkgs/games
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/minecraft/default.nix142
-rwxr-xr-xpkgs/games/minecraft/update.sh7
-rw-r--r--pkgs/games/openttd/default.nix4
3 files changed, 123 insertions, 30 deletions
diff --git a/pkgs/games/minecraft/default.nix b/pkgs/games/minecraft/default.nix
index 32830d6f3d0..7abd6c162e0 100644
--- a/pkgs/games/minecraft/default.nix
+++ b/pkgs/games/minecraft/default.nix
@@ -1,51 +1,137 @@
-{ stdenv, fetchurl, makeDesktopItem, makeWrapper
-, jdk, jre, libpulseaudio, libXxf86vm
+{ stdenv
+, fetchurl
+, makeDesktopItem
+, makeWrapper
+, jre # old or modded versions of the game may require Java 8 (https://aur.archlinux.org/packages/minecraft-launcher/#pinned-674960)
+, xorg
+, zlib
+, nss
+, nspr
+, fontconfig
+, gnome2
+, cairo
+, expat
+, alsaLib
+, cups
+, dbus
+, atk
+, gtk2-x11
+, gdk-pixbuf
+, glib
+, curl
+, freetype
+, libpulseaudio
+, systemd
+, flite ? null
+, libXxf86vm ? null
}:
let
desktopItem = makeDesktopItem {
- name = "minecraft";
- exec = "minecraft";
- icon = "minecraft";
- comment = "A sandbox-building game";
- desktopName = "Minecraft";
- genericName = "minecraft";
- categories = "Game;";
+ name = "minecraft-launcher";
+ exec = "minecraft-launcher";
+ icon = "minecraft-launcher";
+ comment = "Official launcher for Minecraft, a sandbox-building game";
+ desktopName = "Minecraft Launcher";
+ categories = "Game;Application;";
};
- libPath = stdenv.lib.makeLibraryPath [
- libpulseaudio
- libXxf86vm # Needed only for versions <1.13
- ];
+ envLibPath = stdenv.lib.makeLibraryPath [
+ curl
+ libpulseaudio
+ systemd
+ alsaLib # needed for narrator
+ flite # needed for narrator
+ libXxf86vm # needed only for versions <1.13
+ ];
-in stdenv.mkDerivation {
- name = "minecraft-2015-07-24";
+ libPath = stdenv.lib.makeLibraryPath ([
+ alsaLib
+ atk
+ cairo
+ cups
+ dbus
+ expat
+ fontconfig
+ freetype
+ gdk-pixbuf
+ glib
+ gnome2.GConf
+ gnome2.pango
+ gtk2-x11
+ nspr
+ nss
+ stdenv.cc.cc
+ zlib
+ ] ++
+ (with xorg; [
+ libX11
+ libxcb
+ libXcomposite
+ libXcursor
+ libXdamage
+ libXext
+ libXfixes
+ libXi
+ libXrandr
+ libXrender
+ libXtst
+ libXScrnSaver
+ ]));
+in
+ stdenv.mkDerivation rec {
+ pname = "minecraft-launcher";
+
+ version = "2.1.5965";
src = fetchurl {
- url = "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar";
- sha256 = "04pj4l5q0a64jncm2kk45r7nxnxa2z9n110dcxbbahdi6wk0png8";
+ url = "https://launcher.mojang.com/download/linux/x86_64/minecraft-launcher_${version}.tar.gz";
+ sha256 = "0wlc49s541li4cbxdmlw8fp34hp1q9m6ngr7l5hfdhv1i13s5845";
+ };
+
+ icon = fetchurl {
+ url = "https://launcher.mojang.com/download/minecraft-launcher.svg";
+ sha256 = "0w8z21ml79kblv20wh5lz037g130pxkgs8ll9s3bi94zn2pbrhim";
};
nativeBuildInputs = [ makeWrapper ];
- unpackPhase = "${jdk}/bin/jar xf $src favicon.png";
+ sourceRoot = ".";
+
+ dontConfigure = true;
+ dontBuild = true;
installPhase = ''
- mkdir -p $out/bin $out/share/minecraft
+ mkdir -p $out/opt
+ mv minecraft-launcher $out/opt
- makeWrapper ${jre}/bin/java $out/bin/minecraft \
- --add-flags "-jar $out/share/minecraft/minecraft.jar" \
- --suffix LD_LIBRARY_PATH : ${libPath}
+ ${desktopItem.buildCommand}
+ install -D $icon $out/share/icons/hicolor/symbolic/apps/minecraft-launcher.svg
- cp $src $out/share/minecraft/minecraft.jar
- cp -r ${desktopItem}/share/applications $out/share
- install -D favicon.png $out/share/icons/hicolor/32x32/apps/minecraft.png
+ makeWrapper $out/opt/minecraft-launcher/minecraft-launcher $out/bin/minecraft-launcher \
+ --prefix LD_LIBRARY_PATH : ${envLibPath} \
+ --prefix PATH : ${stdenv.lib.makeBinPath [ jre ]}
+ '';
+
+ preFixup = ''
+ patchelf \
+ --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
+ --set-rpath '$ORIGIN/'":${libPath}" \
+ $out/opt/minecraft-launcher/minecraft-launcher
+ patchelf \
+ --set-rpath '$ORIGIN/'":${libPath}" \
+ $out/opt/minecraft-launcher/libcef.so
+ patchelf \
+ --set-rpath '$ORIGIN/'":${libPath}" \
+ $out/opt/minecraft-launcher/liblauncher.so
'';
meta = with stdenv.lib; {
- description = "A sandbox-building game";
- homepage = https://minecraft.net;
+ description = "Official launcher for Minecraft, a sandbox-building game";
+ homepage = "https://minecraft.net";
maintainers = with maintainers; [ cpages ryantm infinisil ];
- license = licenses.unfreeRedistributable;
+ license = licenses.unfree;
};
+
+ passthru.updateScript = ./update.sh;
}
diff --git a/pkgs/games/minecraft/update.sh b/pkgs/games/minecraft/update.sh
new file mode 100755
index 00000000000..02b362e839b
--- /dev/null
+++ b/pkgs/games/minecraft/update.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl jq gnugrep common-updater-scripts
+
+set -eu -o pipefail
+
+version=$(curl -s 'https://aur.archlinux.org/rpc/?v=5&type=info&arg[]=minecraft-launcher' | jq '.results[0].Version' | grep -Po '[.\d]*(?=-)')
+update-source-version minecraft "$version"
diff --git a/pkgs/games/openttd/default.nix b/pkgs/games/openttd/default.nix
index e3c23ad2671..d0828b8811b 100644
--- a/pkgs/games/openttd/default.nix
+++ b/pkgs/games/openttd/default.nix
@@ -29,11 +29,11 @@ let
in
stdenv.mkDerivation rec {
pname = "openttd";
- version = "1.9.2";
+ version = "1.9.3";
src = fetchurl {
url = "https://proxy.binaries.openttd.org/openttd-releases/${version}/${pname}-${version}-source.tar.xz";
- sha256 = "0jjnnzp1a2l8j1cla28pr460lx6cg4ql3acqfxhxv8a5a4jqrzzr";
+ sha256 = "0ijq72kgx997ggw40i5f4a3nf7y2g72z37l47i18yjvgbdzy320r";
};
nativeBuildInputs = [ pkgconfig makeWrapper ];