fix webengine deployment for linux again

This commit is contained in:
therecipe 2017-03-01 17:36:43 +01:00
parent 5a85b07e29
commit b2ff80dbde

View file

@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
@ -888,8 +889,14 @@ func deployInternal() {
utils.RunCmd(exec.Command("cp", "-R", filepath.Join(libraryPath, "plugins/"), depPath), fmt.Sprintf("copy plugins dir for %v on %v", buildTarget, runtime.GOOS))
if usesWebEngine {
utils.RunCmd(exec.Command("cp", "-R", filepath.Join(libraryPath, "libexec"), depPath), fmt.Sprintf("copy libexec content for %v on %v", buildTarget, runtime.GOOS))
utils.RunCmd(exec.Command("cp", "-R", strings.TrimSuffix(filepath.Join(libraryPath, "resources"), "/"), depPath), fmt.Sprintf("copy resources content for %v on %v", buildTarget, runtime.GOOS))
utils.RunCmd(exec.Command("cp", filepath.Join(libraryPath, "libexec", "QtWebEngineProcess"), depPath), fmt.Sprintf("copy QtWebEngineProcess for %v on %v", buildTarget, runtime.GOOS))
var fileList, err = ioutil.ReadDir(filepath.Join(libraryPath, "resources"))
if err != nil {
utils.Log.WithError(err).Error("failed to read resource folder")
}
for _, file := range fileList {
utils.RunCmd(exec.Command("cp", "-R", filepath.Join(libraryPath, "resources", file.Name()), depPath), fmt.Sprintf("copy resource %v for %v on %v", file.Name(), buildTarget, runtime.GOOS))
}
utils.RunCmd(exec.Command("cp", "-R", filepath.Join(libraryPath, "translations/qtwebengine_locales/"), depPath), fmt.Sprintf("copy qtwebengine_locales dir for %v on %v", buildTarget, runtime.GOOS))
}
}
@ -1135,13 +1142,11 @@ func linuxSH() string {
fmt.Fprintf(bb, "export QT_PLUGIN_PATH=$%v\n", filepath.Join(miscDir, "plugins"))
fmt.Fprintf(bb, "export QML_IMPORT_PATH=%v\n", filepath.Join(miscDir, "qml"))
fmt.Fprintf(bb, "export QML2_IMPORT_PATH=%v\n", filepath.Join(miscDir, "qml"))
fmt.Fprintf(bb, "export QTWEBENGINEPROCESS_PATH=%v\n", filepath.Join(miscDir, "libexec"))
} else {
fmt.Fprint(bb, "export LD_LIBRARY_PATH=$dirname/lib\n")
fmt.Fprint(bb, "export QT_PLUGIN_PATH=$dirname/plugins\n")
fmt.Fprint(bb, "export QML_IMPORT_PATH=$dirname/qml\n")
fmt.Fprint(bb, "export QML2_IMPORT_PATH=$dirname/qml\n")
fmt.Fprintf(bb, "export QTWEBENGINEPROCESS_PATH=$dirname/libexec\n")
}
fmt.Fprint(bb, "$dirname/$appname \"$@\"\n")