Categorygithub.com/DanielNos/makego
repositorypackage
0.0.0-20240802184008-47e51b143c47
Repository: https://github.com/danielnos/makego.git
Documentation: pkg.go.dev

# README

MakeGo

MakeGo is a simple tool for compilation and packaging of Go projects. It uses a single TOML configuration file to automate the build process and package for all major Linux systems.

How to Build

  1. Clone or download the repository.
  2. Build using
    • MakeGo: Run makego
    • Go: Run go get && go build -ldflags="-w -s" .

Installation

MakeGo can be downloaded as a binary, as a package from the Releases page or using Go's package manager.

Installing Using Go

  1. Run: go install github.com/DanielNos/makego@latest

Installing Binary

Linux

  1. Download the correct MakeGo binary for your system.
  2. Move the package to /usr/local/bin: mv [binary name] /usr/local/bin/makego

Windows

  1. Download the correct MakeGo binary for your system.
  2. Move it to the folder where it should be installed.
  3. Open the Edit the system environment variables application.
  4. Go to the Advanced tab and click on the Environment Variables... button.
  5. Find the Path environment variable and click Edit.
  6. Click New and write the path to your installation folder to the new Field.
  7. Click OK. You may need to restart your terminal or system to apply this change.

Installing Package

  1. Download the correct MakeGo package for your package manager.
  2. Install it using the package manager:
    • APT: sudo apt install [package path]
    • DNF: sudo dnf install [package path]
    • PacMan: sudo pacman -S [package path]

Quick Start

  1. Create a new configuration file: makego new
  2. Edit the make.toml file to suit your needs.
  3. Build your project: makego

Commands

Usage

makego [action [argument]] [config file]

Actions

Default action is all.

  • help - Shows help.
  • new [template] - Creates a new config from a template. Templates: normal, all, empty
  • clean or cln - Removes all build and package directories.
  • binary or bin - Builds project binaries.
  • package or pkg - Builds project binaries and packages them.
  • all - Does the same as package.
  • purge - Removes all build and packaging tools.

Flags

  • --help or -h - Shows help.
  • --version or -v - Shows version.
  • --time or -t - Prints timestamps for log messages.

Config File

This is how the default make.toml template looks:

[application]
name = "app"
version = "1.0.0"
description = "My cool application."
long_description = "My cool application."
url = "https://github.com/Username/app"
license = ""
gui = false

[desktop_entry]
name = "App"
icon = "./icon.png"
categories = [ "Utility" ]

[maintainer]
name = "Name Surname"
email = "[email protected]"

[build]
target = "."
flags = "-ldflags=\"-w -s\""
platforms = [ "linux/amd64", "windows/amd64", "darwin/arm64" ]

[deb]
package = false
architectures = [ "amd64" ]

[rpm]
package = false
build_src = true
architectures = [ "amd64" ]

[pkg]
package = true
architectures = [ "amd64" ]

[appimage]
package = true
architectures = [ "amd64" ]
custom_apprun = ""

application

FieldData TypeDescription
namestringThe name of the application.
versionstringThe version of the application. Should be either X.X.X or X.X.
descriptionstringA short description of your application.
long_descriptionstringA long description of your application. Used only in RPM packages.
urlstringThe url of the main web page for your application.
licensestringA short name of your project's license (MIT, AGPLv2, ...). Should not contain spaces.
guiboolWhether the application has a GUI or is terminal only.

desktop_entry

FieldData TypeDescription
namestringThe name of the application used in desktop entries of the application.
iconstringThe icon of the desktop entry.
categoriesstring arrayThe categories in which your application falls. List of all valid categories can be found at specifications.freedesktop.org.

maintainer

FieldData TypeDescription
namestringThe name and surname of the project maintainer.
emailstringThe email address of the project maintainer.

build

FieldData TypeDescription
targetstringBuild target when running go build [target].
flagsstringBuild flags.
platformsstring arrayBuild platforms in format [GOOS]/[GOARCH]. List of all operating systems and architectures can be found on go.dev/doc.

deb, pkg

FieldData TypeDescription
packageboolShould the application be packaged for this packaging system.
architecturesstring arrayWhich architectures should be packaged.

rpm

FieldData TypeDescription
packageboolShould the application be packaged for this packaging system.
build_srcboolShould the source package be built.
architecturesstring arrayWhich architectures should be packaged.

appimage

FieldData TypeDescription
packageboolShould the application be packaged for this packaging system.
architecturesstring arrayWhich architectures should be packaged.
custom_apprunstringPath to custom AppRun. If left empty, official default AppRun will be used.

Supported Architectures:

Package FormatArchitectures
deb, RPM, AppImageamd64, 386, arm, arm64
pkgamd64

It's possible to package other architectures that aren't specified here, but they are either unsupported by the packaging system or not tested