arrans_overlay_workflow_builder

package module
v0.1.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2026 License: GPL-2.0 Imports: 33 Imported by: 0

README

arrans_overlay_workflow_builder_generator

This is a generator for some of the github actions in my gentoo overlay's workflow directory. - Which check for updates to various applications then generates ebuilds for them.

Installation

To install this application, run the following command:

go install github.com/arran4/arrans_overlay_workflow_builder@latest

This will install the arrans_overlay_workflow_builder binary in your $GOPATH/bin directory.

The purpose of this application is (currently) to quickly generate binary ebuild files for 2 use cases:

  • Github repositories with AppImage binary releases
  • Github repositories with normal elf binaries releases (such as those generated with goreleaser)

The general idea is that this is to be used to quickly get specific binary apps.

Some considerations:

  • alternative executables (such as with hugo and it's extended version which comes up as a use flag to switch between them.)
  • manual pages
  • documents
  • shell completion scripts (bash, zsh, fish and powershell)

Usage:

The basic flow of using the app is that:

  • Find a list of github URLs for applicable programs that you want to generate ebuilds for in your overlay
  • Feed the URL to the appropriate config generation step (See the appropriate section below)
  • Modify the configuration as appropriate
  • Run the generate workflows step
  • Install the ./output/*.yaml files in your overlay's github repo's ./github/workflows directory
  • Commit and push. Staggered to 1 at a time with a 1-minute wait between each commit & push.
  • Watch the ebuilds (or errors) come through
  • Install your tools

Config generation

The configuration files sections look as follows: (See mine here for more)

For AppImages released on GitHub:

Type Github AppImage Release
GithubProjectUrl https://github.com/anyproto/anytype-ts
Category app-text
EbuildName anytype-ts-appimage
Description Official Anytype client for MacOS, Linux, and Windows
Workaround Semantic Version Prerelease Hack 1
Homepage https://anytype.io
License Other
ProgramName Anytype
DesktopFile anytype.desktop
Icons hicolor-apps root
Dependencies sys-libs/glibc sys-libs/zlib
Binary amd64=>Anytype-${VERSION}.AppImage > Anytype.AppImage

For other binary files being released on GitHub:

Type Github Binary Release
GithubProjectUrl https://github.com/twpayne/chezmoi
EbuildName chezmoi-bin
Category app-admin
Description Manage your dotfiles across multiple diverse machines, securely.
Homepage https://www.chezmoi.io/
License MIT License
Workaround Programs as Alternatives => amd64:glibc amd64:loong64 arm64:android ppc64:le
ProgramName android
Binary arm64=>chezmoi_${VERSION}_android_arm64.tar.gz > chezmoi > chezmoi
ProgramName chezmoi
Dependencies sys-libs/glibc
Binary amd64=>chezmoi_${VERSION}_linux-musl_amd64.tar.gz > chezmoi > chezmoi
Binary arm=>chezmoi_${VERSION}_linux_arm.tar.gz > chezmoi > chezmoi
Binary arm64=>chezmoi_${VERSION}_linux_arm64.tar.gz > chezmoi > chezmoi
Binary ppc64=>chezmoi_${VERSION}_linux_ppc64.tar.gz > chezmoi > chezmoi
Binary riscv=>chezmoi_${VERSION}_linux_riscv64.tar.gz > chezmoi > chezmoi
Binary s390=>chezmoi_${VERSION}_linux_s390x.tar.gz > chezmoi > chezmoi
Binary x86=>chezmoi_${VERSION}_linux_i386.tar.gz > chezmoi > chezmoi
ProgramName glibc
Dependencies sys-libs/glibc
Binary amd64=>chezmoi_${VERSION}_linux-glibc_amd64.tar.gz > chezmoi > chezmoi
ProgramName le
Binary ppc64=>chezmoi_${VERSION}_linux_ppc64le.tar.gz > chezmoi > chezmoi
ProgramName loong64
Binary amd64=>chezmoi_${VERSION}_linux_loong64.tar.gz > chezmoi > chezmoi

Ideally you would have 1 file, with multiple of these entries in it. See mine here

Config Generation for an AppImage binary in a GitHub Release

There are 2 commands to generate the AppImage section, one outputs to STDOUT and the other outputs to a specified config file

STDOUT version:

You need to provide a github URL as such:

go run github.com/arran4/arrans_overlay_workflow_builder@latest config view github-release-appimage -github-url https://github.com/anyproto/anytype-ts
Append to config file version

You will need to provide the GitHub URL for the target project, and optionally the input file which defaults to input.config

go run github.com/arran4/arrans_overlay_workflow_builder@latest config add github-release-appimage -github-url https://github.com/anyproto/anytype-ts -to input.config
Config Generation for a binary in a GitHub Release

There are 2 commands to generate the AppImage section, one outputs to STDOUT and the other outputs to a specified config file

STDOUT version:

You need to provide a github URL as such:

go run github.com/arran4/arrans_overlay_workflow_builder@latest config view github-release-binary -github-url https://github.com/goreleaser/goreleaser
Append to config file version

You will need to provide the GitHub URL for the target project, and optionally the input file which defaults to input.config

go run github.com/arran4/arrans_overlay_workflow_builder@latest config add github-release-binary -github-url https://github.com/goreleaser/goreleaser -to input.config

ebuild Generator GitHub Action Generator

To generate the workflows from an input.config file run:

go run github.com/arran4/arrans_overlay_workflow_builder@latest generate workflows -input-file input.config

Look in the output/ directory for the generated file(s) these should be copied to your github overlay's ./.github/workflows directory after being modified. Remember to add: Category with the appropriate Gentoo ebuild category.

Additional options and work-arounds

There are a couple workarounds. At the moment the application assumes semantic versions, and using GitHub releases. Some will be automatically detected, some won't.

In some cases, multiple workarounds are supported.

Version doesn't have a v preceding it:

The program will automatically detect this.

Add Workaround Semantic Version Without V to the config after License

Version is semantic and doesn't match Gentoo version requirements

This mostly impacts projects that have releases like alpha beta etc. The program will automatically detect this.

Add Workaround Semantic Version Prerelease Hack 1 to the config after License

Multiple applications are in one repo using a tag prefix to distinguish between them

The program will NOT detect this, you will have to craft a config to match this, or attempt to use the appropriate commandline flag.

The work around is:

Workaround Tag Prefix => prefix-

Such as in Ente's Auth:

Type Github AppImage Release
GithubProjectUrl https://github.com/ente-io/ente
EbuildName ente-auth-appimage
Description Ente's 2FA solution
Homepage https://ente.io/blog/auth/
License GNU Affero General Public License v3.0
Workaround Semantic Version Prerelease Hack 1
Workaround Tag Prefix => auth-
ProgramName ente_auth
DesktopFile ente_auth.desktop
Icons hicolor-apps root
Dependencies sys-libs/glibc sys-libs/zlib
Binary amd64=>ente-${TAG}-x86_64.AppImage > ente_auth.AppImage

The flag for this is -tag-prefix used as such:

go run github.com/arran4/arrans_overlay_workflow_builder@latest config view github-release-appimage -github-url https://github.com/anyproto/anytype-ts -tag-prefix auth-

Due to assumption in the program you WILL have to modify the EbuildName, Description, Homepage and Category at minimum.

The application uses some other system for versioning

This is not really supported but you can manually specify the tag to base the configuration off with -version-tag this is used in cases such as: https://github.com/probonopd/go-appimage itself, as currently it uses a snapshot system where the snapshot tag is continuous which is hard to work with.

If it was working this is what it would look like.

Type Github AppImage
GithubProjectUrl https://github.com/probonopd/go-appimage
EbuildName go-appimage
Description Go implementation of AppImage tools
License MIT License
Workaround Nightly Build in 'Continuous' With Build Number as version with offset '646'
ProgramName appimaged-838
DesktopFile appimaged.desktop
InstalledFilename appimaged-838.AppImage
ReleasesFilename amd64=>appimaged-838-x86_64.AppImage
ReleasesFilename arm=>appimaged-838-armhf.AppImage
ReleasesFilename arm64=>appimaged-838-aarch64.AppImage
ReleasesFilename x86=>appimaged-838-i686.AppImage
ProgramName appimagetool-838
DesktopFile appimagetool.desktop
InstalledFilename appimagetool-838.AppImage
ReleasesFilename amd64=>appimagetool-838-x86_64.AppImage
ReleasesFilename arm=>appimagetool-838-armhf.AppImage
ReleasesFilename arm64=>appimagetool-838-aarch64.AppImage
ReleasesFilename x86=>appimagetool-838-i686.AppImage
ProgramName mkappimage-838
DesktopFile mkappimage.desktop
InstalledFilename mkappimage-838.AppImage
ReleasesFilename amd64=>mkappimage-838-x86_64.AppImage
ReleasesFilename arm=>mkappimage-838-armhf.AppImage
ReleasesFilename arm64=>mkappimage-838-aarch64.AppImage
ReleasesFilename x86=>mkappimage-838-i686.AppImage

Please note: 838 should be the ${TAG} and this removed from the program name. '646' is specified as though we could grab the current build number, which we don't. This will remain unsupported for the mean time.

Notes

  • The program has been extended without being refactored beyond its original purpose, I am keen to get someone who has a better design to weigh in, create a PR, or a discussion
  • this tool is for VERY specific use cases. You will have to be prepared to modify it for yours if not included
  • This program is provided under the "good enough for my itch" philosophy. You're welcome to fork, create pull requests and extend as needed.
  • I will be concerned mostly with the apps of my interest, the list can be found here: https://github.com/arran4/arrans_overlay/blob/main/current.config
  • The entire main.go is to completely rebuilt with generated code. But until then do what is necessary but in a way which is compatible with that idea
  • I am considering generating more files such as the metadata.xml file too

Documentation

Index

Constants

View Source
const (
	DefaultCategory = "app-misc"
	DefaultLicense  = "unknown"
)

Variables

View Source
var (
	DefaultDesktopFileEnabled = false
)

Functions

func AppendToConfigurationFile

func AppendToConfigurationFile(config string, ic *InputConfig) error

func CmdOneshotGithubReleaseAppImage

func CmdOneshotGithubReleaseAppImage(gitRepo, tagOverride, tagPrefix, outputDir, version string) error

func CmdOneshotGithubReleaseBinary

func CmdOneshotGithubReleaseBinary(gitRepo, tagOverride, tagPrefix, outputDir, version string) error

func CmdOneshotWebAppImage

func CmdOneshotWebAppImage(pageURL, matchExpr, linkExt, outputDir, version string) error

CmdOneshotWebAppImage writes the derived configuration to stdout and renders a workflow.

func ConfigAddAppImageGithubReleases

func ConfigAddAppImageGithubReleases(toConfig, gitRepo, tagOverride, tagPrefix string) error

func ConfigAddBinaryGithubReleases

func ConfigAddBinaryGithubReleases(toConfig, gitRepo, tagOverride, tagPrefix string) error

func ConfigAddWebAppImage

func ConfigAddWebAppImage(toConfig, pageURL, matchExpr, linkExt string) error

ConfigAddWebAppImage appends a generated configuration entry to the provided file.

func ConfigViewAppImageGithubReleases

func ConfigViewAppImageGithubReleases(gitRepo, tagOverride, tagPrefix string) error

func ConfigViewBinaryGithubReleases

func ConfigViewBinaryGithubReleases(gitRepo, tagOverride, tagPrefix string) error

func ConfigViewWebAppImage

func ConfigViewWebAppImage(pageURL, matchExpr, linkExt string) error

ConfigViewWebAppImage prints the derived configuration for inspection.

func DoubleMapStringer

func DoubleMapStringer(sb *strings.Builder, key string, valueMap map[string]map[string][]string)

func GenerateGithubWorkflows

func GenerateGithubWorkflows(file, outputDir, version string) error

func GenerateGithubWorkflowsFromInputConfigs

func GenerateGithubWorkflowsFromInputConfigs(file string, inputConfigs []*InputConfig, outputDir, version string) error

func GenerateWordMeanings

func GenerateWordMeanings(gitRepo string, versions []string, tags []string) map[string]*FilenamePartMeaning

func GroupAndSort

func GroupAndSort(wordMap map[string]*FilenamePartMeaning) map[string][]*GroupedFilenamePartMeaning

func MapDoubleStringer

func MapDoubleStringer(sb *strings.Builder, key string, valueMap map[string][][]string)

func MapStringer

func MapStringer(sb *strings.Builder, key string, valueMap map[string][]string)

func NewInputConfigurationFromRepo

func NewInputConfigurationFromRepo(gitRepo, tagOverride, tagPrefix, ebuildSuffix, sourceType string) (string, *InputConfig, []string, []string, *github.RepositoryRelease, *InputConfig, error)

func ParseWorkflowTemplates

func ParseWorkflowTemplates() (*template.Template, error)

func ReadDependencies

func ReadDependencies(file string, program *Program) ([]string, error)

func ReadDependenciesFromReader

func ReadDependenciesFromReader(program *Program, f io.ReaderAt, unknownSymbols []string) ([]string, error)

Types

type AppImageFileInfo

type AppImageFileInfo struct {
	// Core properties
	// Gentoo keyword
	Keyword string
	OS      string
	// Generally msvc, gnu, musl, etc
	Toolchain string
	// Like tar, or zip, also a bit of bz2, and gz but not proper "containers", later replaced by the container of the
	// contained file
	Container   string
	ProgramName string

	// Compiled only
	Containers []string
	// App image filename, not container
	Filename string

	// Relevant restraint + identification
	AppImage bool

	// Identification
	Version     bool
	Tag         bool
	ProjectName bool

	// Match rules
	SuffixOnly       bool
	CaseInsensitive  bool
	KeywordDefaulted bool
	// Required for the URL only atm:
	ReleaseAsset *github.ReleaseAsset
	// Unmatched
	Unmatched []string

	OriginalFilename string
	Installer        bool
	// contains filtered or unexported fields
}

func (*AppImageFileInfo) CompileMeanings

func (base *AppImageFileInfo) CompileMeanings(input []*FilenamePartMeaning) (*AppImageFileInfo, bool)

func (*AppImageFileInfo) GetInformationFromAppImage

func (appImage *AppImageFileInfo) GetInformationFromAppImage(repoName string, ic *InputConfig) error

func (*AppImageFileInfo) SearchArchiveForAppImageFiles

func (container *AppImageFileInfo) SearchArchiveForAppImageFiles() ([]*AppImageFileInfo, error)

type AppImageFiles

type AppImageFiles []*AppImageFileInfo

func (AppImageFiles) ExtractAppImagesAndContainers

func (base AppImageFiles) ExtractAppImagesAndContainers(wordMap map[string][]*GroupedFilenamePartMeaning) ([]*AppImageFileInfo, []*AppImageFileInfo)

type BinaryReleaseFileInfo

type BinaryReleaseFileInfo struct {
	// Core properties
	// Gentoo keyword
	Keyword string
	OS      string
	// Generally msvc, gnu, musl, etc
	Toolchain string
	// Like tar, or zip, also a bit of bz2, and gz but not proper "containers", later replaced by the container of the
	// contained file
	ProgramName      string
	OriginalFilename string
	ArchivePathname  string
	InstalledName    string
	ExecutableBit    bool
	Installer        bool
	Document         bool
	AppImage         bool
	Container        *BinaryReleaseFileInfo
	DirectoryName    string

	// Compiled only
	Containers []string
	// Binary filename, not container
	Filename string

	// Relevant restraint + identification
	Binary              bool
	ShellCompletionFile bool
	ShellScript         string

	// Identification
	Version     bool
	Tag         bool
	ProjectName bool
	ManualPage  int

	// Match rules
	SuffixOnly       bool
	CaseInsensitive  bool
	KeywordDefaulted bool
	// Required for the URL only atm:
	ReleaseAsset *github.ReleaseAsset
	// Unmatched
	Unmatched []string
	// contains filtered or unexported fields
}

func (*BinaryReleaseFileInfo) CheckMaybe

func (brfi *BinaryReleaseFileInfo) CheckMaybe() (bool, error)

func (*BinaryReleaseFileInfo) CompileMeanings

func (brfi *BinaryReleaseFileInfo) CompileMeanings(input []*FilenamePartMeaning, container *FileTypes) (*BinaryReleaseFileInfo, bool)

func (*BinaryReleaseFileInfo) FetchContent

func (brfi *BinaryReleaseFileInfo) FetchContent() (string, error)

func (*BinaryReleaseFileInfo) Free

func (brfi *BinaryReleaseFileInfo) Free()

func (*BinaryReleaseFileInfo) SearchArchiveForFiles

func (brfi *BinaryReleaseFileInfo) SearchArchiveForFiles() ([]*BinaryReleaseFileInfo, error)

func (*BinaryReleaseFileInfo) UnmatchedOkay

func (brfi *BinaryReleaseFileInfo) UnmatchedOkay() bool

type BinaryReleaseFiles

type BinaryReleaseFiles []*BinaryReleaseFileInfo

func (BinaryReleaseFiles) FindFiles

func (bases BinaryReleaseFiles) FindFiles(wordMap map[string][]*GroupedFilenamePartMeaning, root *FileTypes) *FileTypes

type ExternalResource

type ExternalResource struct {
	Keyword         string
	ReleaseFilename string
	Archived        bool
}

type ExternalResourceKeywordExtended

type ExternalResourceKeywordExtended struct {
	ExternalResource   *ExternalResource
	MustHaveUseFlags   []string
	MustntHaveUseFlags []string
}

func (*ExternalResourceKeywordExtended) Archived

func (erke *ExternalResourceKeywordExtended) Archived() bool

func (*ExternalResourceKeywordExtended) Keyword

func (erke *ExternalResourceKeywordExtended) Keyword() string

func (*ExternalResourceKeywordExtended) ReleaseFilename

func (erke *ExternalResourceKeywordExtended) ReleaseFilename() string

type FileTypes

type FileTypes struct {
	CompressedArchives       []*BinaryReleaseFileInfo
	CompressedArchiveContent map[string]*FileTypes
	Binaries                 []*BinaryReleaseFileInfo
	ManualPages              []*BinaryReleaseFileInfo
	ShellCompletionScripts   []*BinaryReleaseFileInfo
	Root                     *FileTypes
	MightBeBinaries          []*BinaryReleaseFileInfo
	Documents                []*BinaryReleaseFileInfo
}

func (*FileTypes) AllBinaries

func (t *FileTypes) AllBinaries() (result []*BinaryReleaseFileInfo)

func (*FileTypes) AllDocuments

func (t *FileTypes) AllDocuments() (result []*BinaryReleaseFileInfo)

func (*FileTypes) AllManualPages

func (t *FileTypes) AllManualPages() (result []*BinaryReleaseFileInfo)

func (*FileTypes) AllShellCompletionScripts

func (t *FileTypes) AllShellCompletionScripts() (result []*BinaryReleaseFileInfo)

func (*FileTypes) CheckMaybes

func (t *FileTypes) CheckMaybes() error

func (*FileTypes) CountBinaries

func (t *FileTypes) CountBinaries() int

func (*FileTypes) CountCompressedArchives

func (t *FileTypes) CountCompressedArchives() int

func (*FileTypes) CountMaybeBinaries

func (t *FileTypes) CountMaybeBinaries() int

func (*FileTypes) Free

func (t *FileTypes) Free()

type FilenamePartMeaning

type FilenamePartMeaning struct {
	// Core properties
	// Gentoo keyword
	Keyword string
	OS      string
	// Generally msvc, gnu, musl, etc
	Toolchain string
	// Like tar, or zip, also a bit of bz2, and gz but not proper "containers", later replaced by the container of the
	// contained file
	Container string
	// The separator -_-
	Separator bool
	Captured  string

	// Relevant restraint + identification
	AppImage            bool
	Installer           bool
	Document            bool
	ShellCompletionFile bool
	ShellScript         string
	ManualPage          int

	// Identification
	Version     bool
	Tag         bool
	ProjectName bool
	Folder      bool

	// Match rules
	SuffixOnly      bool
	CaseInsensitive bool
	// Required for the URL only atm:
	Unmatched bool
}

func DecodeFilename

func DecodeFilename(groupedWordMap map[string][]*GroupedFilenamePartMeaning, filename string) []*FilenamePartMeaning

type GenerateGithubAppImageTemplateData

type GenerateGithubAppImageTemplateData struct {
	*GenerateGithubWorkflowBase
}

func (*GenerateGithubAppImageTemplateData) Dependencies

func (ggaitd *GenerateGithubAppImageTemplateData) Dependencies() []string

func (*GenerateGithubAppImageTemplateData) ExternalResources

func (ggaitd *GenerateGithubAppImageTemplateData) ExternalResources() map[string]*ExternalResource

func (*GenerateGithubAppImageTemplateData) HasDesktopFile

func (ggaitd *GenerateGithubAppImageTemplateData) HasDesktopFile() bool

func (*GenerateGithubAppImageTemplateData) IsArchived

func (ggaitd *GenerateGithubAppImageTemplateData) IsArchived(keyword string) bool

func (*GenerateGithubAppImageTemplateData) KeywordList

func (ggaitd *GenerateGithubAppImageTemplateData) KeywordList() []string

func (*GenerateGithubAppImageTemplateData) Keywords

func (ggaitd *GenerateGithubAppImageTemplateData) Keywords() string

func (*GenerateGithubAppImageTemplateData) MaskedKeywords

func (ggaitd *GenerateGithubAppImageTemplateData) MaskedKeywords() string

func (*GenerateGithubAppImageTemplateData) NeedsSrcUnpack

func (ggaitd *GenerateGithubAppImageTemplateData) NeedsSrcUnpack() bool

func (*GenerateGithubAppImageTemplateData) PackageName

func (ggaitd *GenerateGithubAppImageTemplateData) PackageName() string

func (*GenerateGithubAppImageTemplateData) TemplateFileName

func (ggaitd *GenerateGithubAppImageTemplateData) TemplateFileName() string

func (*GenerateGithubAppImageTemplateData) WorkflowFileName

func (ggaitd *GenerateGithubAppImageTemplateData) WorkflowFileName() string

func (*GenerateGithubAppImageTemplateData) WorkflowName

func (ggaitd *GenerateGithubAppImageTemplateData) WorkflowName() string

type GenerateGithubBinaryTemplateData

type GenerateGithubBinaryTemplateData struct {
	*GenerateGithubWorkflowBase

	MustntHaveUseFlags map[string]map[string][]string
	MustHaveUseFlags   map[string]map[string][]string
	// contains filtered or unexported fields
}

func (*GenerateGithubBinaryTemplateData) AlternativeDependencies

func (ggbtd *GenerateGithubBinaryTemplateData) AlternativeDependencies() map[string][]string

func (*GenerateGithubBinaryTemplateData) CompressGroupedKeywordedFilenameReference

func (ggbtd *GenerateGithubBinaryTemplateData) CompressGroupedKeywordedFilenameReference(result []KeywordGrouped[*KeywordedFilenameReference]) []KeywordGrouped[*KeywordedFilenameReference]

func (*GenerateGithubBinaryTemplateData) CompressGroupedKeywordedanualPageReference

func (ggbtd *GenerateGithubBinaryTemplateData) CompressGroupedKeywordedanualPageReference(result []KeywordGrouped[*KeywordedManualPageReference]) []KeywordGrouped[*KeywordedManualPageReference]

func (*GenerateGithubBinaryTemplateData) CompressedManualPages

func (ggbtd *GenerateGithubBinaryTemplateData) CompressedManualPages() (result []KeywordGrouped[*KeywordedManualPageReference])

func (*GenerateGithubBinaryTemplateData) Documents

func (*GenerateGithubBinaryTemplateData) ExternalResources

func (*GenerateGithubBinaryTemplateData) ExtractedUseFlags

func (ggbtd *GenerateGithubBinaryTemplateData) ExtractedUseFlags() []string

func (*GenerateGithubBinaryTemplateData) G2MetadataArgs added in v0.1.26

func (ggbtd *GenerateGithubBinaryTemplateData) G2MetadataArgs() string

func (*GenerateGithubBinaryTemplateData) GetMustHaveUseFlags

func (ggbtd *GenerateGithubBinaryTemplateData) GetMustHaveUseFlags(programName string, kw string) []string

func (*GenerateGithubBinaryTemplateData) GetMustntHaveUseFlags

func (ggbtd *GenerateGithubBinaryTemplateData) GetMustntHaveUseFlags(programName string, kw string) []string

func (*GenerateGithubBinaryTemplateData) HasCompressedManualPages

func (ggbtd *GenerateGithubBinaryTemplateData) HasCompressedManualPages() bool

func (*GenerateGithubBinaryTemplateData) HasDesktopFile

func (ggbtd *GenerateGithubBinaryTemplateData) HasDesktopFile() bool

func (*GenerateGithubBinaryTemplateData) HasDocuments

func (ggbtd *GenerateGithubBinaryTemplateData) HasDocuments() bool

func (*GenerateGithubBinaryTemplateData) HasManualPages

func (ggbtd *GenerateGithubBinaryTemplateData) HasManualPages() bool

func (*GenerateGithubBinaryTemplateData) HasShellCompletion

func (ggbtd *GenerateGithubBinaryTemplateData) HasShellCompletion(shell string) bool

func (*GenerateGithubBinaryTemplateData) IsArchived

func (ggbtd *GenerateGithubBinaryTemplateData) IsArchived(keyword string) bool

func (*GenerateGithubBinaryTemplateData) KeywordList

func (ggbtd *GenerateGithubBinaryTemplateData) KeywordList() []string

func (*GenerateGithubBinaryTemplateData) Keywords

func (ggbtd *GenerateGithubBinaryTemplateData) Keywords() string

func (*GenerateGithubBinaryTemplateData) MainDependencies

func (ggbtd *GenerateGithubBinaryTemplateData) MainDependencies() []string

func (*GenerateGithubBinaryTemplateData) ManualPages

func (*GenerateGithubBinaryTemplateData) MaskedKeywords

func (ggbtd *GenerateGithubBinaryTemplateData) MaskedKeywords() string

func (*GenerateGithubBinaryTemplateData) Metadata

func (ggbtd *GenerateGithubBinaryTemplateData) Metadata() (string, error)

func (*GenerateGithubBinaryTemplateData) NeedsSrcUnpack

func (ggbtd *GenerateGithubBinaryTemplateData) NeedsSrcUnpack() bool

func (*GenerateGithubBinaryTemplateData) PackageName

func (ggbtd *GenerateGithubBinaryTemplateData) PackageName() string

func (*GenerateGithubBinaryTemplateData) ParseKeywordAndUseFlags

func (ggbtd *GenerateGithubBinaryTemplateData) ParseKeywordAndUseFlags(kw string) (string, []string, []string)

func (*GenerateGithubBinaryTemplateData) ProgramsAsAlternatives

func (ggbtd *GenerateGithubBinaryTemplateData) ProgramsAsAlternatives() map[string][]string

func (*GenerateGithubBinaryTemplateData) ProgramsAsAlternativesForArch

func (ggbtd *GenerateGithubBinaryTemplateData) ProgramsAsAlternativesForArch(forArchitecture string) []string

func (*GenerateGithubBinaryTemplateData) ReverseProgramsAsAlternatives

func (ggbtd *GenerateGithubBinaryTemplateData) ReverseProgramsAsAlternatives() map[string][]string

func (*GenerateGithubBinaryTemplateData) ShellCompletion

func (*GenerateGithubBinaryTemplateData) ShellCompletionInstallPath

func (ggbtd *GenerateGithubBinaryTemplateData) ShellCompletionInstallPath(shell string) (string, error)

func (*GenerateGithubBinaryTemplateData) ShellCompletionShells

func (ggbtd *GenerateGithubBinaryTemplateData) ShellCompletionShells() []string

func (*GenerateGithubBinaryTemplateData) TemplateFileName

func (ggbtd *GenerateGithubBinaryTemplateData) TemplateFileName() string

func (*GenerateGithubBinaryTemplateData) WorkflowFileName

func (ggbtd *GenerateGithubBinaryTemplateData) WorkflowFileName() string

func (*GenerateGithubBinaryTemplateData) WorkflowName

func (ggbtd *GenerateGithubBinaryTemplateData) WorkflowName() string

type GenerateGithubWorkflowBase

type GenerateGithubWorkflowBase struct {
	*InputConfig
	Version    string
	Now        time.Time
	ConfigFile string
}

func (*GenerateGithubWorkflowBase) DefaultMetadata

func (b *GenerateGithubWorkflowBase) DefaultMetadata() (string, error)

func (*GenerateGithubWorkflowBase) G2MetadataArgs added in v0.1.26

func (b *GenerateGithubWorkflowBase) G2MetadataArgs() string

type GenerateWebAppImageTemplateData

type GenerateWebAppImageTemplateData struct {
	*GenerateGithubAppImageTemplateData
}

GenerateWebAppImageTemplateData reuses the Github AppImage workflow data but renders using a different template for non-GitHub downloads.

func (*GenerateWebAppImageTemplateData) TemplateFileName

func (gwatd *GenerateWebAppImageTemplateData) TemplateFileName() string

TemplateFileName returns the template used for arbitrary website downloads.

type GroupedFilenamePartMeaning

type GroupedFilenamePartMeaning struct {
	*FilenamePartMeaning
	Key string
}

func (*GroupedFilenamePartMeaning) Match

type InputConfig

type InputConfig struct {
	EntryNumber      int
	Type             string
	GithubProjectUrl string
	DownloadPageUrl  string
	DownloadMatch    string
	Category         string
	EbuildName       string
	Description      string
	Homepage         string
	GithubRepo       string
	GithubOwner      string
	License          string
	MaintainerEmail  string
	MaintainerName   string
	Workarounds      map[string]string
	Programs         map[string]*Program
	IUse             []string
	RequiredUse      []string
}

InputConfig represents a single configuration entry.

func CreateSanitizeAndAppendInputConfig

func CreateSanitizeAndAppendInputConfig(parsedFields map[string][]string, parsedProgramFields map[string]map[string][]string, configs []*InputConfig) ([]*InputConfig, error)

func GenerateAppImageGithubReleaseConfigEntry

func GenerateAppImageGithubReleaseConfigEntry(gitRepo, tagOverride, tagPrefix string) (*InputConfig, error)

func GenerateBinaryGithubReleaseConfigEntry

func GenerateBinaryGithubReleaseConfigEntry(gitRepo, tagOverride, prefix string) (*InputConfig, error)

func GenerateWebAppImageConfigEntry

func GenerateWebAppImageConfigEntry(pageURL, matchExpr, linkExt string) (*InputConfig, []util.AppImageLink, error)

GenerateWebAppImageConfigEntry builds a configuration entry for a web-hosted AppImage by inspecting the download page and deriving sensible defaults.

func ParseInputConfigReader

func ParseInputConfigReader(file io.Reader) ([]*InputConfig, error)

ParseInputConfigReader parses the given configuration file and returns a slice of InputConfig structures.

func ReadConfigurationFile

func ReadConfigurationFile(configFn string) ([]*InputConfig, error)

func (*InputConfig) CreateAndSanitizeInputConfigProgram

func (ic *InputConfig) CreateAndSanitizeInputConfigProgram(programName string, programFields map[string][]string) (*Program, error)

func (*InputConfig) Cron

func (ic *InputConfig) Cron() string

func (*InputConfig) GenerateGithubWorkflow

func (ic *InputConfig) GenerateGithubWorkflow(file string, now time.Time, templates *template.Template, outputDir, version string) error

func (*InputConfig) GetPrograms

func (ic *InputConfig) GetPrograms() map[string]*Program

func (*InputConfig) ProgramsString

func (ic *InputConfig) ProgramsString() []string

func (*InputConfig) String

func (ic *InputConfig) String() string

String serializes the InputConfig struct back into the configuration file format.

func (*InputConfig) Validate

func (ic *InputConfig) Validate() error

func (*InputConfig) WorkaroundSemanticVersionPrereleaseHack1

func (ic *InputConfig) WorkaroundSemanticVersionPrereleaseHack1() bool

func (*InputConfig) WorkaroundSemanticVersionWithoutV

func (ic *InputConfig) WorkaroundSemanticVersionWithoutV() bool

func (*InputConfig) WorkaroundString

func (ic *InputConfig) WorkaroundString() []string

func (*InputConfig) WorkaroundTagPrefix

func (ic *InputConfig) WorkaroundTagPrefix() string

type KeywordGrouped

type KeywordGrouped[T any] struct {
	Keyword string
	Grouped []T
}

func KeywordGroupCompressor

func KeywordGroupCompressor[T any](ggbtd *GenerateGithubBinaryTemplateData, result []KeywordGrouped[T], comparerFunc func(reference T, reference2 T) bool) []KeywordGrouped[T]

type KeywordedFilenameReference

type KeywordedFilenameReference struct {
	Filepath []string
	Keyword  string
}

func (*KeywordedFilenameReference) DestinationFilename

func (kr *KeywordedFilenameReference) DestinationFilename() string

func (*KeywordedFilenameReference) SourceFilepath

func (kr *KeywordedFilenameReference) SourceFilepath() string

type KeywordedManualPageReference

type KeywordedManualPageReference KeywordedFilenameReference

func (KeywordedManualPageReference) Compressed

func (kmpr KeywordedManualPageReference) Compressed() bool

func (KeywordedManualPageReference) Decompressor

func (kmpr KeywordedManualPageReference) Decompressor() string

func (KeywordedManualPageReference) DestinationFilename

func (kmpr KeywordedManualPageReference) DestinationFilename() string

func (KeywordedManualPageReference) Page

func (kmpr KeywordedManualPageReference) Page() int

func (KeywordedManualPageReference) SourceFilepath

func (kmpr KeywordedManualPageReference) SourceFilepath() string

func (KeywordedManualPageReference) UncompressedSourceFilepath

func (kmpr KeywordedManualPageReference) UncompressedSourceFilepath() string

type Program

type Program struct {
	ProgramName            string
	Binary                 map[string][]string
	DesktopFile            string
	Icons                  []string
	Documents              map[string][][]string
	ManualPage             map[string][][]string
	ShellCompletionScripts map[string]map[string][]string
	Dependencies           []string
}

func (*Program) FirstIcons

func (p *Program) FirstIcons() string

func (*Program) HasCompressedManualPages

func (p *Program) HasCompressedManualPages() bool

func (*Program) HasDesktopFile

func (p *Program) HasDesktopFile() bool

func (*Program) HasDocuments

func (p *Program) HasDocuments() bool

func (*Program) HasManualPage

func (p *Program) HasManualPage() bool

func (*Program) HasShellCompletion

func (p *Program) HasShellCompletion(shell string) bool

func (*Program) InstalledFilename

func (p *Program) InstalledFilename() string

func (*Program) IsArchived

func (p *Program) IsArchived(arch string) bool

func (*Program) IsEmpty

func (p *Program) IsEmpty() bool

func (*Program) ShellCompletion

func (p *Program) ShellCompletion(shell string) (result []*KeywordedFilenameReference)

func (*Program) String

func (p *Program) String() string

Directories

Path Synopsis
cmd
generate command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL