nixpkgs/pkgs/games/polymc/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
1.8 KiB
Nix
Raw Normal View History

2022-01-11 01:34:31 +00:00
{ lib
2022-06-12 19:32:53 +00:00
, stdenv
2022-01-11 01:34:31 +00:00
, fetchFromGitHub
, cmake
, jdk8
, jdk
, zlib
, file
2022-06-12 19:32:53 +00:00
, wrapQtAppsHook
2022-01-11 01:34:31 +00:00
, xorg
, libpulseaudio
, qtbase
, libGL
2022-05-23 14:21:00 +00:00
, quazip
2022-03-13 08:40:58 +00:00
, glfw
, openal
2022-01-11 01:34:31 +00:00
, msaClientID ? ""
2022-06-12 19:32:53 +00:00
, jdks ? [ jdk jdk8 ]
2022-07-23 17:51:21 +00:00
, extra-cmake-modules
2022-01-11 01:34:31 +00:00
}:
2022-06-12 19:32:53 +00:00
stdenv.mkDerivation rec {
2022-01-11 01:34:31 +00:00
pname = "polymc";
2022-07-29 17:07:11 +00:00
version = "1.4.1";
2022-01-11 01:34:31 +00:00
src = fetchFromGitHub {
owner = "PolyMC";
repo = "PolyMC";
rev = version;
2022-07-29 17:07:11 +00:00
sha256 = "sha256-Pu2Eb3g6gwCZjJN0N6S/N82eBMLduQQUzXo8nMmtE+Y=";
2022-01-11 01:34:31 +00:00
fetchSubmodules = true;
};
2022-07-23 17:51:21 +00:00
nativeBuildInputs = [ extra-cmake-modules cmake file jdk wrapQtAppsHook ];
2022-05-23 14:21:00 +00:00
buildInputs = [ qtbase zlib quazip ];
2022-01-11 01:34:31 +00:00
2022-06-12 19:32:53 +00:00
cmakeFlags = lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ];
2022-01-11 01:34:31 +00:00
dontWrapQtApps = true;
postInstall = let
libpath = with xorg; lib.makeLibraryPath [
libX11
libXext
libXcursor
libXrandr
libXxf86vm
libpulseaudio
libGL
2022-03-13 08:40:58 +00:00
glfw
openal
stdenv.cc.cc.lib
2022-01-11 01:34:31 +00:00
];
in ''
# xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
2022-06-12 19:32:53 +00:00
wrapQtApp $out/bin/polymc \
--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \
2022-06-12 19:32:53 +00:00
--prefix POLYMC_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks} \
2022-01-11 01:34:31 +00:00
--prefix PATH : ${lib.makeBinPath [ xorg.xrandr ]}
'';
meta = with lib; {
homepage = "https://polymc.org/";
description = "A free, open source launcher for Minecraft";
longDescription = ''
Allows you to have multiple, separate instances of Minecraft (each with
their own mods, texture packs, saves, etc) and helps you manage them and
their associated options with a simple interface.
'';
platforms = platforms.linux;
2022-03-13 08:40:58 +00:00
changelog = "https://github.com/PolyMC/PolyMC/releases/tag/${version}";
license = licenses.gpl3Only;
2022-01-11 01:34:31 +00:00
maintainers = with maintainers; [ cleverca22 starcraft66 ];
};
}