From 68c360c518091f0e2d355dd3aa7186f4e8da0935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20=C3=87al=C4=B1=C5=9Fkan?= Date: Sun, 12 Jun 2022 22:32:53 +0300 Subject: [PATCH] polymc: 1.3.1 -> 1.3.2 --- pkgs/games/polymc/default.nix | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/pkgs/games/polymc/default.nix b/pkgs/games/polymc/default.nix index a0f4abc1e7ce..2fa5ce7cf06f 100644 --- a/pkgs/games/polymc/default.nix +++ b/pkgs/games/polymc/default.nix @@ -1,12 +1,12 @@ { lib -, mkDerivation +, stdenv , fetchFromGitHub , cmake , jdk8 , jdk , zlib , file -, makeWrapper +, wrapQtAppsHook , xorg , libpulseaudio , qtbase @@ -15,32 +15,25 @@ , glfw , openal , msaClientID ? "" +, jdks ? [ jdk jdk8 ] }: -mkDerivation rec { +stdenv.mkDerivation rec { pname = "polymc"; - version = "1.3.1"; + version = "1.3.2"; src = fetchFromGitHub { owner = "PolyMC"; repo = "PolyMC"; rev = version; - sha256 = "sha256-oTzhKGDi1Kr3JXY9dYQf1rVDPFr52tJ7L+rb5LCbtBE="; + sha256 = "sha256-hqsyS82UzgCUZ9HjoPKjOLE49fwLntRAh3mVrTsmi3o="; fetchSubmodules = true; }; - nativeBuildInputs = [ cmake file jdk makeWrapper ]; + nativeBuildInputs = [ cmake file jdk wrapQtAppsHook ]; buildInputs = [ qtbase zlib quazip ]; - postPatch = '' - # hardcode jdk paths - substituteInPlace launcher/java/JavaUtils.cpp \ - --replace 'scanJavaDir("/usr/lib/jvm")' 'javas.append("${jdk}/lib/openjdk/bin/java")' \ - --replace 'scanJavaDir("/usr/lib32/jvm")' 'javas.append("${jdk8}/lib/openjdk/bin/java")' - ''; - - cmakeFlags = [ "-DLauncher_PORTABLE=0" ] ++ - lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]; + cmakeFlags = lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]; dontWrapQtApps = true; @@ -58,9 +51,9 @@ mkDerivation rec { ]; in '' # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128 - wrapProgram $out/bin/polymc \ - "''${qtWrapperArgs[@]}" \ + wrapQtApp $out/bin/polymc \ --set GAME_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \ + --prefix POLYMC_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks} \ --prefix PATH : ${lib.makeBinPath [ xorg.xrandr ]} '';