Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] Go build helper
@ 2020-11-15 23:35 ericonr
  2020-11-17  0:52 ` ericonr
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ericonr @ 2020-11-15 23:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

There is a new pull request by ericonr against master on the void-packages repository

https://github.com/ericonr/void-packages gostyle
https://github.com/void-linux/void-packages/pull/26417

[RFC] Go build helper
Fixes #12518

@Johnnynator 

A patch file from https://github.com/void-linux/void-packages/pull/26417.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gostyle-26417.patch --]
[-- Type: text/x-diff, Size: 4650 bytes --]

From 4eb744c007302197f11d57730c1ad79e1e2ef2fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sun, 15 Nov 2020 20:33:05 -0300
Subject: [PATCH 1/2] common/{env,helper}: create Go build-helper.

Split the environment file from go build style into a build helper
that's pulled in automatically by the go build style.
---
 common/build-helper/go.sh            | 41 +++++++++++++++++++++++++++
 common/environment/build-style/go.sh | 42 +---------------------------
 2 files changed, 42 insertions(+), 41 deletions(-)
 create mode 100644 common/build-helper/go.sh

diff --git a/common/build-helper/go.sh b/common/build-helper/go.sh
new file mode 100644
index 00000000000..3f83013d4f7
--- /dev/null
+++ b/common/build-helper/go.sh
@@ -0,0 +1,41 @@
+if [ -z "$hostmakedepends" -o "${hostmakedepends##*gcc-go-tools*}" ]; then
+	# gc compiler
+	if [ -z "$archs" ]; then
+		archs="aarch64* armv[567]* i686* x86_64* ppc64le*"
+	fi
+	hostmakedepends+=" go"
+	nopie=yes
+else
+	# gccgo compiler
+	if [ "$CROSS_BUILD" ]; then
+		# target compiler to use; otherwise it'll just call gccgo
+		export GCCGO="${XBPS_CROSS_TRIPLET}-gccgo"
+	fi
+fi
+nostrip=yes
+
+case "$XBPS_TARGET_MACHINE" in
+	aarch64*) export GOARCH=arm64;;
+	armv5*) export GOARCH=arm; export GOARM=5;;
+	armv6*) export GOARCH=arm; export GOARM=6;;
+	armv7*) export GOARCH=arm; export GOARM=7;;
+	i686*) export GOARCH=386;;
+	x86_64*) export GOARCH=amd64;;
+	ppc64le*) export GOARCH=ppc64le;;
+	ppc64*) export GOARCH=ppc64;;
+	ppc*) export GOARCH=ppc;;
+	mipsel*) export GOARCH=mipsle;;
+	mips*) export GOARCH=mips;;
+esac
+
+export GOPATH="${wrksrc}/_build-${pkgname}-xbps"
+GOSRCPATH="${GOPATH}/src/${go_import_path}"
+export CGO_CFLAGS="$CFLAGS"
+export CGO_CPPFLAGS="$CPPFLAGS"
+export CGO_CXXFLAGS="$CXXFLAGS"
+export CGO_LDFLAGS="$LDFLAGS"
+export CGO_ENABLED=1
+case "$XBPS_TARGET_MACHINE" in
+	*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
+	*)	export GOCACHE="${XBPS_HOSTDIR}/gocache-glibc" ;;
+esac
diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh
index 3f83013d4f7..a765f7bab89 100644
--- a/common/environment/build-style/go.sh
+++ b/common/environment/build-style/go.sh
@@ -1,41 +1 @@
-if [ -z "$hostmakedepends" -o "${hostmakedepends##*gcc-go-tools*}" ]; then
-	# gc compiler
-	if [ -z "$archs" ]; then
-		archs="aarch64* armv[567]* i686* x86_64* ppc64le*"
-	fi
-	hostmakedepends+=" go"
-	nopie=yes
-else
-	# gccgo compiler
-	if [ "$CROSS_BUILD" ]; then
-		# target compiler to use; otherwise it'll just call gccgo
-		export GCCGO="${XBPS_CROSS_TRIPLET}-gccgo"
-	fi
-fi
-nostrip=yes
-
-case "$XBPS_TARGET_MACHINE" in
-	aarch64*) export GOARCH=arm64;;
-	armv5*) export GOARCH=arm; export GOARM=5;;
-	armv6*) export GOARCH=arm; export GOARM=6;;
-	armv7*) export GOARCH=arm; export GOARM=7;;
-	i686*) export GOARCH=386;;
-	x86_64*) export GOARCH=amd64;;
-	ppc64le*) export GOARCH=ppc64le;;
-	ppc64*) export GOARCH=ppc64;;
-	ppc*) export GOARCH=ppc;;
-	mipsel*) export GOARCH=mipsle;;
-	mips*) export GOARCH=mips;;
-esac
-
-export GOPATH="${wrksrc}/_build-${pkgname}-xbps"
-GOSRCPATH="${GOPATH}/src/${go_import_path}"
-export CGO_CFLAGS="$CFLAGS"
-export CGO_CPPFLAGS="$CPPFLAGS"
-export CGO_CXXFLAGS="$CXXFLAGS"
-export CGO_LDFLAGS="$LDFLAGS"
-export CGO_ENABLED=1
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) export GOCACHE="${XBPS_HOSTDIR}/gocache-muslc" ;;
-	*)	export GOCACHE="${XBPS_HOSTDIR}/gocache-glibc" ;;
-esac
+build_helper+=" go"

From 6f6ae65530dd7381d55cbdc7cf8a0f9a4eaf62f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sun, 15 Nov 2020 20:34:44 -0300
Subject: [PATCH 2/2] aerc: use go build helper.

---
 srcpkgs/aerc/template | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/srcpkgs/aerc/template b/srcpkgs/aerc/template
index 08c81ef0d4e..e0938103dc6 100644
--- a/srcpkgs/aerc/template
+++ b/srcpkgs/aerc/template
@@ -2,7 +2,9 @@
 pkgname=aerc
 version=0.5.2
 revision=1
-build_style=go
+build_helper=go
+build_style=gnu-makefile
+make_build_args="GOFLAGS=-tags=notmuch PREFIX=/usr"
 hostmakedepends="scdoc git"
 makedepends="libnotmuch-devel"
 short_desc="Terminal email client"
@@ -12,18 +14,6 @@ homepage="https://aerc-mail.org"
 distfiles="https://git.sr.ht/~sircmpwn/aerc/archive/${version}.tar.gz"
 checksum=87b922440e53b99f260d2332996537decb452c838c774e9340b633296f9f68ee
 
-do_configure() {
-	:
-}
-
-do_build() {
-	make ${makejobs} PREFIX=/usr GOFLAGS=-tags=notmuch
-}
-
-do_install() {
-	make STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} install
-}
-
 post_install() {
 	vlicense LICENSE
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC] Go build helper
  2020-11-15 23:35 [PR PATCH] [RFC] Go build helper ericonr
@ 2020-11-17  0:52 ` ericonr
  2020-12-30  6:54 ` the-maldridge
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ericonr @ 2020-11-17  0:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26417#issuecomment-728564304

Comment:
This PR is waiting on confirmation that it actually fixes an existing problem.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC] Go build helper
  2020-11-15 23:35 [PR PATCH] [RFC] Go build helper ericonr
  2020-11-17  0:52 ` ericonr
