Skip to content

Commit

Permalink
Fix loaders.cache patching (#294)
Browse files Browse the repository at this point in the history
The patching of loaders.cache to remove absolute paths had stopped
working due libpixbufloader-png.so no longer being present. Fix it by
calculating the path to patch out a different way.

#284
  • Loading branch information
pbs3141 authored Jul 8, 2024
1 parent 8507c2f commit 9d82c19
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/appimagetool/appdirtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,16 @@ func handleGdk(appdir helpers.AppDir) {
os.Exit(1)
}

whatToPatchAway := helpers.FilesWithSuffixInDirectoryRecursive(loc, "libpixbufloader-png.so")
if len(whatToPatchAway) < 1 {
helpers.PrintError("whatToPatchAway", errors.New("could not find directory that contains libpixbufloader-png.so"))
break // os.Exit(1)
loadersCache, err := filepath.EvalSymlinks(filepath.Dir(loadersCaches[0]))
if err != nil {
helpers.PrintError("Could not get the location of loaders.cache", err)
break
}

log.Println("Patching", appdir.Path+loadersCaches[0], "removing", filepath.Dir(whatToPatchAway[0])+"/")
err = PatchFile(appdir.Path+loadersCaches[0], filepath.Dir(whatToPatchAway[0])+"/", "")
whatToPatchAway := loadersCache + "/loaders/"

log.Println("Patching", appdir.Path+loadersCaches[0], "removing", whatToPatchAway)
err = PatchFile(appdir.Path+loadersCaches[0], whatToPatchAway, "")
if err != nil {
helpers.PrintError("PatchFile loaders.cache", err)
break // os.Exit(1)
Expand Down

0 comments on commit 9d82c19

Please sign in to comment.