Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/ninja/, dev-util/ninja/files/
Date: Wed, 03 Apr 2019 19:50:21
Message-Id: 1554320989.b6ab66e96f36dd162edf26463d9fa93c2f3f131e.floppym@gentoo
1 commit: b6ab66e96f36dd162edf26463d9fa93c2f3f131e
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 3 19:49:49 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 3 19:49:49 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6ab66e9
7
8 dev-util/ninja: fix build on bsd/musl
9
10 Closes: https://bugs.gentoo.org/663216
11 Package-Manager: Portage-2.3.62_p4, Repoman-2.3.12_p87
12 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
13
14 dev-util/ninja/files/ninja-1.9.0-musl.patch | 39 +++++++++++++++++++++++++++++
15 dev-util/ninja/ninja-1.9.0.ebuild | 6 ++++-
16 dev-util/ninja/ninja-9999.ebuild | 2 +-
17 3 files changed, 45 insertions(+), 2 deletions(-)
18
19 diff --git a/dev-util/ninja/files/ninja-1.9.0-musl.patch b/dev-util/ninja/files/ninja-1.9.0-musl.patch
20 new file mode 100644
21 index 00000000000..f6aeb428974
22 --- /dev/null
23 +++ b/dev-util/ninja/files/ninja-1.9.0-musl.patch
24 @@ -0,0 +1,39 @@
25 +From 567815df38a2ff54ad7478a90bd75c91e434236a Mon Sep 17 00:00:00 2001
26 +From: makepost <makepost@××××××××.cc>
27 +Date: Mon, 24 Dec 2018 03:13:16 +0200
28 +Subject: [PATCH] Use st_mtim if st_mtime is macro, fix #1510
29 +
30 +In POSIX.1-2008, sys_stat has a st_mtim member and a st_mtime backward
31 +compatibility macro. Should help avoid hardcoding platform detection.
32 +---
33 + src/disk_interface.cc | 14 ++++----------
34 + 1 file changed, 4 insertions(+), 10 deletions(-)
35 +
36 +diff --git a/src/disk_interface.cc b/src/disk_interface.cc
37 +index d4c2fb087..dc297c449 100644
38 +--- a/src/disk_interface.cc
39 ++++ b/src/disk_interface.cc
40 +@@ -202,19 +202,13 @@ TimeStamp RealDiskInterface::Stat(const string& path, string* err) const {
41 + // that it doesn't exist.
42 + if (st.st_mtime == 0)
43 + return 1;
44 +-#if defined(__APPLE__) && !defined(_POSIX_C_SOURCE)
45 ++#if defined(_AIX)
46 ++ return (int64_t)st.st_mtime * 1000000000LL + st.st_mtime_n;
47 ++#elif defined(__APPLE__)
48 + return ((int64_t)st.st_mtimespec.tv_sec * 1000000000LL +
49 + st.st_mtimespec.tv_nsec);
50 +-#elif (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700 || defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \
51 +- defined(__BIONIC__) || (defined (__SVR4) && defined (__sun)) || defined(__FreeBSD__))
52 +- // For glibc, see "Timestamp files" in the Notes of http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html
53 +- // newlib, uClibc and musl follow the kernel (or Cygwin) headers and define the right macro values above.
54 +- // For bsd, see https://github.com/freebsd/freebsd/blob/master/sys/sys/stat.h and similar
55 +- // For bionic, C and POSIX API is always enabled.
56 +- // For solaris, see https://docs.oracle.com/cd/E88353_01/html/E37841/stat-2.html.
57 ++#elif defined(st_mtime) // A macro, so we're likely on modern POSIX.
58 + return (int64_t)st.st_mtim.tv_sec * 1000000000LL + st.st_mtim.tv_nsec;
59 +-#elif defined(_AIX)
60 +- return (int64_t)st.st_mtime * 1000000000LL + st.st_mtime_n;
61 + #else
62 + return (int64_t)st.st_mtime * 1000000000LL + st.st_mtimensec;
63 + #endif
64
65 diff --git a/dev-util/ninja/ninja-1.9.0.ebuild b/dev-util/ninja/ninja-1.9.0.ebuild
66 index 8eb95d5047f..4bc01a90da3 100644
67 --- a/dev-util/ninja/ninja-1.9.0.ebuild
68 +++ b/dev-util/ninja/ninja-1.9.0.ebuild
69 @@ -44,7 +44,11 @@ RDEPEND="
70 app-editors/gvim
71 )
72 )
73 - !<net-irc/ninja-1.5.9_pre14-r1" #436804
74 +"
75 +
76 +PATCHES=(
77 + "${FILESDIR}/ninja-1.9.0-musl.patch"
78 +)
79
80 run_for_build() {
81 if tc-is-cross-compiler; then
82
83 diff --git a/dev-util/ninja/ninja-9999.ebuild b/dev-util/ninja/ninja-9999.ebuild
84 index 8eb95d5047f..bd7bd0ad6ed 100644
85 --- a/dev-util/ninja/ninja-9999.ebuild
86 +++ b/dev-util/ninja/ninja-9999.ebuild
87 @@ -44,7 +44,7 @@ RDEPEND="
88 app-editors/gvim
89 )
90 )
91 - !<net-irc/ninja-1.5.9_pre14-r1" #436804
92 +"
93
94 run_for_build() {
95 if tc-is-cross-compiler; then