Add support for your Linux distro

    if you managed to get Wails working for your desktop please consider making a Pull Request. For more details see the development section.

    Wails uses cgo to bind to the native rendering engines so a number of platform dependent libraries are needed.

    • npm -
    • gcc
    • gtk
    • webkitgtk

    gtk, webkit

    Locate the appropriate equivalent libraries for your distribution.

    NOTE: if your distro is a derivative and not a major distribution there are good chances all necessary dependendancies to be the covered .

    Gather system’s information

    Wails uses for identification. In a terminal window run cat /etc/os-release.

    We are interested in NAME and ID fields. Then identify which of the bellow two commands returns gcc’s full version . This is needed for better support when filling tickets via wails issue.

    1. gcc -dumpversion
    2. gcc -dumpfullversion
    1. $ gcc -dumpversion
    2. 8
    3. $ gcc -dumpfullversion
    4. 8.3.0

    linuxdb.yaml lives in wails/cmd/linuxdb.yaml.

    Use the NAME and ID fields of the previous step.

    If your are on derivative distro that shares libraries and software with it’s major a new entry would look like (linux mint sample):

    1. linuxmint:
    2. id: linuxmint
    3. releases:
    4. default:
    5. version: default
    6. name: Linux Mint
    7. gccversioncommand: *gccdumpversion
    8. libraries: *debiandefaultlibraries

    If you are adding a previously unspported major release a new entry would like (centOS entry sample)

    1. centos:
    2. id: centos
    3. releases:
    4. default:
    5. name: CentOS Linux
    6. gccversioncommand: *gccdumpversion
    7. programs:
    8. - name: gcc
    9. help: Please install with `sudo yum install gcc-c++ make` and try again
    10. - name: pkg-config
    11. help: Please install with `sudo yum install pkgconf-pkg-config` and try again
    12. - name: npm
    13. help: Please install with `sudo yum install epel-release && sudo yum install nodejs` and try again
    14. libraries:
    15. - name: gtk3-devel
    16. help: Please install with `sudo yum install gtk3-devel` and try again
    17. - name: webkitgtk3-devel
    18. help: Please install with `sudo yum install webkitgtk3-devel` and try again

    Mewn

    After you are done editing run mewn inside wails/cmd directory.

    As a result cmd-mewn.go should have been re-generated adding your DB entry.

    • add a new constant with your distro’s name (use whatever is returned under NAME field two steps back)
    • and a new switch case (case "ID":)
    1. switch osID {
    2. case "fedora":
    3. result.Distribution = Fedora
    4. case "centos":
    5. case "arch":
    6. result.Distribution = Arch
    7. case "debian":
    8. (...)
    9. case "newdistroID":
    10. result.Distribution = NewDistroName
    11. }

    When adding a major distro you need to also add a new function to support your distro’s specific package manager.

    Here is a sample for dpkg.

    1. // DpkgInstalled uses dpkg to see if a package is installed
    2. func DpkgInstalled(packageName string) (bool, error) {
    3. program := NewProgramHelper()
    4. dpkg := program.FindProgram("dpkg")
    5. if dpkg == nil {
    6. return false, fmt.Errorf("cannot check dependencies: dpkg not found")
    7. }
    8. _, _, exitCode, _ := dpkg.Run("-L", packageName)
    9. return exitCode == 0, nil
    10. }

    Edit system.go

    Finally you have to edit package manager’s switch case in wails/cmd/system.go to also include your distro.

    For example if your are on a Debian derivative you would

    If you are adding a major distro with it’s own package manager you have to make a new case entry.

    1. // Linux has library deps
    2. if runtime.GOOS == "linux" {
    3. (...)
    4. switch distroInfo.Distribution {
    5. case NewDistroName:
    6. libraryChecker = NewPackageManagerInstalled
    7. (...)
    8. }

    cd in directory wails/cmd/wails and install the updated Wails by running go install.