Nix expr: organise data for GL hack

This commit is contained in:
YoshiRulz 2021-12-07 14:40:05 +10:00
parent 5c59e6d9c4
commit 2aa4c6e86c
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 10 additions and 1 deletions

View File

@ -14,6 +14,15 @@
, initConfig # pretend this is JSON; the following env. vars will be substituted by the wrapper script (if surrounded by double-percent e.g. `%%BIZHAWK_DATA_HOME%%`): `BIZHAWK_DATA_HOME`
}:
let
glHackLibs = rec {
Manjaro_21_0_3 = [ # should match Arch and Manjaro releases from '20/'21
"libdrm_amdgpu.so.1" "libdrm_nouveau.so.2" "libdrm_radeon.so.1" "libedit.so.0" "libelf.so.1" "libffi.so.7" "libGLdispatch.so.0" "libicudata.so.69" "libicuuc.so.69" "libLLVM-11.so" "liblzma.so.5" "libncursesw.so.6" "libsensors.so.5" "libstdc++.so.6" "libvulkan.so.1" "libxml2.so.2" "libz.so.1" "libzstd.so.1"
];
LinuxMint_20_2 = [ # should match Ubuntu 20.04 and similar distros
"libbsd.so.0" "libedit.so.2" "libLLVM-12.so.1" "libtinfo.so.6"
] ++ Manjaro_21_0_3; #TODO split
};
glHackLibsFlat = lib.unique (lib.flatten (builtins.attrValues glHackLibs));
initConfigFile = writeText "config.json" (builtins.toJSON ({
LastWrittenFrom = if builtins.length (builtins.splitVersion hawkVersion) < 3 then "${hawkVersion}.0" else hawkVersion;
PathEntries = {
@ -69,7 +78,7 @@ in rec {
ln -fsvT "${lib.getOutput "drivers" mesa}/lib/libGLX_mesa.so.0" "$BIZHAWK_GLHACKDIR/libGLX_indirect.so.0"
fi
# collect links to certain GL libs (and their deps) from host, added to LD_LIBRARY_PATH without polluting it with all libs from host
for l in libbsd.so.0 libdrm_amdgpu.so.1 libdrm_nouveau.so.2 libdrm_radeon.so.1 libedit.so.0 libedit.so.2 libelf.so.1 libffi.so.7 libGLdispatch.so.0 libicudata.so.69 libicuuc.so.69 libLLVM-11.so libLLVM-12.so.1 liblzma.so.5 libncursesw.so.6 libsensors.so.5 libstdc++.so.6 libtinfo.so.6 libvulkan.so.1 libxml2.so.2 libz.so.1 libzstd.so.1; do
for l in ${builtins.concatStringsSep " " glHackLibsFlat}; do
if [ -e "$BIZHAWK_GLHACKDIR/$l" ]; then continue; fi
# else it's either a broken link or it doesn't exist, we use ln -f to cover both
for d in /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib64 /lib /lib64; do