Gentoo Archives: gentoo-commits

From: Christoph Junghans <junghans@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ispc/, dev-lang/ispc/files/
Date: Sun, 28 Jun 2020 16:45:26
Message-Id: 1593362622.f073ca910b7838d71043c2ae752fcd0d147937bd.junghans@gentoo
1 commit: f073ca910b7838d71043c2ae752fcd0d147937bd
2 Author: Guillaume BRUN <the.cheaterman <AT> gmail <DOT> com>
3 AuthorDate: Sun Jun 28 15:48:55 2020 +0000
4 Commit: Christoph Junghans <junghans <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 28 16:43:42 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f073ca91
7
8 dev-lang/ispc: Add -1.13.0 ebuild
9
10 Closes: https://bugs.gentoo.org/656632
11 Closes: https://bugs.gentoo.org/729924
12 Signed-off-by: Guillaume BRUN <the.cheaterman <AT> gmail.com>
13 Package-Manager: Portage-2.3.99, Repoman-2.3.23
14 Signed-off-by: Christoph Junghans <junghans <AT> gentoo.org>
15
16 dev-lang/ispc/Manifest | 1 +
17 .../files/ispc-1.13.0-cmake-gentoo-release.patch | 13 +++
18 dev-lang/ispc/files/ispc-1.13.0-llvm-10.patch | 106 +++++++++++++++++++++
19 dev-lang/ispc/files/ispc-1.13.0-werror.patch | 13 +++
20 .../ispc/{ispc-9999.ebuild => ispc-1.13.0.ebuild} | 27 ++++--
21 5 files changed, 150 insertions(+), 10 deletions(-)
22
23 diff --git a/dev-lang/ispc/Manifest b/dev-lang/ispc/Manifest
24 index 20f32b7fe6c..09380cb968c 100644
25 --- a/dev-lang/ispc/Manifest
26 +++ b/dev-lang/ispc/Manifest
27 @@ -1 +1,2 @@
28 +DIST ispc-1.13.0.tar.gz 19202295 BLAKE2B 5fae81429acbda0d65d33e56609d05fb8b5a7db6dd0af5ff779d1e8954f6a98d1fcb0f7ecf0c1b9813630026557c21c2a70bfc87ed75959a8bd24e06fcd2e351 SHA512 d23c127beb9bb17e1ad2509f9ad51dd660c473458b939a6b64ca7f6319b3c2f25318ea2ceac00e4100a059f3f67fb97b6973f18e3432c82ff9691f2a08d15d5d
29 DIST ispc-1.9.2.tar.gz 19283765 BLAKE2B 500cca8a69a78ad9a21dc1e39dcb3ed01730e78deed61e4871ce5a9761829c80ac7b1b987d8e8a48c34b67ac96692b2c5026cfb5059a32c71e228c73550584eb SHA512 77a66086cbfd6c4dc855b3137a270cc40f24829255639aee5f562b0831c21938157667b20cfadc660cd67525c47e2e73b46692f7a11bf0c834dc60b69d40d76d
30
31 diff --git a/dev-lang/ispc/files/ispc-1.13.0-cmake-gentoo-release.patch b/dev-lang/ispc/files/ispc-1.13.0-cmake-gentoo-release.patch
32 new file mode 100644
33 index 00000000000..b89e6150400
34 --- /dev/null
35 +++ b/dev-lang/ispc/files/ispc-1.13.0-cmake-gentoo-release.patch
36 @@ -0,0 +1,13 @@
37 +diff --git a/CMakeLists.txt b/CMakeLists.txt
38 +index 13e66268..27ff8364 100644
39 +--- a/CMakeLists.txt
40 ++++ b/CMakeLists.txt
41 +@@ -137,7 +137,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
42 +
43 + if(CMAKE_BUILD_TYPE)
44 + # Validate build type
45 +- set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
46 ++ set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;Gentoo")
47 +
48 + string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
49 + if (${MATCHED_CONFIG} EQUAL -1)
50
51 diff --git a/dev-lang/ispc/files/ispc-1.13.0-llvm-10.patch b/dev-lang/ispc/files/ispc-1.13.0-llvm-10.patch
52 new file mode 100644
53 index 00000000000..6911a76d9e1
54 --- /dev/null
55 +++ b/dev-lang/ispc/files/ispc-1.13.0-llvm-10.patch
56 @@ -0,0 +1,106 @@
57 +diff --git a/CMakeLists.txt b/CMakeLists.txt
58 +index 13e66268..27ff8364 100644
59 +--- a/CMakeLists.txt
60 ++++ b/CMakeLists.txt
61 +@@ -218,7 +218,7 @@ if (WASM_ENABLED)
62 + list(APPEND ISPC_TARGETS wasm-i32x4)
63 + endif()
64 +
65 +-set(CLANG_LIBRARY_LIST clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangAST clangBasic clangEdit clangLex)
66 ++set(CLANG_LIBRARY_LIST clang clang-cpp)
67 + set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option)
68 +
69 + if (${LLVM_VERSION_NUMBER} VERSION_GREATER_EQUAL "10.0.0")
70 +@@ -402,11 +402,8 @@ if (ISPC_USE_ASAN)
71 + endif()
72 +
73 + # Link against Clang libraries
74 +-foreach(clangLib ${CLANG_LIBRARY_LIST})
75 +- find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS})
76 +- list(APPEND CLANG_LIBRARY_FULL_PATH_LIST ${${clangLib}Path})
77 +-endforeach()
78 +-target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_FULL_PATH_LIST})
79 ++find_package(Clang REQUIRED)
80 ++target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_LIST})
81 +
82 + # Link against LLVM libraries
83 + target_link_libraries(${PROJECT_NAME} ${LLVM_LIBRARY_LIST})
84 +diff --git a/src/llvmutil.cpp b/src/llvmutil.cpp
85 +index 06fab989..57a7130f 100644
86 +--- a/src/llvmutil.cpp
87 ++++ b/src/llvmutil.cpp
88 +@@ -42,6 +42,7 @@
89 + #include <llvm/IR/BasicBlock.h>
90 + #include <llvm/IR/Instructions.h>
91 + #include <llvm/IR/Module.h>
92 ++#include <llvm/Support/raw_ostream.h>
93 + #include <map>
94 + #include <set>
95 + #include <vector>
96 +@@ -1394,7 +1395,7 @@ static void lDumpValue(llvm::Value *v, std::set<llvm::Value *> &done) {
97 + return;
98 +
99 + fprintf(stderr, " ");
100 +- v->dump();
101 ++ v->print(llvm::outs(), false);
102 + done.insert(v);
103 +
104 + if (inst == NULL)
105 +diff --git a/src/opt.cpp b/src/opt.cpp
106 +index d78ac374..a607594a 100644
107 +--- a/src/opt.cpp
108 ++++ b/src/opt.cpp
109 +@@ -142,7 +142,7 @@ static llvm::Pass *CreateFixBooleanSelectPass();
110 + getenv("FUNC"), strlen(getenv("FUNC")))))) { \
111 + fprintf(stderr, "Start of " NAME "\n"); \
112 + fprintf(stderr, "---------------\n"); \
113 +- bb.dump(); \
114 ++ bb.print(llvm::outs(), false); \
115 + fprintf(stderr, "---------------\n\n"); \
116 + } else /* eat semicolon */
117 +
118 +@@ -152,7 +152,7 @@ static llvm::Pass *CreateFixBooleanSelectPass();
119 + getenv("FUNC"), strlen(getenv("FUNC")))))) { \
120 + fprintf(stderr, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : ""); \
121 + fprintf(stderr, "---------------\n"); \
122 +- bb.dump(); \
123 ++ bb.print(llvm::outs(), false); \
124 + fprintf(stderr, "---------------\n\n"); \
125 + } else /* eat semicolon */
126 + #else
127 +@@ -453,7 +453,7 @@ void Optimize(llvm::Module *module, int optLevel) {
128 + #ifndef ISPC_NO_DUMPS
129 + if (g->debugPrint) {
130 + printf("*** Code going into optimization ***\n");
131 +- module->dump();
132 ++ module->print(llvm::outs(), nullptr);
133 + }
134 + #endif
135 + DebugPassManager optPM;
136 +@@ -666,7 +666,7 @@ void Optimize(llvm::Module *module, int optLevel) {
137 + #ifndef ISPC_NO_DUMPS
138 + if (g->debugPrint) {
139 + printf("\n*****\nFINAL OUTPUT\n*****\n");
140 +- module->dump();
141 ++ module->print(llvm::outs(), nullptr);
142 + }
143 + #endif
144 + }
145 +@@ -4256,7 +4256,7 @@ char DebugPass::ID = 0;
146 + bool DebugPass::runOnModule(llvm::Module &module) {
147 + fprintf(stderr, "%s", str_output);
148 + fflush(stderr);
149 +- module.dump();
150 ++ module.print(llvm::outs(), nullptr);
151 + return true;
152 + }
153 +
154 +@@ -4303,7 +4303,7 @@ void DebugPassFile::run(llvm::Module &module, bool init) {
155 + snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str());
156 + llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None);
157 + Assert(!EC && "IR dump file creation failed!");
158 +- module.print(OS, 0);
159 ++ module.print(OS, nullptr);
160 + }
161 +
162 + bool DebugPassFile::runOnModule(llvm::Module &module) {
163
164 diff --git a/dev-lang/ispc/files/ispc-1.13.0-werror.patch b/dev-lang/ispc/files/ispc-1.13.0-werror.patch
165 new file mode 100644
166 index 00000000000..3fa144b78db
167 --- /dev/null
168 +++ b/dev-lang/ispc/files/ispc-1.13.0-werror.patch
169 @@ -0,0 +1,13 @@
170 +diff --git a/CMakeLists.txt b/CMakeLists.txt
171 +index 13e66268..27ff8364 100644
172 +--- a/CMakeLists.txt
173 ++++ b/CMakeLists.txt
174 +@@ -352,7 +352,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
175 + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
176 + # Compile options
177 + if (UNIX)
178 +- target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-sign-compare -Wno-unused-function -Werror ${LLVM_CPP_FLAGS})
179 ++ target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-sign-compare -Wno-unused-function ${LLVM_CPP_FLAGS})
180 + # Security options
181 + target_compile_options(${PROJECT_NAME} PRIVATE -fstack-protector -fdata-sections -ffunction-sections
182 + -Wformat -Wformat-security -fpie -fwrapv)
183
184 diff --git a/dev-lang/ispc/ispc-9999.ebuild b/dev-lang/ispc/ispc-1.13.0.ebuild
185 similarity index 65%
186 rename from dev-lang/ispc/ispc-9999.ebuild
187 rename to dev-lang/ispc/ispc-1.13.0.ebuild
188 index d1c2c233112..244bb728565 100644
189 --- a/dev-lang/ispc/ispc-9999.ebuild
190 +++ b/dev-lang/ispc/ispc-1.13.0.ebuild
191 @@ -1,11 +1,11 @@
192 -# Copyright 1999-2018 Gentoo Foundation
193 +# Copyright 1999-2020 Gentoo Authors
194 # Distributed under the terms of the GNU General Public License v2
195
196 -EAPI=6
197 +EAPI=7
198
199 PYTHON_COMPAT=( python2_7 )
200
201 -inherit toolchain-funcs python-any-r1
202 +inherit cmake toolchain-funcs python-any-r1
203
204 DESCRIPTION="Intel SPMD Program Compiler"
205 HOMEPAGE="https://ispc.github.com/"
206 @@ -34,19 +34,26 @@ DEPEND="
207 sys-devel/flex
208 "
209
210 -src_compile() {
211 - #make all slient commands ("@") verbose and remove -Werror (ispc/ispc#1295)
212 - sed -e '/^\t@/s/@//' -e 's/-Werror//' -i Makefile || die
213 - emake LDFLAGS="${LDFLAGS}" OPT="${CXXFLAGS}" CXX="$(tc-getCXX)" CPP="$(tc-getCPP)"
214 +PATCHES=(
215 + "${FILESDIR}/${P}-cmake-gentoo-release.patch"
216 + "${FILESDIR}/${P}-llvm-10.patch"
217 + "${FILESDIR}/${P}-werror.patch"
218 +)
219 +
220 +src_configure() {
221 + local mycmakeargs=(
222 + "-DARM_ENABLED=$(usex arm)"
223 + )
224 + cmake_src_configure
225 }
226
227 src_install() {
228 - dobin ispc
229 - dodoc README.rst
230 + dobin ${BUILD_DIR}/bin/ispc
231 + dodoc README.md
232
233 if use examples; then
234 insinto "/usr/share/doc/${PF}/examples"
235 docompress -x "/usr/share/doc/${PF}/examples"
236 - doins -r examples/*
237 + doins -r ${BUILD_DIR}/examples/*
238 fi
239 }