mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 18:10:48 +08:00
feat: added openSUSE support
This commit is contained in:
parent
615cc55b31
commit
339b0ecbaf
File diff suppressed because one or more lines are too long
@ -53,6 +53,10 @@ const (
|
||||
Deepin
|
||||
// Raspbian distribution
|
||||
Raspbian
|
||||
// openSUSE Tumbleweed distribution
|
||||
Tumbleweed
|
||||
// openSUSE Leap distribution
|
||||
Leap
|
||||
)
|
||||
|
||||
// DistroInfo contains all the information relating to a linux distribution
|
||||
@ -147,6 +151,10 @@ func parseOsRelease(osRelease string) *DistroInfo {
|
||||
result.Distribution = Deepin
|
||||
case "raspbian":
|
||||
result.Distribution = Raspbian
|
||||
case "opensuse-tumbleweed":
|
||||
result.Distribution = Tumbleweed
|
||||
case "opensuse-leap":
|
||||
result.Distribution = Leap
|
||||
default:
|
||||
result.Distribution = Unknown
|
||||
}
|
||||
|
@ -22,5 +22,25 @@ UBUNTU_CODENAME=bionic
|
||||
if result.Distribution != Ubuntu {
|
||||
t.Errorf("expected 'Ubuntu' ID but got '%d'", result.Distribution)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestTumbleweedDetection(t *testing.T) {
|
||||
osrelease := `
|
||||
NAME="openSUSE Tumbleweed"
|
||||
# VERSION="20200414"
|
||||
ID="opensuse-tumbleweed"
|
||||
ID_LIKE="opensuse suse"
|
||||
VERSION_ID="20200414"
|
||||
PRETTY_NAME="openSUSE Tumbleweed"
|
||||
ANSI_COLOR="0;32"
|
||||
CPE_NAME="cpe:/o:opensuse:tumbleweed:20200414"
|
||||
BUG_REPORT_URL="https://bugs.opensuse.org"
|
||||
HOME_URL="https://www.opensuse.org/"
|
||||
LOGO="distributor-logo"
|
||||
`
|
||||
|
||||
result := parseOsRelease(osrelease)
|
||||
if result.Distribution != Tumbleweed {
|
||||
t.Errorf("expected 'Tumbleweed' ID but got '%d'", result.Distribution)
|
||||
}
|
||||
}
|
||||
|
@ -223,3 +223,32 @@ distributions:
|
||||
gccversioncommand: *gccdumpfullversion
|
||||
programs: *debiandefaultprograms
|
||||
libraries: *debiandefaultlibraries
|
||||
|
||||
opensuse-tumbleweed:
|
||||
id: opensuse-tumbleweed
|
||||
releases:
|
||||
default:
|
||||
version: default
|
||||
name: openSUSE Tumbleweed
|
||||
gccversioncommand: *gccdumpfullversion
|
||||
programs: &opensusedefaultprograms
|
||||
- name: gcc
|
||||
help: Please install with `sudo zypper in gcc-c++` and try again
|
||||
- name: pkg-config
|
||||
help: Please install with `sudo zypper in pkgconf-pkg-config` and try again
|
||||
- name: npm
|
||||
help: Please install `sudo zypper in nodejs` and try again
|
||||
libraries: &opensusedefaultlibraries
|
||||
- name: gtk3-devel
|
||||
help: Please install with `sudo zypper in gtk3-devel` and try again
|
||||
- name: webkit2gtk3-devel
|
||||
help: Please install with `sudo zypper in webkit2gtk3-devel` and try again
|
||||
opensuse-leap:
|
||||
id: opensuse-leap
|
||||
releases:
|
||||
default:
|
||||
version: default
|
||||
name: openSUSE Leap
|
||||
gccversioncommand: *gccdumpfullversion
|
||||
programs: *opensusedefaultprograms
|
||||
libraries: *opensusedefaultlibraries
|
||||
|
@ -278,7 +278,7 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
||||
libraryChecker = DpkgInstalled
|
||||
case Arch, ArcoLinux, Manjaro, ManjaroARM:
|
||||
libraryChecker = PacmanInstalled
|
||||
case CentOS, Fedora:
|
||||
case CentOS, Fedora, Tumbleweed, Leap:
|
||||
libraryChecker = RpmInstalled
|
||||
case Gentoo:
|
||||
libraryChecker = EqueryInstalled
|
||||
|
Loading…
Reference in New Issue
Block a user