1 |
commit: 9eb6c02ad48ddb65dc1c0e53900237219b03ee90 |
2 |
Author: Gerion Entrup <gerion.entrup <AT> flump <DOT> de> |
3 |
AuthorDate: Tue Feb 11 00:04:28 2020 +0000 |
4 |
Commit: gerion <gerion.entrup <AT> flump <DOT> de> |
5 |
CommitDate: Tue Feb 11 00:05:18 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/user/gerislay.git/commit/?id=9eb6c02a |
7 |
|
8 |
dev-util/ninja: add 1.10.0 |
9 |
|
10 |
bad quality, use the one from the distribution once it is ready |
11 |
|
12 |
Signed-off-by: Gerion Entrup <gerion.entrup <AT> flump.de> |
13 |
|
14 |
dev-util/ninja/Manifest | 4 + |
15 |
dev-util/ninja/files/ninja-1.9.0-musl.patch | 39 ++++++++ |
16 |
dev-util/ninja/metadata.xml | 11 +++ |
17 |
dev-util/ninja/ninja-1.10.0.ebuild | 133 ++++++++++++++++++++++++++++ |
18 |
4 files changed, 187 insertions(+) |
19 |
|
20 |
diff --git a/dev-util/ninja/Manifest b/dev-util/ninja/Manifest |
21 |
new file mode 100644 |
22 |
index 0000000..643b9cb |
23 |
--- /dev/null |
24 |
+++ b/dev-util/ninja/Manifest |
25 |
@@ -0,0 +1,4 @@ |
26 |
+AUX ninja-1.9.0-musl.patch 1997 BLAKE2B 5fa4e9b171a87ebb8fb618a2b4b0c47668d0aaf0a2b3a5b08a3be5649235228d2cd38c3891d52b1d1e0217f16b1e13175a1a077567c07e83ba8cd36aae96c7aa SHA512 78b29a57ec3c4feedf2bcfe9370b30cecd5302f29e8e14c6a3bc01becb555be6330aafba12f9225625af0644ea1f534feba8396d32bb944253a9daa5dd0e98d8 |
27 |
+DIST ninja-1.10.0.tar.gz 210313 BLAKE2B 0a3db145deaea8a990958ad2e812bc18ed014aaba94911a2905b082745a0d08f10ce1113badabaa362f3834540b7bd3858f07e2a5fce268c66d3d6c73e974e76 SHA512 5ed47ef1ff18a03eb73296629679a8617a08ee443e10e28ae9cb24e4506f84fe1eb142888adea9a62364b626b35817def8c55ba956c9b3cbc7b82d3e62293044 |
28 |
+EBUILD ninja-1.10.0.ebuild 2673 BLAKE2B d73d7e8c0edc6202eb09a88eb38646ae52c05bc79a264dc9443661ca5fce009638c99e746de08f9f582e381a286057726cc73f692c6e38d0257a70ffbc07a5ec SHA512 b62abf26edd5279134cce0cac89e018c376ca27649287b6edc1bd2bd83c6e36945829ad8e1736e9b3eef3a94cc647fc2d17cf8ba33777e81b6e71aa65309842c |
29 |
+MISC metadata.xml 340 BLAKE2B 7cf71b1a09f74328ea74362db4250bf038c0455dcd5f65676ceb5d80a61b5c2923696ecfeccf9d6cd264633e7dc00daa80bf960cc67e5b889d18d487d8e89b97 SHA512 4b78365b98eb9b8a1ef27115261dbf426942cccb7be03c8264e2728e60dedfec8fa51ee3f43488043be5af21b28a74c1c81f4767bcc58574873c2223172447b2 |
30 |
|
31 |
diff --git a/dev-util/ninja/files/ninja-1.9.0-musl.patch b/dev-util/ninja/files/ninja-1.9.0-musl.patch |
32 |
new file mode 100644 |
33 |
index 0000000..f6aeb42 |
34 |
--- /dev/null |
35 |
+++ b/dev-util/ninja/files/ninja-1.9.0-musl.patch |
36 |
@@ -0,0 +1,39 @@ |
37 |
+From 567815df38a2ff54ad7478a90bd75c91e434236a Mon Sep 17 00:00:00 2001 |
38 |
+From: makepost <makepost@××××××××.cc> |
39 |
+Date: Mon, 24 Dec 2018 03:13:16 +0200 |
40 |
+Subject: [PATCH] Use st_mtim if st_mtime is macro, fix #1510 |
41 |
+ |
42 |
+In POSIX.1-2008, sys_stat has a st_mtim member and a st_mtime backward |
43 |
+compatibility macro. Should help avoid hardcoding platform detection. |
44 |
+--- |
45 |
+ src/disk_interface.cc | 14 ++++---------- |
46 |
+ 1 file changed, 4 insertions(+), 10 deletions(-) |
47 |
+ |
48 |
+diff --git a/src/disk_interface.cc b/src/disk_interface.cc |
49 |
+index d4c2fb087..dc297c449 100644 |
50 |
+--- a/src/disk_interface.cc |
51 |
++++ b/src/disk_interface.cc |
52 |
+@@ -202,19 +202,13 @@ TimeStamp RealDiskInterface::Stat(const string& path, string* err) const { |
53 |
+ // that it doesn't exist. |
54 |
+ if (st.st_mtime == 0) |
55 |
+ return 1; |
56 |
+-#if defined(__APPLE__) && !defined(_POSIX_C_SOURCE) |
57 |
++#if defined(_AIX) |
58 |
++ return (int64_t)st.st_mtime * 1000000000LL + st.st_mtime_n; |
59 |
++#elif defined(__APPLE__) |
60 |
+ return ((int64_t)st.st_mtimespec.tv_sec * 1000000000LL + |
61 |
+ st.st_mtimespec.tv_nsec); |
62 |
+-#elif (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700 || defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \ |
63 |
+- defined(__BIONIC__) || (defined (__SVR4) && defined (__sun)) || defined(__FreeBSD__)) |
64 |
+- // For glibc, see "Timestamp files" in the Notes of http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html |
65 |
+- // newlib, uClibc and musl follow the kernel (or Cygwin) headers and define the right macro values above. |
66 |
+- // For bsd, see https://github.com/freebsd/freebsd/blob/master/sys/sys/stat.h and similar |
67 |
+- // For bionic, C and POSIX API is always enabled. |
68 |
+- // For solaris, see https://docs.oracle.com/cd/E88353_01/html/E37841/stat-2.html. |
69 |
++#elif defined(st_mtime) // A macro, so we're likely on modern POSIX. |
70 |
+ return (int64_t)st.st_mtim.tv_sec * 1000000000LL + st.st_mtim.tv_nsec; |
71 |
+-#elif defined(_AIX) |
72 |
+- return (int64_t)st.st_mtime * 1000000000LL + st.st_mtime_n; |
73 |
+ #else |
74 |
+ return (int64_t)st.st_mtime * 1000000000LL + st.st_mtimensec; |
75 |
+ #endif |
76 |
|
77 |
diff --git a/dev-util/ninja/metadata.xml b/dev-util/ninja/metadata.xml |
78 |
new file mode 100644 |
79 |
index 0000000..723d554 |
80 |
--- /dev/null |
81 |
+++ b/dev-util/ninja/metadata.xml |
82 |
@@ -0,0 +1,11 @@ |
83 |
+<?xml version="1.0" encoding="UTF-8"?> |
84 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
85 |
+<pkgmetadata> |
86 |
+ <maintainer type="project"> |
87 |
+ <email>chromium@g.o</email> |
88 |
+ <name>Chromium in Gentoo Project</name> |
89 |
+ </maintainer> |
90 |
+ <upstream> |
91 |
+ <remote-id type="github">martine/ninja</remote-id> |
92 |
+ </upstream> |
93 |
+</pkgmetadata> |
94 |
|
95 |
diff --git a/dev-util/ninja/ninja-1.10.0.ebuild b/dev-util/ninja/ninja-1.10.0.ebuild |
96 |
new file mode 100644 |
97 |
index 0000000..60af1db |
98 |
--- /dev/null |
99 |
+++ b/dev-util/ninja/ninja-1.10.0.ebuild |
100 |
@@ -0,0 +1,133 @@ |
101 |
+# Copyright 2012-2020 Gentoo Authors |
102 |
+# Distributed under the terms of the GNU General Public License v2 |
103 |
+ |
104 |
+EAPI=7 |
105 |
+ |
106 |
+PYTHON_COMPAT=( python{2_7,3_6,3_7} ) |
107 |
+ |
108 |
+inherit bash-completion-r1 elisp-common python-any-r1 toolchain-funcs |
109 |
+ |
110 |
+if [[ ${PV} == 9999 ]]; then |
111 |
+ inherit git-r3 |
112 |
+ EGIT_REPO_URI="https://github.com/ninja-build/ninja.git" |
113 |
+else |
114 |
+ MY_P="ninja-${KITWARE_VERSION}" |
115 |
+ SRC_URI="https://github.com/ninja-build/ninja/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
116 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris" |
117 |
+fi |
118 |
+ |
119 |
+DESCRIPTION="A small build system similar to make" |
120 |
+HOMEPAGE="https://ninja-build.org/" |
121 |
+ |
122 |
+LICENSE="Apache-2.0" |
123 |
+SLOT="0" |
124 |
+ |
125 |
+IUSE="doc emacs test vim-syntax" |
126 |
+RESTRICT="!test? ( test )" |
127 |
+ |
128 |
+BDEPEND=" |
129 |
+ ${PYTHON_DEPS} |
130 |
+ dev-util/re2c |
131 |
+ doc? ( |
132 |
+ app-text/asciidoc |
133 |
+ app-doc/doxygen |
134 |
+ dev-libs/libxslt |
135 |
+ ) |
136 |
+ test? ( dev-cpp/gtest ) |
137 |
+" |
138 |
+RDEPEND=" |
139 |
+ emacs? ( >=app-editors/emacs-23.1:* ) |
140 |
+ vim-syntax? ( |
141 |
+ || ( |
142 |
+ app-editors/vim |
143 |
+ app-editors/gvim |
144 |
+ ) |
145 |
+ ) |
146 |
+" |
147 |
+ |
148 |
+# PATCHES=( |
149 |
+# "${FILESDIR}/ninja-1.9.0-musl.patch" |
150 |
+# ) |
151 |
+ |
152 |
+run_for_build() { |
153 |
+ if tc-is-cross-compiler; then |
154 |
+ local -x AR=$(tc-getBUILD_AR) |
155 |
+ local -x CXX=$(tc-getBUILD_CXX) |
156 |
+ local -x CFLAGS= |
157 |
+ local -x CXXFLAGS=${BUILD_CXXFLAGS} |
158 |
+ local -x LDFLAGS=${BUILD_LDFLAGS} |
159 |
+ fi |
160 |
+ echo "$@" >&2 |
161 |
+ "$@" |
162 |
+} |
163 |
+ |
164 |
+src_compile() { |
165 |
+ tc-export AR CXX |
166 |
+ |
167 |
+ # configure.py uses CFLAGS instead of CXXFLAGS |
168 |
+ export CFLAGS=${CXXFLAGS} |
169 |
+ |
170 |
+ run_for_build ${EPYTHON} configure.py --bootstrap --verbose || die |
171 |
+ |
172 |
+ if tc-is-cross-compiler; then |
173 |
+ mv ninja ninja-build || die |
174 |
+ ${EPYTHON} configure.py || die |
175 |
+ ./ninja-build -v ninja || die |
176 |
+ else |
177 |
+ ln ninja ninja-build || die |
178 |
+ fi |
179 |
+ |
180 |
+ if use doc; then |
181 |
+ ./ninja-build -v doxygen manual || die |
182 |
+ fi |
183 |
+ |
184 |
+ if use emacs; then |
185 |
+ elisp-compile misc/ninja-mode.el || die |
186 |
+ fi |
187 |
+} |
188 |
+ |
189 |
+src_test() { |
190 |
+ if ! tc-is-cross-compiler; then |
191 |
+ # Bug 485772 |
192 |
+ ulimit -n 2048 |
193 |
+ ./ninja -v ninja_test || die |
194 |
+ ./ninja_test || die |
195 |
+ fi |
196 |
+} |
197 |
+ |
198 |
+src_install() { |
199 |
+ # dodoc README HACKING.md |
200 |
+ if use doc; then |
201 |
+ docinto html |
202 |
+ dodoc -r doc/doxygen/html/. |
203 |
+ dodoc doc/manual.html |
204 |
+ fi |
205 |
+ dobin ninja |
206 |
+ |
207 |
+ newbashcomp misc/bash-completion "${PN}" |
208 |
+ |
209 |
+ if use vim-syntax; then |
210 |
+ insinto /usr/share/vim/vimfiles/syntax/ |
211 |
+ doins misc/ninja.vim |
212 |
+ |
213 |
+ echo 'au BufNewFile,BufRead *.ninja set ft=ninja' > "${T}/ninja.vim" |
214 |
+ insinto /usr/share/vim/vimfiles/ftdetect |
215 |
+ doins "${T}/ninja.vim" |
216 |
+ fi |
217 |
+ |
218 |
+ insinto /usr/share/zsh/site-functions |
219 |
+ newins misc/zsh-completion _ninja |
220 |
+ |
221 |
+ if use emacs; then |
222 |
+ cd misc || die |
223 |
+ elisp-install ninja ninja-mode.el* || die |
224 |
+ fi |
225 |
+} |
226 |
+ |
227 |
+pkg_postinst() { |
228 |
+ use emacs && elisp-site-regen |
229 |
+} |
230 |
+ |
231 |
+pkg_postrm() { |
232 |
+ use emacs && elisp-site-regen |
233 |
+} |