From: ericonr <ericonr@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] [RFC] Go build helper
Date: Mon, 16 Nov 2020 00:35:42 +0100 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26417@inbox.vuxu.org> (raw)
[-- 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
}
next reply other threads:[~2020-11-15 23:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-15 23:35 ericonr [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26417@inbox.vuxu.org \
--to=ericonr@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).