5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 07:21:32 +08:00

Update zypper.go (#2593)

Add package(webkit2gtk3-soup2-devel) for `libwebkit`.
Change environment variable before running command to query information
of the package.
This commit is contained in:
George Wang 2023-04-16 08:00:39 +08:00 committed by GitHub
parent b302064f2f
commit eaca3d06f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -33,6 +33,7 @@ func (z *Zypper) Packages() packagemap {
{Name: "gtk3-devel", SystemPackage: true, Library: true}, {Name: "gtk3-devel", SystemPackage: true, Library: true},
}, },
"libwebkit": []*Package{ "libwebkit": []*Package{
{Name: "webkit2gtk3-soup2-devel", SystemPackage: true, Library: true},
{Name: "webkit2gtk3-devel", SystemPackage: true, Library: true}, {Name: "webkit2gtk3-devel", SystemPackage: true, Library: true},
}, },
"gcc": []*Package{ "gcc": []*Package{
@ -40,6 +41,7 @@ func (z *Zypper) Packages() packagemap {
}, },
"pkg-config": []*Package{ "pkg-config": []*Package{
{Name: "pkg-config", SystemPackage: true}, {Name: "pkg-config", SystemPackage: true},
{Name: "pkgconf-pkg-config", SystemPackage: true},
}, },
"npm": []*Package{ "npm": []*Package{
{Name: "npm10", SystemPackage: true}, {Name: "npm10", SystemPackage: true},
@ -60,7 +62,9 @@ func (z *Zypper) PackageInstalled(pkg *Package) (bool, error) {
if pkg.SystemPackage == false { if pkg.SystemPackage == false {
return false, nil return false, nil
} }
stdout, _, err := shell.RunCommand(".", "zypper", "info", pkg.Name) var env []string
env = shell.SetEnv(env, "LANGUAGE", "en_US.utf-8")
stdout, _, err := shell.RunCommandWithEnv(env, ".", "zypper", "info", pkg.Name)
if err != nil { if err != nil {
_, ok := err.(*exec.ExitError) _, ok := err.(*exec.ExitError)
if ok { if ok {
@ -83,7 +87,9 @@ func (z *Zypper) PackageAvailable(pkg *Package) (bool, error) {
if pkg.SystemPackage == false { if pkg.SystemPackage == false {
return false, nil return false, nil
} }
stdout, _, err := shell.RunCommand(".", "zypper", "info", pkg.Name) var env []string
env = shell.SetEnv(env, "LANGUAGE", "en_US.utf-8")
stdout, _, err := shell.RunCommandWithEnv(env, ".", "zypper", "info", pkg.Name)
// We add a space to ensure we get a full match, not partial match // We add a space to ensure we get a full match, not partial match
if err != nil { if err != nil {
_, ok := err.(*exec.ExitError) _, ok := err.(*exec.ExitError)

View File

@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed console printing in `wails generate template`. Fixed by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2483) - Fixed console printing in `wails generate template`. Fixed by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2483)
- Fixed `-skipbindings` flag in `wails dev`. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2584) - Fixed `-skipbindings` flag in `wails dev`. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2584)
- Fixed `runtime.MenuUpdateApplicationMenu` on macOS. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2588) - Fixed `runtime.MenuUpdateApplicationMenu` on macOS. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2588)
- Fixed add package name for `libwebkit`/`pkg-config` and use shell.RunCommandWithENV instead of shell.RunCommand in `zypper.go`. Fixed by @wgjtyu in [PR](https://github.com/wailsapp/wails/pull/2593)
## v2.4.1 - 2023-03-20 ## v2.4.1 - 2023-03-20