Merge pull request #934 from virchau13/fix-non-nixos-libraries

fix(nix): only load stdenv.cc.cc.lib on NixOS
This commit is contained in:
flow 2022-07-19 11:28:08 -03:00 committed by GitHub
commit c86610b917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,6 @@ let
libXxf86vm libXxf86vm
libpulseaudio libpulseaudio
libGL libGL
stdenv.cc.cc.lib
]; ];
# This variable will be passed to Minecraft by PolyMC # This variable will be passed to Minecraft by PolyMC
@ -68,10 +67,12 @@ stdenv.mkDerivation rec {
] ++ lib.optionals enableLTO [ "-DENABLE_LTO=on" ] ] ++ lib.optionals enableLTO [ "-DENABLE_LTO=on" ]
++ lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]; ++ lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ];
# we have to check if the system is NixOS before adding stdenv.cc.cc.lib (#923)
postInstall = '' postInstall = ''
# xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128 # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
wrapQtApp $out/bin/polymc \ wrapQtApp $out/bin/polymc \
--set GAME_LIBRARY_PATH ${gameLibraryPath} \ --run '[ -f /etc/NIXOS ] && export GAME_LIBRARY_PATH="${stdenv.cc.cc.lib}/lib"' \
--prefix GAME_LIBRARY_PATH : ${gameLibraryPath} \
--prefix POLYMC_JAVA_PATHS : ${javaPaths} \ --prefix POLYMC_JAVA_PATHS : ${javaPaths} \
--prefix PATH : ${lib.makeBinPath [ xorg.xrandr ]} --prefix PATH : ${lib.makeBinPath [ xorg.xrandr ]}
''; '';