Coder Social home page Coder Social logo

Comments (3)

probonopd avatar probonopd commented on June 26, 2024

Hello @brunvonlope, apparently you know a lot about the inner workings of GTK (well, at least compared to me, anyways). Would you be able to send a pull request? Thanks for your suggestion.

from go-appimage.

brunvonlope avatar brunvonlope commented on June 26, 2024

Hello @brunvonlope, apparently you know a lot about the inner workings of GTK (well, at least compared to me, anyways). Would you be able to send a pull request? Thanks for your suggestion.

I know almost nothing, specially about Go ☚ī¸. To be fair, this bug was discovered by accident while using testing AppImage in some distros.

from go-appimage.

probonopd avatar probonopd commented on June 26, 2024

We already have some code related to it:

func handleGdk(appdir helpers.AppDir) {
// If there is a .so with the name libgdk_pixbuf inside the AppDir, then we need to
// bundle Gdk pixbuf loaders without which the bundled Gtk does not work
// cp /usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/* usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/
// cp /usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders.cache usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/ -
// this file must also be patched not to contain paths to the libraries
for _, lib := range allELFs {
if strings.HasPrefix(filepath.Base(lib), "libgdk_pixbuf") {
log.Println("Determining Gdk pixbuf loaders (for GDK_PIXBUF_MODULEDIR and GDK_PIXBUF_MODULE_FILE)...")
locs, err := findWithPrefixInLibraryLocations("gdk-pixbuf")
if err != nil {
log.Println("Could not find Gdk pixbuf loaders")
os.Exit(1)
} else {
for _, loc := range locs {
determineELFsInDirTree(appdir, loc)
// We need to patch away the path to libpixbufloader-png.so from the file loaders.cache, similar to:
// sed -i -e 's|/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/||g' usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders.cache
// the patched file must not contain paths to the libraries
loadersCaches := helpers.FilesWithSuffixInDirectoryRecursive(loc, "loaders.cache")
if len(loadersCaches) < 1 {
helpers.PrintError("loadersCaches", errors.New("could not find loaders.cache"))
os.Exit(1)
}
err = copy.Copy(loadersCaches[0], appdir.Path+loadersCaches[0])
if err != nil {
helpers.PrintError("Could not copy loaders.cache", err)
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)
}
log.Println("Patching", appdir.Path+loadersCaches[0], "removing", filepath.Dir(whatToPatchAway[0])+"/")
err = PatchFile(appdir.Path+loadersCaches[0], filepath.Dir(whatToPatchAway[0])+"/", "")
if err != nil {
helpers.PrintError("PatchFile loaders.cache", err)
break // os.Exit(1)
}
}
}
break
}
}
}

Maybe it is not working properly?

from go-appimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.