5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 22:31:06 +08:00

Merge pull request #200 from Vaelatern/voidlinux-support

feat: VoidLinux support
This commit is contained in:
Lea Anthony 2019-08-26 04:23:16 +10:00 committed by GitHub
commit 77939ea414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -35,6 +35,8 @@ const (
Parrot
// Linuxmint distribution
Linuxmint
// VoidLinux distribution
VoidLinux
)
// DistroInfo contains all the information relating to a linux distribution
@ -111,6 +113,8 @@ func parseOsRelease(osRelease string) *DistroInfo {
result.Distribution = Parrot
case "linuxmint":
result.Distribution = Linuxmint
case "void":
result.Distribution = VoidLinux
default:
result.Distribution = Unknown
}
@ -156,6 +160,17 @@ func PacmanInstalled(packageName string) (bool, error) {
return exitCode == 0, nil
}
// XbpsInstalled uses pacman to see if a package is installed.
func XbpsInstalled(packageName string) (bool, error) {
program := NewProgramHelper()
xbpsQuery := program.FindProgram("xbps-query")
if xbpsQuery == nil {
return false, fmt.Errorf("cannot check dependencies: xbps-query not found")
}
_, _, exitCode, _ := xbpsQuery.Run("-S", packageName)
return exitCode == 0, nil
}
// RpmInstalled uses rpm to see if a package is installed
func RpmInstalled(packageName string) (bool, error) {
program := NewProgramHelper()

View File

@ -55,6 +55,25 @@ distributions:
gccversioncommand: *gccdumpversion
programs: *debiandefaultprograms
libraries: *debiandefaultlibraries
void:
id: void
releases:
default:
version: default
name: VoidLinux
gccversioncommand: *gccdumpversion
programs:
- name: gcc
help: Please install with `xbps-install base-devel` and try again
- name: pkg-config
help: Please install with `xbps-install pkg-config` and try again
- name: npm
help: Please install with `xbps-install nodejs` and try again
libraries:
- name: gtk+3-devel
help: Please install with `xbps-install gtk+3-devel` and try again
- name: webkit2gtk-devel
help: Please install with `xbps-install webkit2gtk-devel` and try again
centos:
id: centos
releases:
@ -128,4 +147,4 @@ distributions:
- name: pkg-config
help: Please install using your system's package manager
- name: npm
help: Please install using your system's package manager
help: Please install using your system's package manager

View File

@ -282,6 +282,8 @@ func CheckDependencies(logger *Logger) (bool, error) {
libraryChecker = RpmInstalled
case Gentoo:
libraryChecker = EqueryInstalled
case VoidLinux:
libraryChecker = XbpsInstalled
default:
return false, RequestSupportForDistribution(distroInfo)
}