Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/syncthing/files/, net-p2p/syncthing/
Date: Tue, 18 Jan 2022 16:40:49
Message-Id: 1642524037.4c317ff343d33abac8337fc9e4175a5034264860.marecki@gentoo
1 commit: 4c317ff343d33abac8337fc9e4175a5034264860
2 Author: Alexandra Parker <alex.iris.parker <AT> gmail <DOT> com>
3 AuthorDate: Thu Jan 13 18:48:39 2022 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 18 16:40:37 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c317ff3
7
8 net-p2p/syncthing: support cross compilation (take 2)
9
10 now with support for USE=tools
11
12 Package-Manager: Portage-3.0.30, Repoman-3.0.3
13 Signed-off-by: Alexandra Parker <alex.iris.parker <AT> gmail.com>
14 Closes: https://github.com/gentoo/gentoo/pull/23778
15 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
16
17 .../files/syncthing-1.18.6-build-out.patch | 30 ++++++++++++++++++++++
18 net-p2p/syncthing/syncthing-1.18.6.ebuild | 6 +++--
19 2 files changed, 34 insertions(+), 2 deletions(-)
20
21 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
22 new file mode 100644
23 index 000000000000..20dc63dca2f5
24 --- /dev/null
25 +++ b/net-p2p/syncthing/files/syncthing-1.18.6-build-out.patch
26 @@ -0,0 +1,30 @@
27 +diff --git a/build.go b/build.go
28 +index c2e1059398..7888c834d2 100644
29 +--- a/build.go
30 ++++ b/build.go
31 +@@ -47,6 +47,7 @@ var (
32 + cc string
33 + run string
34 + benchRun string
35 ++ buildOut string
36 + debugBinary bool
37 + coverage bool
38 + long bool
39 +@@ -374,6 +375,7 @@ func parseFlags() {
40 + flag.StringVar(&run, "run", "", "Specify which tests to run")
41 + flag.StringVar(&benchRun, "bench", "", "Specify which benchmarks to run")
42 + flag.BoolVar(&withNextGenGUI, "with-next-gen-gui", withNextGenGUI, "Also build 'newgui'")
43 ++ flag.StringVar(&buildOut, "build-out", "", "Set the '-o' value for 'go build'")
44 + flag.Parse()
45 + }
46 +
47 +@@ -506,6 +508,9 @@ func build(target target, tags []string) {
48 + }
49 +
50 + args := []string{"build", "-v"}
51 ++ if buildOut != "" {
52 ++ args = append(args, "-o", buildOut)
53 ++ }
54 + args = appendParameters(args, tags, target.buildPkgs...)
55 + runPrint(goCmd, args...)
56 + }
57
58 diff --git a/net-p2p/syncthing/syncthing-1.18.6.ebuild b/net-p2p/syncthing/syncthing-1.18.6.ebuild
59 index 60872181cf9e..e7512849c254 100644
60 --- a/net-p2p/syncthing/syncthing-1.18.6.ebuild
61 +++ b/net-p2p/syncthing/syncthing-1.18.6.ebuild
62 @@ -807,6 +807,7 @@ DOCS=( README.md AUTHORS CONTRIBUTING.md )
63 PATCHES=(
64 "${FILESDIR}"/${PN}-1.3.4-TestIssue5063_timeout.patch
65 "${FILESDIR}"/${PN}-1.18.4-tool_users.patch
66 + "${FILESDIR}"/${PN}-1.18.6-build-out.patch
67 )
68
69 src_prepare() {
70 @@ -828,8 +829,9 @@ src_prepare() {
71 }
72
73 src_compile() {
74 - go run build.go -version "v${PV}" -no-upgrade install \
75 - $(usex tools "all" "") || die "build failed"
76 + GOARCH= go run build.go -version "v${PV}" -no-upgrade -build-out=bin/ \
77 + ${GOARCH:+-goarch="${GOARCH}"} \
78 + build $(usex tools "all" "") || die "build failed"
79 }
80
81 src_test() {