Packaging Go for Arch Linux Tutorial

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • k3sup

    bootstrap K3s over SSH in < 60s 🚀

  • # Maintainer: Talha Altinel pkgname=k3sup pkgver=0.13.0 pkgrel=1 pkgdesc='A tool to bootstrap K3s over SSH in < 60s' arch=('x86_64') url='https://github.com/alexellis/k3sup' license=('MIT') depends=('glibc' 'openssh') makedepends=('git' 'go>=1.20') source=("${pkgname}-${pkgver}.tar.gz::https://github.com/alexellis/k3sup/archive/${pkgver}.tar.gz") sha256sums=('24939844ac6de581eb05ef6425c89c32b2d0e22800f1344c19b2164eec846c92') _commit=('1d2e443ea56a355cc6bd0a14a8f8a2661a72f2e8') build() { cd "$pkgname-$pkgver" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" go build \ -ldflags "-s -w -X github.com/alexellis/k3sup/cmd.Version=$pkgver -X github.com/alexellis/k3sup/cmd.GitCommit=$_commit" \ -o k3sup \ . for shell in bash fish zsh; do ./k3sup completion "$shell" > "$shell-completion" done } package() { cd "$pkgname-$pkgver" install -Dm755 -t "$pkgdir/usr/bin" k3sup mkdir -p "${pkgdir}/usr/share/bash-completion/completions/" mkdir -p "${pkgdir}/usr/share/zsh/site-functions/" mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/" install -Dm644 bash-completion "$pkgdir/usr/share/bash-completion/completions/k3sup" install -Dm644 fish-completion "$pkgdir/usr/share/fish/vendor_completions.d/k3sup.fish" install -Dm644 zsh-completion "$pkgdir/usr/share/zsh/site-functions/_k3sup" install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE }

  • cobra

    A Commander for modern Go CLI interactions

  • In my build phase, I compile the source to create a k3sup binary and I also run the binary to generate shell script completions. Give kudos to this functionality which comes from spf13/cobra Go library for CLIs.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts