Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/tapi/, sys-libs/tapi/files/
Date: Sun, 26 Feb 2017 19:06:25
Message-Id: 1488135976.796921c93f72e27bcfbdbea701238c1e9458b29c.grobian@gentoo
1 commit: 796921c93f72e27bcfbdbea701238c1e9458b29c
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 26 17:36:14 2017 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 26 19:06:16 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=796921c9
7
8 sys-libs/tapi: initial ebuild by Michael Weiser, bug #609436
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 sys-libs/tapi/Manifest | 1 +
13 .../tapi/files/tapi-1.30-allow-all-clients.patch | 17 ++++++
14 sys-libs/tapi/files/tapi-1.30-llvm-config.patch | 11 ++++
15 .../tapi/files/tapi-1.30-llvm-new-error-api.patch | 65 ++++++++++++++++++++++
16 .../tapi/files/tapi-1.30-llvm-out-of-tree.patch | 10 ++++
17 sys-libs/tapi/metadata.xml | 8 +++
18 sys-libs/tapi/tapi-1.30.ebuild | 37 ++++++++++++
19 7 files changed, 149 insertions(+)
20
21 diff --git a/sys-libs/tapi/Manifest b/sys-libs/tapi/Manifest
22 new file mode 100644
23 index 0000000000..e1a098ba76
24 --- /dev/null
25 +++ b/sys-libs/tapi/Manifest
26 @@ -0,0 +1 @@
27 +DIST tapi-1.30.tar.gz 29071 SHA256 be2f3732c4ba7e9d78696fe43f0b31fa4963925ee6e4e5e11cc45603a83ff9a1 SHA512 fa495da150c6b6ff9e0bf667a9a06f0b932363297b75379fd59a5c728168a3ac103a656d1a59fa1b0c0012a18c9874439237bbf2a3c26f9bdf202b4d78e31520 WHIRLPOOL 966cfd8149ab9952858d1985c96039b2f21cccc6d415b557c860d307823ea323bf66cec03a1ab572e160ad21590fd2584ea9037a5c3d769b22aeaacc934fcfe2
28
29 diff --git a/sys-libs/tapi/files/tapi-1.30-allow-all-clients.patch b/sys-libs/tapi/files/tapi-1.30-allow-all-clients.patch
30 new file mode 100644
31 index 0000000000..98309132cf
32 --- /dev/null
33 +++ b/sys-libs/tapi/files/tapi-1.30-allow-all-clients.patch
34 @@ -0,0 +1,17 @@
35 +libtapi is by default limited to be linked to binaries called ld only. When
36 +trying to link it into e.g. our ld64 we get:
37 +
38 +ld: cannot link directly with ${EPREFIX}/usr/lib/libtapi.dylib for architecture
39 +x86_64
40 +
41 +Drop that limitation in order to be able to use the library.
42 +
43 +--- libtapi-1.30/tools/libtapi/CMakeLists.txt.orig 2017-02-12 17:35:55.000000000 +0100
44 ++++ libtapi-1.30/tools/libtapi/CMakeLists.txt 2017-02-12 17:36:17.000000000 +0100
45 +@@ -18,5 +18,5 @@
46 +
47 + set_property(TARGET libtapi APPEND_STRING
48 + PROPERTY
49 +- LINK_FLAGS " -current_version ${TAPI_VERSION_MAJOR}.${TAPI_VERSION_MINOR}.${TAPI_VERSION_PATCH} -compatibility_version 1 -allowable_client ld"
50 ++ LINK_FLAGS " -current_version ${TAPI_VERSION_MAJOR}.${TAPI_VERSION_MINOR}.${TAPI_VERSION_PATCH} -compatibility_version 1"
51 + )
52
53 diff --git a/sys-libs/tapi/files/tapi-1.30-llvm-config.patch b/sys-libs/tapi/files/tapi-1.30-llvm-config.patch
54 new file mode 100644
55 index 0000000000..ea5a462c02
56 --- /dev/null
57 +++ b/sys-libs/tapi/files/tapi-1.30-llvm-config.patch
58 @@ -0,0 +1,11 @@
59 +--- libtapi-1.30/lib/Core/Symbol.cpp.orig 2017-02-11 21:51:53.000000000 +0100
60 ++++ libtapi-1.30/lib/Core/Symbol.cpp 2017-02-11 21:52:00.000000000 +0100
61 +@@ -9,7 +9,7 @@
62 +
63 + #include "tapi/Core/Symbol.h"
64 + #include "tapi/Core/LLVM.h"
65 +-#include "llvm/Config/config.h"
66 ++#include "llvm/Config/llvm-config.h"
67 + #include "llvm/Support/raw_ostream.h"
68 +
69 + #if HAVE_CXXABI_H
70
71 diff --git a/sys-libs/tapi/files/tapi-1.30-llvm-new-error-api.patch b/sys-libs/tapi/files/tapi-1.30-llvm-new-error-api.patch
72 new file mode 100644
73 index 0000000000..814ca30879
74 --- /dev/null
75 +++ b/sys-libs/tapi/files/tapi-1.30-llvm-new-error-api.patch
76 @@ -0,0 +1,65 @@
77 +--- libtapi-1.30/lib/Core/MachODylibReader.cpp.orig 2017-02-11 21:36:40.000000000 +0100
78 ++++ libtapi-1.30/lib/Core/MachODylibReader.cpp 2017-02-11 21:48:25.000000000 +0100
79 +@@ -37,7 +37,11 @@
80 + }
81 +
82 + auto binaryOrErr = createBinary(bufferRef);
83 ++#if LLVM_NEW_ERROR_API
84 ++ if (binaryOrErr.takeError())
85 ++#else
86 + if (binaryOrErr.getError())
87 ++#endif
88 + return FileType::Invalid;
89 +
90 + Binary &bin = *binaryOrErr.get();
91 +@@ -49,7 +53,11 @@
92 + for (auto OI = UB->begin_objects(), OE = UB->end_objects(); OI != OE; ++OI) {
93 + auto objOrErr = OI->getAsObjectFile();
94 + // Ignore archives.
95 ++#if LLVM_NEW_ERROR_API
96 ++ if (objOrErr.takeError())
97 ++#else
98 + if (objOrErr.getError())
99 ++#endif
100 + continue;
101 +
102 + auto &obj = *objOrErr.get();
103 +@@ -228,7 +236,11 @@
104 + ? SymbolFlags::WeakReferenced
105 + : SymbolFlags::None;
106 + auto symbolName = symbol.getName();
107 ++#if LLVM_NEW_ERROR_API
108 ++ if (symbolName.takeError())
109 ++#else
110 + if (symbolName.getError())
111 ++#endif
112 + continue;
113 +
114 + StringRef name;
115 +@@ -244,8 +256,14 @@
116 + file->setPath(memBuffer.getBufferIdentifier());
117 +
118 + auto binaryOrErr = createBinary(memBuffer);
119 ++// no way to figure this out from the headers :-(
120 ++#if LLVM_NEW_ERROR_API
121 ++ if (auto ec = binaryOrErr.takeError()) {
122 ++ file->setErrorCode(llvm::errorToErrorCode(std::move(ec)));
123 ++#else
124 + if (auto ec = binaryOrErr.getError()) {
125 + file->setErrorCode(ec);
126 ++#endif
127 + return std::move(file);
128 + }
129 +
130 +@@ -263,7 +281,11 @@
131 + auto objOrErr = OI->getAsObjectFile();
132 +
133 + // Ignore archives.
134 ++#if LLVM_NEW_ERROR_API
135 ++ if (objOrErr.takeError())
136 ++#else
137 + if (objOrErr.getError())
138 ++#endif
139 + continue;
140 +
141 + auto &object = *objOrErr.get();
142
143 diff --git a/sys-libs/tapi/files/tapi-1.30-llvm-out-of-tree.patch b/sys-libs/tapi/files/tapi-1.30-llvm-out-of-tree.patch
144 new file mode 100644
145 index 0000000000..5638647699
146 --- /dev/null
147 +++ b/sys-libs/tapi/files/tapi-1.30-llvm-out-of-tree.patch
148 @@ -0,0 +1,10 @@
149 +--- libtapi-1.30/CMakeLists.txt.orig 2017-02-11 21:04:56.000000000 +0100
150 ++++ libtapi-1.30/CMakeLists.txt 2017-02-11 21:05:12.000000000 +0100
151 +@@ -34,6 +34,7 @@
152 + ${CMAKE_CURRENT_SOURCE_DIR}/include/tapi/Version.inc.in
153 + ${CMAKE_CURRENT_BINARY_DIR}/include/tapi/Version.inc)
154 +
155 ++include(AddLLVM)
156 + macro(add_tapi_library name)
157 + cmake_parse_arguments(ARG
158 + "SHARED"
159
160 diff --git a/sys-libs/tapi/metadata.xml b/sys-libs/tapi/metadata.xml
161 new file mode 100644
162 index 0000000000..0c982d8813
163 --- /dev/null
164 +++ b/sys-libs/tapi/metadata.xml
165 @@ -0,0 +1,8 @@
166 +<?xml version="1.0" encoding="UTF-8"?>
167 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
168 +<pkgmetadata>
169 + <maintainer type="project">
170 + <email>prefix@g.o</email>
171 + <name>Gentoo Prefix</name>
172 + </maintainer>
173 +</pkgmetadata>
174
175 diff --git a/sys-libs/tapi/tapi-1.30.ebuild b/sys-libs/tapi/tapi-1.30.ebuild
176 new file mode 100644
177 index 0000000000..c3f24900a4
178 --- /dev/null
179 +++ b/sys-libs/tapi/tapi-1.30.ebuild
180 @@ -0,0 +1,37 @@
181 +# Copyright 1999-2017 Gentoo Foundation
182 +# Distributed under the terms of the GNU General Public License v2
183 +
184 +EAPI=6
185 +
186 +inherit cmake-utils flag-o-matic
187 +
188 +DESCRIPTION="Text-based Application Programming Interface"
189 +HOMEPAGE="https://opensource.apple.com/source/tapi"
190 +SRC_URI="https://opensource.apple.com/tarballs/${PN}/${P}.tar.gz"
191 +S="${WORKDIR}/lib${P}"
192 +
193 +LICENSE="|| ( UoI-NCSA MIT )"
194 +SLOT="0"
195 +KEYWORDS="~x64-macos ~x86-macos"
196 +
197 +DOCS=( Readme.md )
198 +
199 +PATCHES=(
200 + "${FILESDIR}"/${PN}-1.30-llvm-out-of-tree.patch
201 + "${FILESDIR}"/${PN}-1.30-llvm-new-error-api.patch
202 + "${FILESDIR}"/${PN}-1.30-llvm-config.patch
203 + "${FILESDIR}"/${PN}-1.30-allow-all-clients.patch
204 +)
205 +
206 +src_configure() {
207 + local mycmakeargs=(
208 + -DCMAKE_MODULE_PATH="${EPREFIX}/usr/lib/cmake/llvm;${EPREFIX}/usr/share/llvm/cmake"
209 + )
210 +
211 + # poor man's configure
212 + [ -f "${EPREFIX}"/usr/include/llvm/Support/Error.h ] && \
213 + append-cxxflags -DLLVM_NEW_ERROR_API=1
214 +
215 + append-cxxflags -std=c++11
216 + cmake-utils_src_configure
217 +}