Gentoo Archives: gentoo-commits

From: Stephan Hartmann <sultan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/gn/files/, dev-util/gn/
Date: Wed, 03 Nov 2021 16:49:56
Message-Id: 1635958138.8729baea03c1267feb19fcea810489c836460483.sultan@gentoo
1 commit: 8729baea03c1267feb19fcea810489c836460483
2 Author: Stephan Hartmann <sultan <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 3 16:48:38 2021 +0000
4 Commit: Stephan Hartmann <sultan <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 3 16:48:58 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8729baea
7
8 dev-util/gn: bump to 0.1942
9
10 Bug: https://bugs.gentoo.org/821400
11 Package-Manager: Portage-3.0.20, Repoman-3.0.3
12 Signed-off-by: Stephan Hartmann <sultan <AT> gentoo.org>
13
14 dev-util/gn/Manifest | 1 +
15 dev-util/gn/files/gn-gen-r5.patch | 46 ++++++++++++++++++++++++++++
16 dev-util/gn/gn-0.1942.ebuild | 64 +++++++++++++++++++++++++++++++++++++++
17 3 files changed, 111 insertions(+)
18
19 diff --git a/dev-util/gn/Manifest b/dev-util/gn/Manifest
20 index bb91def32a7..2e41b70c5b6 100644
21 --- a/dev-util/gn/Manifest
22 +++ b/dev-util/gn/Manifest
23 @@ -1 +1,2 @@
24 DIST gn-0.1807.tar.xz 682644 BLAKE2B 5beb3c03b0ae467cb98eff2069ef6e4355cba56c57e2717139b698fa563efc404dd1cf0b3fd196f432ca3a13b0402e895b46407cb90bc16b63963710fd5be060 SHA512 82f468e389d08a46e582f816d056813af9bfc810ad0bd84f02731c17c0e2c6140a62e827b8a3c5f89eef467f9bcfc2e88dd7aed325a7955d8584e753fcd09103
25 +DIST gn-0.1942.tar.xz 706792 BLAKE2B 2cc3439c1765af9d8068c73f31bbd5bbc947bcf061e59ca3876d2a99687d1d26d6bfcef7cd5b897afb639b48a8a3d8e445b18a71494291368b5a2c0985126602 SHA512 bb2480fb18ff32b502a0448c7a5bf895b9ed4a27a269bf02481fa74b3046bf1c898623007284fbdf89735d1aebcd58ab6f9cfcea85d3652de86435794e2492b0
26
27 diff --git a/dev-util/gn/files/gn-gen-r5.patch b/dev-util/gn/files/gn-gen-r5.patch
28 new file mode 100644
29 index 00000000000..80966b3c7f5
30 --- /dev/null
31 +++ b/dev-util/gn/files/gn-gen-r5.patch
32 @@ -0,0 +1,46 @@
33 +From ef45f2e73264e62ad3fb24d064453a17099da8d7 Mon Sep 17 00:00:00 2001
34 +From: Mike Gilbert <floppym@g.o>
35 +Date: Sat, 14 Mar 2020 18:02:51 +0000
36 +Subject: [PATCH] Remove unwanted cflags/ldflags parameters
37 +
38 +---
39 + build/gen.py | 9 ---------
40 + 1 file changed, 9 deletions(-)
41 +
42 +diff --git a/build/gen.py b/build/gen.py
43 +index 265b1f5..06c6d8b 100755
44 +--- a/build/gen.py
45 ++++ b/build/gen.py
46 +@@ -343,11 +343,6 @@ def WriteGNNinja(path, platform, host, options):
47 + if options.debug:
48 + cflags.extend(['-O0', '-g'])
49 + else:
50 +- cflags.append('-DNDEBUG')
51 +- cflags.append('-O3')
52 +- if options.no_strip:
53 +- cflags.append('-g')
54 +- ldflags.append('-O3')
55 + # Use -fdata-sections and -ffunction-sections to place each function
56 + # or data item into its own section so --gc-sections can eliminate any
57 + # unused functions and data items.
58 +@@ -383,7 +378,6 @@ def WriteGNNinja(path, platform, host, options):
59 + '-D_FILE_OFFSET_BITS=64',
60 + '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS',
61 + '-pthread',
62 +- '-pipe',
63 + '-fno-exceptions',
64 + '-fno-rtti',
65 + '-fdiagnostics-color',
66 +@@ -411,9 +405,6 @@ def WriteGNNinja(path, platform, host, options):
67 + '-Wno-cast-function-type', # Casting FARPROC to RegDeleteKeyExPtr
68 + '-std=gnu++17',
69 + ])
70 +- else:
71 +- # This is needed by libc++.
72 +- libs.append('-ldl')
73 + elif platform.is_darwin():
74 + min_mac_version_flag = '-mmacosx-version-min=10.9'
75 + cflags.append(min_mac_version_flag)
76 +--
77 +2.32.0
78 +
79
80 diff --git a/dev-util/gn/gn-0.1942.ebuild b/dev-util/gn/gn-0.1942.ebuild
81 new file mode 100644
82 index 00000000000..0722a1480a0
83 --- /dev/null
84 +++ b/dev-util/gn/gn-0.1942.ebuild
85 @@ -0,0 +1,64 @@
86 +# Copyright 2018-2021 Gentoo Authors
87 +# Distributed under the terms of the GNU General Public License v2
88 +
89 +EAPI=7
90 +PYTHON_COMPAT=( python3_{7,8,9} )
91 +
92 +inherit ninja-utils python-any-r1 toolchain-funcs
93 +
94 +DESCRIPTION="GN is a meta-build system that generates build files for Ninja"
95 +HOMEPAGE="https://gn.googlesource.com/"
96 +SRC_URI="https://dev.gentoo.org/~sultan/distfiles/dev-util/gn/${P}.tar.xz"
97 +
98 +LICENSE="BSD"
99 +SLOT="0"
100 +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
101 +IUSE="vim-syntax"
102 +
103 +BDEPEND="
104 + ${PYTHON_DEPS}
105 + dev-util/ninja
106 +"
107 +
108 +PATCHES=(
109 + "${FILESDIR}"/gn-gen-r5.patch
110 +)
111 +
112 +pkg_setup() {
113 + :
114 +}
115 +
116 +src_configure() {
117 + python_setup
118 + tc-export AR CC CXX
119 + unset CFLAGS
120 + set -- ${EPYTHON} build/gen.py --no-last-commit-position --no-strip --no-static-libstdc++
121 + echo "$@" >&2
122 + "$@" || die
123 + cat >out/last_commit_position.h <<-EOF || die
124 + #ifndef OUT_LAST_COMMIT_POSITION_H_
125 + #define OUT_LAST_COMMIT_POSITION_H_
126 + #define LAST_COMMIT_POSITION_NUM ${PV##0.}
127 + #define LAST_COMMIT_POSITION "${PV}"
128 + #endif // OUT_LAST_COMMIT_POSITION_H_
129 + EOF
130 +}
131 +
132 +src_compile() {
133 + eninja -C out gn
134 +}
135 +
136 +src_test() {
137 + eninja -C out gn_unittests
138 + out/gn_unittests || die
139 +}
140 +
141 +src_install() {
142 + dobin out/gn
143 + einstalldocs
144 +
145 + if use vim-syntax; then
146 + insinto /usr/share/vim/vimfiles
147 + doins -r misc/vim/{autoload,ftdetect,ftplugin,syntax}
148 + fi
149 +}