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: 1593362696.526716bac86709f53cab67e71ab2d899cdcd2269.junghans@gentoo
1 commit: 526716bac86709f53cab67e71ab2d899cdcd2269
2 Author: Guillaume BRUN <the.cheaterman <AT> gmail <DOT> com>
3 AuthorDate: Sun Jun 28 15:56:26 2020 +0000
4 Commit: Christoph Junghans <junghans <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 28 16:44:56 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=526716ba
7
8 dev-lang/ispc: Add -9999 ebuild
9
10 Signed-off-by: Guillaume BRUN <the.cheaterman <AT> gmail.com>
11 Package-Manager: Portage-2.3.99, Repoman-2.3.23
12 Signed-off-by: Christoph Junghans <junghans <AT> gentoo.org>
13
14 .../files/ispc-9999-cmake-gentoo-release.patch | 13 +++
15 dev-lang/ispc/files/ispc-9999-llvm-10.patch | 106 +++++++++++++++++++++
16 dev-lang/ispc/files/ispc-9999-werror.patch | 13 +++
17 dev-lang/ispc/ispc-9999.ebuild | 59 ++++++++++++
18 dev-lang/ispc/metadata.xml | 5 +-
19 5 files changed, 192 insertions(+), 4 deletions(-)
20
21 diff --git a/dev-lang/ispc/files/ispc-9999-cmake-gentoo-release.patch b/dev-lang/ispc/files/ispc-9999-cmake-gentoo-release.patch
22 new file mode 100644
23 index 00000000000..b89e6150400
24 --- /dev/null
25 +++ b/dev-lang/ispc/files/ispc-9999-cmake-gentoo-release.patch
26 @@ -0,0 +1,13 @@
27 +diff --git a/CMakeLists.txt b/CMakeLists.txt
28 +index 13e66268..27ff8364 100644
29 +--- a/CMakeLists.txt
30 ++++ b/CMakeLists.txt
31 +@@ -137,7 +137,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
32 +
33 + if(CMAKE_BUILD_TYPE)
34 + # Validate build type
35 +- set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
36 ++ set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;Gentoo")
37 +
38 + string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
39 + if (${MATCHED_CONFIG} EQUAL -1)
40
41 diff --git a/dev-lang/ispc/files/ispc-9999-llvm-10.patch b/dev-lang/ispc/files/ispc-9999-llvm-10.patch
42 new file mode 100644
43 index 00000000000..6911a76d9e1
44 --- /dev/null
45 +++ b/dev-lang/ispc/files/ispc-9999-llvm-10.patch
46 @@ -0,0 +1,106 @@
47 +diff --git a/CMakeLists.txt b/CMakeLists.txt
48 +index 13e66268..27ff8364 100644
49 +--- a/CMakeLists.txt
50 ++++ b/CMakeLists.txt
51 +@@ -218,7 +218,7 @@ if (WASM_ENABLED)
52 + list(APPEND ISPC_TARGETS wasm-i32x4)
53 + endif()
54 +
55 +-set(CLANG_LIBRARY_LIST clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangAST clangBasic clangEdit clangLex)
56 ++set(CLANG_LIBRARY_LIST clang clang-cpp)
57 + set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option)
58 +
59 + if (${LLVM_VERSION_NUMBER} VERSION_GREATER_EQUAL "10.0.0")
60 +@@ -402,11 +402,8 @@ if (ISPC_USE_ASAN)
61 + endif()
62 +
63 + # Link against Clang libraries
64 +-foreach(clangLib ${CLANG_LIBRARY_LIST})
65 +- find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS})
66 +- list(APPEND CLANG_LIBRARY_FULL_PATH_LIST ${${clangLib}Path})
67 +-endforeach()
68 +-target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_FULL_PATH_LIST})
69 ++find_package(Clang REQUIRED)
70 ++target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_LIST})
71 +
72 + # Link against LLVM libraries
73 + target_link_libraries(${PROJECT_NAME} ${LLVM_LIBRARY_LIST})
74 +diff --git a/src/llvmutil.cpp b/src/llvmutil.cpp
75 +index 06fab989..57a7130f 100644
76 +--- a/src/llvmutil.cpp
77 ++++ b/src/llvmutil.cpp
78 +@@ -42,6 +42,7 @@
79 + #include <llvm/IR/BasicBlock.h>
80 + #include <llvm/IR/Instructions.h>
81 + #include <llvm/IR/Module.h>
82 ++#include <llvm/Support/raw_ostream.h>
83 + #include <map>
84 + #include <set>
85 + #include <vector>
86 +@@ -1394,7 +1395,7 @@ static void lDumpValue(llvm::Value *v, std::set<llvm::Value *> &done) {
87 + return;
88 +
89 + fprintf(stderr, " ");
90 +- v->dump();
91 ++ v->print(llvm::outs(), false);
92 + done.insert(v);
93 +
94 + if (inst == NULL)
95 +diff --git a/src/opt.cpp b/src/opt.cpp
96 +index d78ac374..a607594a 100644
97 +--- a/src/opt.cpp
98 ++++ b/src/opt.cpp
99 +@@ -142,7 +142,7 @@ static llvm::Pass *CreateFixBooleanSelectPass();
100 + getenv("FUNC"), strlen(getenv("FUNC")))))) { \
101 + fprintf(stderr, "Start of " NAME "\n"); \
102 + fprintf(stderr, "---------------\n"); \
103 +- bb.dump(); \
104 ++ bb.print(llvm::outs(), false); \
105 + fprintf(stderr, "---------------\n\n"); \
106 + } else /* eat semicolon */
107 +
108 +@@ -152,7 +152,7 @@ static llvm::Pass *CreateFixBooleanSelectPass();
109 + getenv("FUNC"), strlen(getenv("FUNC")))))) { \
110 + fprintf(stderr, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : ""); \
111 + fprintf(stderr, "---------------\n"); \
112 +- bb.dump(); \
113 ++ bb.print(llvm::outs(), false); \
114 + fprintf(stderr, "---------------\n\n"); \
115 + } else /* eat semicolon */
116 + #else
117 +@@ -453,7 +453,7 @@ void Optimize(llvm::Module *module, int optLevel) {
118 + #ifndef ISPC_NO_DUMPS
119 + if (g->debugPrint) {
120 + printf("*** Code going into optimization ***\n");
121 +- module->dump();
122 ++ module->print(llvm::outs(), nullptr);
123 + }
124 + #endif
125 + DebugPassManager optPM;
126 +@@ -666,7 +666,7 @@ void Optimize(llvm::Module *module, int optLevel) {
127 + #ifndef ISPC_NO_DUMPS
128 + if (g->debugPrint) {
129 + printf("\n*****\nFINAL OUTPUT\n*****\n");
130 +- module->dump();
131 ++ module->print(llvm::outs(), nullptr);
132 + }
133 + #endif
134 + }
135 +@@ -4256,7 +4256,7 @@ char DebugPass::ID = 0;
136 + bool DebugPass::runOnModule(llvm::Module &module) {
137 + fprintf(stderr, "%s", str_output);
138 + fflush(stderr);
139 +- module.dump();
140 ++ module.print(llvm::outs(), nullptr);
141 + return true;
142 + }
143 +
144 +@@ -4303,7 +4303,7 @@ void DebugPassFile::run(llvm::Module &module, bool init) {
145 + snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str());
146 + llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None);
147 + Assert(!EC && "IR dump file creation failed!");
148 +- module.print(OS, 0);
149 ++ module.print(OS, nullptr);
150 + }
151 +
152 + bool DebugPassFile::runOnModule(llvm::Module &module) {
153
154 diff --git a/dev-lang/ispc/files/ispc-9999-werror.patch b/dev-lang/ispc/files/ispc-9999-werror.patch
155 new file mode 100644
156 index 00000000000..3fa144b78db
157 --- /dev/null
158 +++ b/dev-lang/ispc/files/ispc-9999-werror.patch
159 @@ -0,0 +1,13 @@
160 +diff --git a/CMakeLists.txt b/CMakeLists.txt
161 +index 13e66268..27ff8364 100644
162 +--- a/CMakeLists.txt
163 ++++ b/CMakeLists.txt
164 +@@ -352,7 +352,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
165 + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
166 + # Compile options
167 + if (UNIX)
168 +- target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-sign-compare -Wno-unused-function -Werror ${LLVM_CPP_FLAGS})
169 ++ target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-sign-compare -Wno-unused-function ${LLVM_CPP_FLAGS})
170 + # Security options
171 + target_compile_options(${PROJECT_NAME} PRIVATE -fstack-protector -fdata-sections -ffunction-sections
172 + -Wformat -Wformat-security -fpie -fwrapv)
173
174 diff --git a/dev-lang/ispc/ispc-9999.ebuild b/dev-lang/ispc/ispc-9999.ebuild
175 new file mode 100644
176 index 00000000000..244bb728565
177 --- /dev/null
178 +++ b/dev-lang/ispc/ispc-9999.ebuild
179 @@ -0,0 +1,59 @@
180 +# Copyright 1999-2020 Gentoo Authors
181 +# Distributed under the terms of the GNU General Public License v2
182 +
183 +EAPI=7
184 +
185 +PYTHON_COMPAT=( python2_7 )
186 +
187 +inherit cmake toolchain-funcs python-any-r1
188 +
189 +DESCRIPTION="Intel SPMD Program Compiler"
190 +HOMEPAGE="https://ispc.github.com/"
191 +
192 +if [[ ${PV} = *9999 ]]; then
193 + inherit git-r3
194 + EGIT_REPO_URI="https://github.com/ispc/ispc.git"
195 + KEYWORDS=""
196 +else
197 + SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
198 + KEYWORDS="~amd64 ~x86"
199 +fi
200 +
201 +LICENSE="BSD BSD-2 UoI-NCSA"
202 +SLOT="0"
203 +IUSE="examples"
204 +
205 +RDEPEND="
206 + >=sys-devel/clang-3.0:*
207 + >=sys-devel/llvm-3.0:*
208 + "
209 +DEPEND="
210 + ${RDEPEND}
211 + ${PYTHON_DEPS}
212 + sys-devel/bison
213 + sys-devel/flex
214 + "
215 +
216 +PATCHES=(
217 + "${FILESDIR}/${P}-cmake-gentoo-release.patch"
218 + "${FILESDIR}/${P}-llvm-10.patch"
219 + "${FILESDIR}/${P}-werror.patch"
220 +)
221 +
222 +src_configure() {
223 + local mycmakeargs=(
224 + "-DARM_ENABLED=$(usex arm)"
225 + )
226 + cmake_src_configure
227 +}
228 +
229 +src_install() {
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 ${BUILD_DIR}/examples/*
237 + fi
238 +}
239
240 diff --git a/dev-lang/ispc/metadata.xml b/dev-lang/ispc/metadata.xml
241 index c214c07655f..285bd7dd705 100644
242 --- a/dev-lang/ispc/metadata.xml
243 +++ b/dev-lang/ispc/metadata.xml
244 @@ -1,10 +1,7 @@
245 <?xml version="1.0" encoding="UTF-8"?>
246 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
247 <pkgmetadata>
248 - <maintainer type="person">
249 - <email>junghans@g.o</email>
250 - <name>Christoph Junghans</name>
251 - </maintainer>
252 + <!-- maintainer-needed -->
253 <upstream>
254 <remote-id type="github">ispc/ispc</remote-id>
255 </upstream>