Skip to content

Commit

Permalink
packages: Add Helloworld a Golang example build
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfbbqhax committed Jun 27, 2024
1 parent e7940a3 commit 1cacb27
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/helloworld/APKBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributor: Your Name <[email protected]>
# Maintainer: Your Name <[email protected]>
pkgname=helloworld
pkgver=1.0.0
pkgrel=0
pkgdesc="My Golang project"
url="https://github.com/yourusername/mygoproject"
arch="all"
license="MIT"
depends=""
makedepends="go"
source="helloworld-$pkgver.tar.gz"
builddir="$srcdir/helloworld-$pkgver"

build() {
export GOPATH="$builddir"
cd src/helloworld
go mod init helloworld
go build .
}

package() {
cd "$builddir"
install -Dm755 $GOPATH/src/helloworld/helloworld "$pkgdir/usr/bin/helloworld"
}

sha512sums="
c933d316d5fcf12e3fedac4dc83681a5e4c821435bd3f982236c01df044878027cf53c430cdbfad786570562dff1a4b21cfa32780e171f7ddded3fc5ac50404f helloworld-1.0.0.tar.gz
"
Binary file added packages/helloworld/helloworld-1.0.0.tar.gz
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/helloworld/helloworld-1.0.0/src/helloworld/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package main

import "fmt"

func main() {
fmt.Println("Hello, world!")
}

0 comments on commit 1cacb27

Please sign in to comment.