mirror of
https://github.com/taigrr/wails.git
synced 2026-04-13 18:38:11 -07:00
Compare commits
9 Commits
v2.0.0-bet
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9e559f069 | ||
|
|
9a4c603001 | ||
|
|
98a95e99a5 | ||
|
|
3caa0f1438 | ||
|
|
b8ef90cb41 | ||
|
|
9efc648e3d | ||
|
|
baa96f47d8 | ||
|
|
184ce763c1 | ||
|
|
229ee95f91 |
17
cmd/linux.go
17
cmd/linux.go
@@ -71,8 +71,11 @@ const (
|
|||||||
Crux
|
Crux
|
||||||
// RHEL distribution
|
// RHEL distribution
|
||||||
RHEL
|
RHEL
|
||||||
|
// NixOS distribution
|
||||||
|
NixOS
|
||||||
// Artix linux distribution
|
// Artix linux distribution
|
||||||
ArtixLinux
|
ArtixLinux
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// DistroInfo contains all the information relating to a linux distribution
|
// DistroInfo contains all the information relating to a linux distribution
|
||||||
@@ -185,6 +188,8 @@ func parseOsRelease(osRelease string) *DistroInfo {
|
|||||||
result.Distribution = EndeavourOS
|
result.Distribution = EndeavourOS
|
||||||
case "crux":
|
case "crux":
|
||||||
result.Distribution = Crux
|
result.Distribution = Crux
|
||||||
|
case "nixos":
|
||||||
|
result.Distribution = NixOS
|
||||||
case "artix":
|
case "artix":
|
||||||
result.Distribution = ArtixLinux
|
result.Distribution = ArtixLinux
|
||||||
default:
|
default:
|
||||||
@@ -278,6 +283,18 @@ func PrtGetInstalled(packageName string) (bool, error) {
|
|||||||
return exitCode == 0, nil
|
return exitCode == 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NixEnvInstalled uses nix-env to see if a package is installed
|
||||||
|
func NixEnvInstalled(packageName string) (bool, error) {
|
||||||
|
program := NewProgramHelper()
|
||||||
|
nixEnv := program.FindProgram("nix-env")
|
||||||
|
if nixEnv == nil {
|
||||||
|
return false, fmt.Errorf("cannot check dependencies: nix-env not found")
|
||||||
|
}
|
||||||
|
packageName = strings.ReplaceAll(packageName, "+", `\+`)
|
||||||
|
_, _, exitCode, _ := nixEnv.Run("-q", packageName)
|
||||||
|
return exitCode == 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
// RequestSupportForDistribution promts the user to submit a request to support their
|
// RequestSupportForDistribution promts the user to submit a request to support their
|
||||||
// currently unsupported distribution
|
// currently unsupported distribution
|
||||||
func RequestSupportForDistribution(distroInfo *DistroInfo) error {
|
func RequestSupportForDistribution(distroInfo *DistroInfo) error {
|
||||||
|
|||||||
@@ -354,3 +354,22 @@ distributions:
|
|||||||
help: Please install with `sudo prt-get depinst gtk3` and try again
|
help: Please install with `sudo prt-get depinst gtk3` and try again
|
||||||
- name: webkitgtk
|
- name: webkitgtk
|
||||||
help: Please install with `sudo prt-get depinst webkitgtk` and try again
|
help: Please install with `sudo prt-get depinst webkitgtk` and try again
|
||||||
|
nixos:
|
||||||
|
id: nixos
|
||||||
|
releases:
|
||||||
|
default:
|
||||||
|
version: default
|
||||||
|
name: NixOS
|
||||||
|
gccversioncommand: *gccdumpversion
|
||||||
|
programs:
|
||||||
|
- name: gcc
|
||||||
|
help: Please install with `nix-env -iA nixos.gcc`
|
||||||
|
- name: pkg-config
|
||||||
|
help: Please install with `nix-env -iA nixos.pkg-config`
|
||||||
|
- name: npm
|
||||||
|
help: Please install with `nix-env -iA nixos.nodejs`
|
||||||
|
libraries:
|
||||||
|
- name: gtk+3
|
||||||
|
help: Please install with `nix-env -iA nixos.gtk3`
|
||||||
|
- name: webkitgtk
|
||||||
|
help: Please install with `nix-env -iA nixos.nodePackages.webkitgtk`
|
||||||
|
|||||||
@@ -293,6 +293,8 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
|||||||
libraryChecker = EOpkgInstalled
|
libraryChecker = EOpkgInstalled
|
||||||
case Crux:
|
case Crux:
|
||||||
libraryChecker = PrtGetInstalled
|
libraryChecker = PrtGetInstalled
|
||||||
|
case NixOS:
|
||||||
|
libraryChecker = NixEnvInstalled
|
||||||
default:
|
default:
|
||||||
return false, RequestSupportForDistribution(distroInfo)
|
return false, RequestSupportForDistribution(distroInfo)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
// Version - Wails version
|
// Version - Wails version
|
||||||
const Version = "v1.16.5"
|
const Version = "v1.16.7"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ func init() {
|
|||||||
projectOptions := projectHelper.NewProjectOptions()
|
projectOptions := projectHelper.NewProjectOptions()
|
||||||
commandDescription := `Generates a new Wails project using the given flags.
|
commandDescription := `Generates a new Wails project using the given flags.
|
||||||
Any flags that are required and not given will be prompted for.`
|
Any flags that are required and not given will be prompted for.`
|
||||||
|
build := false
|
||||||
|
|
||||||
initCommand := app.Command("init", "Initialises a new Wails project").
|
initCommand := app.Command("init", "Initialises a new Wails project").
|
||||||
LongDescription(commandDescription).
|
LongDescription(commandDescription).
|
||||||
@@ -23,7 +24,8 @@ Any flags that are required and not given will be prompted for.`
|
|||||||
StringFlag("template", "Template name", &projectOptions.Template).
|
StringFlag("template", "Template name", &projectOptions.Template).
|
||||||
StringFlag("name", "Project name", &projectOptions.Name).
|
StringFlag("name", "Project name", &projectOptions.Name).
|
||||||
StringFlag("description", "Project description", &projectOptions.Description).
|
StringFlag("description", "Project description", &projectOptions.Description).
|
||||||
StringFlag("output", "Output binary name", &projectOptions.BinaryName)
|
StringFlag("output", "Output binary name", &projectOptions.BinaryName).
|
||||||
|
BoolFlag("build", "Build project after generating", &build)
|
||||||
|
|
||||||
initCommand.Action(func() error {
|
initCommand.Action(func() error {
|
||||||
|
|
||||||
@@ -64,6 +66,10 @@ Any flags that are required and not given will be prompted for.`
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
genSpinner.Success()
|
genSpinner.Success()
|
||||||
|
if !build {
|
||||||
|
logger.Yellow("Project '%s' initialised. Run `wails build` to build it.", projectOptions.Name)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Build the project
|
// Build the project
|
||||||
cwd, _ := os.Getwd()
|
cwd, _ := os.Getwd()
|
||||||
|
|||||||
5
go.mod
5
go.mod
@@ -16,12 +16,13 @@ require (
|
|||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
|
||||||
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
|
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
|
||||||
github.com/pkg/errors v0.8.1 // indirect
|
github.com/pkg/errors v0.8.1 // indirect
|
||||||
github.com/sirupsen/logrus v1.4.1
|
github.com/sirupsen/logrus v1.8.1
|
||||||
|
github.com/stretchr/objx v0.1.1 // indirect
|
||||||
github.com/stretchr/testify v1.3.0 // indirect
|
github.com/stretchr/testify v1.3.0 // indirect
|
||||||
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba
|
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba
|
||||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8
|
golang.org/x/image v0.0.0-20200430140353-33d19683fad8
|
||||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
|
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
|
||||||
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c
|
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359
|
||||||
golang.org/x/text v0.3.0
|
golang.org/x/text v0.3.0
|
||||||
gopkg.in/AlecAivazis/survey.v1 v1.8.4
|
gopkg.in/AlecAivazis/survey.v1 v1.8.4
|
||||||
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22
|
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22
|
||||||
|
|||||||
5
go.sum
5
go.sum
@@ -54,6 +54,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
|
|||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
|
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
|
||||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||||
|
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
|
||||||
|
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
@@ -76,9 +78,12 @@ golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5h
|
|||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c=
|
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c=
|
||||||
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 h1:2B5p2L5IfGiD7+b9BOoRMC6DgObAVZV+Fsp050NqXik=
|
||||||
|
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
gopkg.in/AlecAivazis/survey.v1 v1.8.4 h1:10xXXN3wgIhPheb5NI58zFgZv32Ana7P3Tl4shW+0Qc=
|
gopkg.in/AlecAivazis/survey.v1 v1.8.4 h1:10xXXN3wgIhPheb5NI58zFgZv32Ana7P3Tl4shW+0Qc=
|
||||||
|
|||||||
@@ -514,7 +514,6 @@ struct webview_priv
|
|||||||
}
|
}
|
||||||
gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dlg), FALSE);
|
gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dlg), FALSE);
|
||||||
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dlg), FALSE);
|
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dlg), FALSE);
|
||||||
gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dlg), TRUE);
|
|
||||||
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dlg), TRUE);
|
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dlg), TRUE);
|
||||||
gtk_file_chooser_set_create_folders(GTK_FILE_CHOOSER(dlg), TRUE);
|
gtk_file_chooser_set_create_folders(GTK_FILE_CHOOSER(dlg), TRUE);
|
||||||
gint response = gtk_dialog_run(GTK_DIALOG(dlg));
|
gint response = gtk_dialog_run(GTK_DIALOG(dlg));
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ func generateBuildOptions(flags devFlags) *build.Options {
|
|||||||
OutputType: "dev",
|
OutputType: "dev",
|
||||||
Mode: build.Dev,
|
Mode: build.Dev,
|
||||||
Arch: runtime.GOARCH,
|
Arch: runtime.GOARCH,
|
||||||
Pack: true,
|
Pack: false,
|
||||||
Platform: runtime.GOOS,
|
Platform: runtime.GOOS,
|
||||||
LDFlags: flags.ldflags,
|
LDFlags: flags.ldflags,
|
||||||
Compiler: flags.compilerCommand,
|
Compiler: flags.compilerCommand,
|
||||||
|
|||||||
Reference in New Issue
Block a user