summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandra Parker <alex.iris.parker@gmail.com>2022-01-13 10:48:39 -0800
committerMarek Szuba <marecki@gentoo.org>2022-01-18 17:40:37 +0100
commit4c317ff343d33abac8337fc9e4175a5034264860 (patch)
treefd9c3046202173a47ef18ee182c00c7f92bd6049 /net-p2p
parentacct-group/strelaysrv: treeclean (diff)
downloadgentoo-4c317ff343d33abac8337fc9e4175a5034264860.tar.gz
gentoo-4c317ff343d33abac8337fc9e4175a5034264860.tar.bz2
gentoo-4c317ff343d33abac8337fc9e4175a5034264860.zip
net-p2p/syncthing: support cross compilation (take 2)
now with support for USE=tools Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Alexandra Parker <alex.iris.parker@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/23778 Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/syncthing/files/syncthing-1.18.6-build-out.patch30
-rw-r--r--net-p2p/syncthing/syncthing-1.18.6.ebuild6
2 files changed, 34 insertions, 2 deletions
diff --git a/net-p2p/syncthing/files/syncthing-1.18.6-build-out.patch b/net-p2p/syncthing/files/syncthing-1.18.6-build-out.patch
new file mode 100644
index 000000000000..20dc63dca2f5
--- /dev/null
+++ b/net-p2p/syncthing/files/syncthing-1.18.6-build-out.patch
@@ -0,0 +1,30 @@
+diff --git a/build.go b/build.go
+index c2e1059398..7888c834d2 100644
+--- a/build.go
++++ b/build.go
+@@ -47,6 +47,7 @@ var (
+ cc string
+ run string
+ benchRun string
++ buildOut string
+ debugBinary bool
+ coverage bool
+ long bool
+@@ -374,6 +375,7 @@ func parseFlags() {
+ flag.StringVar(&run, "run", "", "Specify which tests to run")
+ flag.StringVar(&benchRun, "bench", "", "Specify which benchmarks to run")
+ flag.BoolVar(&withNextGenGUI, "with-next-gen-gui", withNextGenGUI, "Also build 'newgui'")
++ flag.StringVar(&buildOut, "build-out", "", "Set the '-o' value for 'go build'")
+ flag.Parse()
+ }
+
+@@ -506,6 +508,9 @@ func build(target target, tags []string) {
+ }
+
+ args := []string{"build", "-v"}
++ if buildOut != "" {
++ args = append(args, "-o", buildOut)
++ }
+ args = appendParameters(args, tags, target.buildPkgs...)
+ runPrint(goCmd, args...)
+ }
diff --git a/net-p2p/syncthing/syncthing-1.18.6.ebuild b/net-p2p/syncthing/syncthing-1.18.6.ebuild
index 60872181cf9e..e7512849c254 100644
--- a/net-p2p/syncthing/syncthing-1.18.6.ebuild
+++ b/net-p2p/syncthing/syncthing-1.18.6.ebuild
@@ -807,6 +807,7 @@ DOCS=( README.md AUTHORS CONTRIBUTING.md )
PATCHES=(
"${FILESDIR}"/${PN}-1.3.4-TestIssue5063_timeout.patch
"${FILESDIR}"/${PN}-1.18.4-tool_users.patch
+ "${FILESDIR}"/${PN}-1.18.6-build-out.patch
)
src_prepare() {
@@ -828,8 +829,9 @@ src_prepare() {
}
src_compile() {
- go run build.go -version "v${PV}" -no-upgrade install \
- $(usex tools "all" "") || die "build failed"
+ GOARCH= go run build.go -version "v${PV}" -no-upgrade -build-out=bin/ \
+ ${GOARCH:+-goarch="${GOARCH}"} \
+ build $(usex tools "all" "") || die "build failed"
}
src_test() {