Skip to content

Commit 5394a8a

Browse files
authored
fix library path for lexaloffle generator (#14525)
fixes #14511
1 parent 8c8d010 commit 5394a8a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

package/batocera/core/batocera-configgen/configgen/configgen/generators/lexaloffle/lexaloffleGenerator.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ def getHotkeysContext(self) -> HotkeysContext:
3333

3434
def generate(self, system, rom, playersControllers, metadata, guns, wheels, gameResolution):
3535
if (system.name == "pico8"):
36-
LD_LIB="LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"+str(BIOS / "pico-8")
36+
LD_LIB=BIOS / "pico-8"
3737
BIN_PATH=PICO8_BIN_PATH
3838
CONTROLLERS=PICO8_CONTROLLERS
3939
ROOT_PATH=PICO8_ROOT_PATH
4040
elif (system.name == "voxatron"):
41-
LD_LIB="LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"+str(BIOS / "voxatron")
41+
LD_LIB=BIOS / "voxatron"
4242
BIN_PATH=VOX_BIN_PATH
4343
CONTROLLERS=VOX_CONTROLLERS
4444
ROOT_PATH=VOX_ROOT_PATH
@@ -52,8 +52,7 @@ def generate(self, system, rom, playersControllers, metadata, guns, wheels, game
5252
raise BatoceraException(f"{BIN_PATH} is not set as executable")
5353

5454
# the command to run
55-
commandArray: list[str | Path] = [LD_LIB]
56-
commandArray.extend([BIN_PATH])
55+
commandArray: list[str | Path] = [BIN_PATH]
5756
commandArray.extend(["-desktop", SCREENSHOTS]) # screenshots
5857
commandArray.extend(["-windowed", "0"]) # full screen
5958
# Display FPS
@@ -83,7 +82,11 @@ def generate(self, system, rom, playersControllers, metadata, guns, wheels, game
8382
with ensure_parents_and_open(CONTROLLERS, "w") as file:
8483
file.write(controllersconfig)
8584

86-
return Command.Command(array=commandArray, env={})
85+
existing_library_path = os.environ.get("LD_LIBRARY_PATH")
86+
87+
return Command.Command(array=commandArray, env={
88+
"LD_LIBRARY_PATH": f"{LD_LIB}:{existing_library_path}" if existing_library_path else LD_LIB
89+
})
8790

8891
def getInGameRatio(self, config, gameResolution, rom):
8992
return 4/3

0 commit comments

Comments
 (0)