Merge pull request #1665 from LordMZTE/nix-update

Update Nix package
This commit is contained in:
Lenny McLennington 2024-07-30 20:39:50 +01:00 committed by GitHub
commit 31d165a3b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 11 deletions

View File

@ -34,11 +34,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1712129508,
"narHash": "sha256-FBVpEX0eLiqX3jnSL3rmJHqHhbuCikJZyDyV3Cl3qAY=",
"lastModified": 1722141560,
"narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d03a4482228d4d6dbd2d4b425b6dfcd49ebe765f",
"rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160",
"type": "github"
},
"original": {
@ -59,11 +59,11 @@
"tomlplusplus": {
"flake": false,
"locked": {
"lastModified": 1710824845,
"narHash": "sha256-A9XuCfVcLle/tMNaH7aqb1leM+t3wwC9ER5RIbMMovo=",
"lastModified": 1720775063,
"narHash": "sha256-9j8qNCITFPvKECY5Sjb2Ri5KcPzRrF0e7G2CUemIhBw=",
"owner": "marzer",
"repo": "tomlplusplus",
"rev": "1f7884e59165e517462f922e7b6de131bd9844f3",
"rev": "e2bae9d559b4956a831fcef10ac8f01c88cb0d13",
"type": "github"
},
"original": {

View File

@ -8,6 +8,8 @@
, jdk17
, jdk21
, xorg
, gamemode
, glxinfo
, libpulseaudio
, qtbase
, libGL
@ -19,13 +21,16 @@
, msaClientID ? ""
, jdks ? [ jdk21 jdk17 jdk8 ]
, enableLTO ? false
, gamemodeSupport ? stdenv.isLinux
, additionalLibs ? [ ]
, additionalBins ? [ ]
, self
, version
# flake
}:
let
polymcInner = polymc-unwrapped.override { inherit msaClientID enableLTO; };
polymcInner = polymc-unwrapped.override { inherit msaClientID enableLTO gamemodeSupport; };
in
symlinkJoin {
@ -59,12 +64,21 @@ symlinkJoin {
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;
inherit (polymcInner) meta;
}

View File

@ -3,12 +3,12 @@
, cmake
, ninja
, jdk8
, gamemode
, ghc_filesystem
, zlib
, file
, qtbase
, quazip
, msaClientID ? ""
, extra-cmake-modules
, qtcharts
, qtwayland
@ -17,6 +17,8 @@
, version
, libnbtplusplus
, tomlplusplus
, msaClientID ? ""
, gamemodeSupport ? stdenv.isLinux
, enableLTO ? false
}:
@ -27,7 +29,9 @@ stdenv.mkDerivation {
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;
buildInputs = [ qtbase quazip zlib qtcharts ]
++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland
++ lib.optional gamemodeSupport gamemode;
postUnpack = ''
# Copy libnbtplusplus
@ -47,6 +51,7 @@ stdenv.mkDerivation {
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}" ];