sneed
Signed-off-by: sneedium <sneed@sneedmc.org>
This commit is contained in:
parent
f30cfcd6a5
commit
afad1fdcd9
@ -1,84 +0,0 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, symlinkJoin
|
||||
, addOpenGLRunpath
|
||||
, polymc-unwrapped
|
||||
, wrapQtAppsHook
|
||||
, jdk8
|
||||
, jdk17
|
||||
, jdk21
|
||||
, xorg
|
||||
, gamemode
|
||||
, glxinfo
|
||||
, libpulseaudio
|
||||
, qtbase
|
||||
, libGL
|
||||
, glfw
|
||||
, openal
|
||||
, udev
|
||||
, wayland
|
||||
, qtwayland
|
||||
, msaClientID ? ""
|
||||
, jdks ? [ jdk21 jdk17 jdk8 ]
|
||||
, enableLTO ? false
|
||||
, gamemodeSupport ? stdenv.isLinux
|
||||
, additionalLibs ? [ ]
|
||||
, additionalBins ? [ ]
|
||||
, self
|
||||
, version
|
||||
# flake
|
||||
}:
|
||||
|
||||
let
|
||||
polymcInner = polymc-unwrapped.override { inherit msaClientID enableLTO gamemodeSupport; };
|
||||
in
|
||||
|
||||
symlinkJoin {
|
||||
name = "polymc";
|
||||
inherit version;
|
||||
|
||||
paths = [ polymcInner ];
|
||||
|
||||
nativeBuildInputs = [ wrapQtAppsHook ];
|
||||
buildInputs = [ qtbase qtwayland ];
|
||||
|
||||
postBuild = ''
|
||||
wrapQtAppsHook
|
||||
'';
|
||||
|
||||
qtWrapperArgs =
|
||||
let
|
||||
runtimeLibs = (with xorg; [
|
||||
libX11
|
||||
libXext
|
||||
libXcursor
|
||||
libXrandr
|
||||
libXxf86vm
|
||||
]) ++
|
||||
# lwjgl
|
||||
[
|
||||
libpulseaudio
|
||||
libGL
|
||||
glfw
|
||||
openal
|
||||
stdenv.cc.cc.lib
|
||||
udev # OSHI
|
||||
wayland
|
||||
]
|
||||
++ lib.optional gamemodeSupport gamemode.lib
|
||||
++ additionalLibs;
|
||||
|
||||
runtimeBins = [
|
||||
# Required by old LWJGL versions
|
||||
xorg.xrandr
|
||||
glxinfo
|
||||
] ++ additionalBins;
|
||||
in
|
||||
[
|
||||
"--prefix POLYMC_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}"
|
||||
"--set LD_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}"
|
||||
"--prefix PATH : ${lib.makeBinPath runtimeBins}"
|
||||
];
|
||||
|
||||
inherit (polymcInner) meta;
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, cmake
|
||||
, ninja
|
||||
, jdk8
|
||||
, gamemode
|
||||
, ghc_filesystem
|
||||
, zlib
|
||||
, file
|
||||
, qtbase
|
||||
, quazip
|
||||
, extra-cmake-modules
|
||||
, qtcharts
|
||||
, qtwayland
|
||||
# flake
|
||||
, self
|
||||
, version
|
||||
, libnbtplusplus
|
||||
, tomlplusplus
|
||||
, msaClientID ? ""
|
||||
, gamemodeSupport ? stdenv.isLinux
|
||||
, enableLTO ? false
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "polymc-unwrapped";
|
||||
inherit version;
|
||||
|
||||
src = lib.cleanSource self;
|
||||
|
||||
nativeBuildInputs = [ cmake extra-cmake-modules ninja jdk8 ghc_filesystem file ];
|
||||
buildInputs = [ qtbase quazip zlib qtcharts ]
|
||||
++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland
|
||||
++ lib.optional gamemodeSupport gamemode;
|
||||
|
||||
postUnpack = ''
|
||||
# Copy libnbtplusplus
|
||||
rm -rf source/libraries/libnbtplusplus
|
||||
mkdir source/libraries/libnbtplusplus
|
||||
cp -a ${libnbtplusplus}/* source/libraries/libnbtplusplus
|
||||
chmod a+r+w source/libraries/libnbtplusplus/*
|
||||
# Copy tomlplusplus
|
||||
rm -rf source/libraries/tomlplusplus
|
||||
mkdir source/libraries/tomlplusplus
|
||||
cp -a ${tomlplusplus}/* source/libraries/tomlplusplus
|
||||
chmod a+r+w source/libraries/tomlplusplus/*
|
||||
'';
|
||||
|
||||
dontWrapQtApps = true;
|
||||
|
||||
cmakeFlags = [
|
||||
"-GNinja"
|
||||
"-DLauncher_QT_VERSION_MAJOR=${lib.versions.major qtbase.version}"
|
||||
"-DLauncher_BUILD_PLATFORM=nix"
|
||||
]
|
||||
++ lib.optionals enableLTO [ "-DENABLE_LTO=on" ]
|
||||
++ lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://polymc.org/";
|
||||
downloadPage = "https://polymc.org/download/";
|
||||
changelog = "https://github.com/PolyMC/PolyMC/releases";
|
||||
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.unix;
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ starcraft66 kloenk ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user