Skip to content

Commit

Permalink
Merge pull request #4070 from andydotxyz/fix/optionalmetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz authored Jul 19, 2023
2 parents 62474b9 + f05c4e4 commit a18fbe5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions cmd/fyne/internal/commands/package-unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"path/filepath"
"strings"

"fyne.io/fyne/v2/cmd/fyne/internal/metadata"
"fyne.io/fyne/v2/cmd/fyne/internal/templates"

"golang.org/x/sys/execabs"
Expand Down Expand Up @@ -58,16 +59,20 @@ func (p *Packager) packageUNIX() error {
desktop := filepath.Join(appsDir, p.Name+".desktop")
deskFile, _ := os.Create(desktop)

linuxBSD := metadata.LinuxAndBSD{}
if p.linuxAndBSDMetadata != nil {
linuxBSD = *p.linuxAndBSDMetadata
}
tplData := unixData{
Name: p.Name,
Exec: filepath.Base(p.exe),
Icon: p.Name + filepath.Ext(p.icon),
Local: local,
GenericName: p.linuxAndBSDMetadata.GenericName,
Keywords: formatDesktopFileList(p.linuxAndBSDMetadata.Keywords),
Comment: p.linuxAndBSDMetadata.Comment,
Categories: formatDesktopFileList(p.linuxAndBSDMetadata.Categories),
ExecParams: p.linuxAndBSDMetadata.ExecParams,
GenericName: linuxBSD.GenericName,
Keywords: formatDesktopFileList(linuxBSD.Keywords),
Comment: linuxBSD.Comment,
Categories: formatDesktopFileList(linuxBSD.Categories),
ExecParams: linuxBSD.ExecParams,
}
err = templates.DesktopFileUNIX.Execute(deskFile, tplData)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/fyne/internal/commands/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type Packager struct {
tempDir string

customMetadata keyValueFlag
linuxAndBSDMetadata metadata.LinuxAndBSD
linuxAndBSDMetadata *metadata.LinuxAndBSD
}

// AddFlags adds the flags for interacting with the package command.
Expand Down
2 changes: 1 addition & 1 deletion cmd/fyne/internal/metadata/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type FyneApp struct {
Details AppDetails
Development map[string]string `toml:",omitempty"`
Release map[string]string `toml:",omitempty"`
LinuxAndBSD LinuxAndBSD
LinuxAndBSD *LinuxAndBSD `toml:",omitempty"`
}

// AppDetails describes the build information, this group may be OS or arch specific
Expand Down

0 comments on commit a18fbe5

Please sign in to comment.