@ 2020-12-30  6:54 ` the-maldridge
  2021-02-05  4:00 ` ericonr
  2021-02-05  4:00 ` [PR PATCH] [Closed]: " ericonr
  3 siblings, 0 replies; 5+ messages in thread
From: the-maldridge @ 2020-12-30  6:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

New comment by the-maldridge on void-packages repository

https://github.com/void-linux/void-packages/pull/26417#issuecomment-752350712

Comment:
I'm not entirely convinced this actually fixes a problem that exists, but I wasn't convinced about the rust helper either and it works okay, so I leave this to your gut feeling @ericonr .

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC] Go build helper
  2020-11-15 23:35 [PR PATCH] [RFC] Go build helper ericonr
  2020-11-17  0:52 ` ericonr
  2020-12-30  6:54 ` the-maldridge
@ 2021-02-05  4:00 ` ericonr
  2021-02-05  4:00 ` [PR PATCH] [Closed]: " ericonr
  3 siblings, 0 replies; 5+ messages in thread
From: ericonr @ 2021-02-05  4:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26417#issuecomment-773771103

Comment:
Closing for now, can be re-opened if the need for a Go build helper is detected.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Closed]: [RFC] Go build helper
  2020-11-15 23:35 [PR PATCH] [RFC] Go build helper ericonr
                   ` (2 preceding siblings ...)
  2021-02-05  4:00 ` ericonr
@ 2021-02-05  4:00 ` ericonr
  3 siblings, 0 replies; 5+ messages in thread
From: ericonr @ 2021-02-05  4:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

There's a closed pull request on the void-packages repository

[RFC] Go build helper
https://github.com/void-linux/void-packages/pull/26417

Description:
Fixes #12518

@Johnnynator 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-05  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15 23:35 [PR PATCH] [RFC] Go build helper ericonr
2020-11-17  0:52 ` ericonr
2020-12-30  6:54 ` the-maldridge
2021-02-05  4:00 ` ericonr
2021-02-05  4:00 ` [PR PATCH] [Closed]: " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).