Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also use $QT_ROOT_DIR #302

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/appimagetool/appdirtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,12 @@ func patchQtPrfxpath(appdir helpers.AppDir, lib string, libraryLocationsInAppDir
f.Seek(0, 0)
// Search from the beginning of the file
search := []byte("qt_prfxpath=")
offset := ScanFile(f, search) + int64(len(search))
prfxpathPos := ScanFile(f, search)
if prfxpathPos < 0 {
helpers.PrintError("Could not find offset for " + string(search), errors.New("no " + string(search) + " token in binary"))
os.Exit(1)
}
offset := prfxpathPos + int64(len(search))
log.Println("Offset of qt_prfxpath:", offset)
/*
What does qt_prfxpath=. actually mean on a Linux system? Where is "."?
Expand Down Expand Up @@ -1492,11 +1497,14 @@ func handleQt(appdir helpers.AppDir, qtVersion int) {

func getQtPrfxpath(f *os.File, err error, qtVersion int) string {

// If the user has set $QTDIR, use that instead of the one from qt_prfxpath in the library
// If the user has set $QTDIR or $QT_ROOT_DIR, use that instead of the one from qt_prfxpath in the library
qtPrefixEnv := os.Getenv("QTDIR")
if qtPrefixEnv == "" {
qtPrefixEnv = os.Getenv("QT_ROOT_DIR")
}
if qtPrefixEnv != "" {
log.Println("Using $QTDIR:", qtPrefixEnv)
return qtPrefixEnv
log.Println("Using QTDIR or QT_ROOT_DIR:", qtPrefixEnv)
return qtPrefixEnv
}

f.Seek(0, 0)
Expand Down
Loading