1 |
commit: 676a9635b3be275ba6ce4c28b60f37d1ad5a8bf4 |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 2 22:01:33 2023 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 2 22:01:33 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=676a9635 |
7 |
|
8 |
dev-cpp/antlr-cpp: add 4.11.1 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/726866 |
11 |
Bug: https://bugs.gentoo.org/881317 |
12 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
13 |
|
14 |
dev-cpp/antlr-cpp/Manifest | 1 + |
15 |
dev-cpp/antlr-cpp/antlr-cpp-4.11.1.ebuild | 29 +++++ |
16 |
.../antlr-cpp/files/4.11.1-GNUInstallDirs.patch | 139 +++++++++++++++++++++ |
17 |
3 files changed, 169 insertions(+) |
18 |
|
19 |
diff --git a/dev-cpp/antlr-cpp/Manifest b/dev-cpp/antlr-cpp/Manifest |
20 |
index d2f49651c27d..11c2ebb8722f 100644 |
21 |
--- a/dev-cpp/antlr-cpp/Manifest |
22 |
+++ b/dev-cpp/antlr-cpp/Manifest |
23 |
@@ -1,2 +1,3 @@ |
24 |
DIST antlr-2.7.7.tar.gz 1816180 BLAKE2B 3a9a51070f8651befeb4d22be344b544e119db34a78522828c2ffc3c481c14b9c7784f0a9997a61f6faedde5b6d1fe12214cfd84fb274f7065f3ffe6a44abf1c SHA512 faa72d2ddcba434ef1233e70c1549e63eba67c00793966322e821cf7f015cccb804448cb92d8fbef0429f59928fad65ec954f8ffbda0acbb8e983de0806d349d |
25 |
+DIST antlr-cpp-4.11.1.zip 534105 BLAKE2B acf854bb8f10f8afdb8df9aa1fa92176edc66bfe3e33ca4b57e138e29f7d8512dc0a31aee057e5997ca9e37ca7934c459ef725e831d34166c189a2ed7e6fbc51 SHA512 47a4f714cf195e454b4f66cace58f6dbaa144f44c25594735fc91b37289e9b3c8b5259c03925316754d3eb33af3e0b3d3fb0c5c9aef818b239799e4f1fb49ce6 |
26 |
DIST antlr-cpp-4.7.2.zip 1494927 BLAKE2B 007aac6655dc3c4e3a0c2073ca9c8c016b46bdf97dca4494d4ea2c44d27a458bfbb09811b3beb0aec1ce2873c3b62ad6789c6a9e3e7ddc62cde51c8357e9123b SHA512 3298b83a06ddd8d8852462401e46fe2eb83d20af4ba14c722cb31b33d929d1c5a4ffb694ee084495a4ae26ed3246b6781ca6045d11253c94efc09729fa001090 |
27 |
|
28 |
diff --git a/dev-cpp/antlr-cpp/antlr-cpp-4.11.1.ebuild b/dev-cpp/antlr-cpp/antlr-cpp-4.11.1.ebuild |
29 |
new file mode 100644 |
30 |
index 000000000000..f184f2fc1c2c |
31 |
--- /dev/null |
32 |
+++ b/dev-cpp/antlr-cpp/antlr-cpp-4.11.1.ebuild |
33 |
@@ -0,0 +1,29 @@ |
34 |
+# Copyright 1999-2023 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+ |
37 |
+EAPI=8 |
38 |
+ |
39 |
+inherit cmake |
40 |
+ |
41 |
+DESCRIPTION="The ANTLR 4 C++ Runtime" |
42 |
+HOMEPAGE="https://www.antlr.org/" |
43 |
+SRC_URI="https://www.antlr.org/download/antlr4-cpp-runtime-${PV}-source.zip -> ${P}.zip" |
44 |
+S="${WORKDIR}" |
45 |
+ |
46 |
+LICENSE="BSD" |
47 |
+SLOT="4" |
48 |
+KEYWORDS="~amd64 ~arm ~ppc ~x86" |
49 |
+IUSE="test" |
50 |
+RESTRICT="!test? ( test )" |
51 |
+ |
52 |
+DEPEND="test? ( dev-cpp/gtest )" |
53 |
+BDEPEND="app-arch/unzip" |
54 |
+ |
55 |
+PATCHES=( "${FILESDIR}"/${PV}-GNUInstallDirs.patch ) |
56 |
+ |
57 |
+src_configure() { |
58 |
+ local mycmakeargs=( |
59 |
+ -DANTLR_BUILD_CPP_TESTS=$(usex test) |
60 |
+ ) |
61 |
+ cmake_src_configure |
62 |
+} |
63 |
|
64 |
diff --git a/dev-cpp/antlr-cpp/files/4.11.1-GNUInstallDirs.patch b/dev-cpp/antlr-cpp/files/4.11.1-GNUInstallDirs.patch |
65 |
new file mode 100644 |
66 |
index 000000000000..c8795e0b033c |
67 |
--- /dev/null |
68 |
+++ b/dev-cpp/antlr-cpp/files/4.11.1-GNUInstallDirs.patch |
69 |
@@ -0,0 +1,139 @@ |
70 |
+--- a/CMakeLists.txt |
71 |
++++ b/CMakeLists.txt |
72 |
+@@ -113,11 +113,6 @@ |
73 |
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /O1 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLAGS}") |
74 |
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLGAS}") |
75 |
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /O2 /Oi /Ob2 /Gy /MP /Zi ${MY_CXX_WARNING_FLAGS}") |
76 |
+-else() |
77 |
+- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g ${MY_CXX_WARNING_FLAGS}") |
78 |
+- set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG ${MY_CXX_WARNING_FLAGS}") |
79 |
+- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG ${MY_CXX_WARNING_FLGAS}") |
80 |
+- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g ${MY_CXX_WARNING_FLAGS}") |
81 |
+ endif() |
82 |
+ |
83 |
+ # Compiler-specific C++17 activation. |
84 |
+@@ -220,16 +215,8 @@ |
85 |
+ |
86 |
+ endif(ANTLR4_INSTALL) |
87 |
+ |
88 |
+-if(EXISTS LICENSE.txt) |
89 |
+-install(FILES LICENSE.txt |
90 |
+- DESTINATION "share/doc/libantlr4") |
91 |
+-elseif(EXISTS ../../LICENSE.txt) |
92 |
+-install(FILES ../../LICENSE.txt |
93 |
+- DESTINATION "share/doc/libantlr4") |
94 |
+-endif() |
95 |
+- |
96 |
+ install(FILES README.md VERSION |
97 |
+- DESTINATION "share/doc/libantlr4") |
98 |
++ DESTINATION ${CMAKE_INSTALL_DOCDIR}) |
99 |
+ |
100 |
+ set(CPACK_PACKAGE_CONTACT "antlr-discussion@××××××××××××.com") |
101 |
+ set(CPACK_PACKAGE_VERSION ${ANTLR_VERSION}) |
102 |
+--- a/runtime/CMakeLists.txt |
103 |
++++ b/runtime/CMakeLists.txt |
104 |
+@@ -26,29 +26,14 @@ |
105 |
+ ) |
106 |
+ |
107 |
+ add_library(antlr4_shared SHARED ${libantlrcpp_SRC}) |
108 |
+-add_library(antlr4_static STATIC ${libantlrcpp_SRC}) |
109 |
+ |
110 |
+ # Make sure to link against threads (pthreads) library in order to be able to |
111 |
+ # make use of std::call_once in the code without producing runtime errors |
112 |
+ # (see also https://github.com/antlr/antlr4/issues/3708 and/or https://stackoverflow.com/q/51584960). |
113 |
+ find_package(Threads REQUIRED) |
114 |
+ target_link_libraries(antlr4_shared Threads::Threads) |
115 |
+-target_link_libraries(antlr4_static Threads::Threads) |
116 |
+ |
117 |
+ if (ANTLR_BUILD_CPP_TESTS) |
118 |
+- include(FetchContent) |
119 |
+- |
120 |
+- FetchContent_Declare( |
121 |
+- googletest |
122 |
+- URL https://github.com/google/googletest/archive/e2239ee6043f73722e7aa812a459f54a28552929.zip |
123 |
+- ) |
124 |
+- |
125 |
+- if(WITH_STATIC_CRT) |
126 |
+- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
127 |
+- endif() |
128 |
+- |
129 |
+- FetchContent_MakeAvailable(googletest) |
130 |
+- |
131 |
+ file(GLOB libantlrcpp_TESTS |
132 |
+ "${PROJECT_SOURCE_DIR}/runtime/tests/*.cpp" |
133 |
+ ) |
134 |
+@@ -60,8 +45,9 @@ |
135 |
+ |
136 |
+ target_link_libraries( |
137 |
+ antlr4_tests |
138 |
+- antlr4_static |
139 |
++ antlr4_shared |
140 |
+ gtest_main |
141 |
++ gtest |
142 |
+ ) |
143 |
+ |
144 |
+ include(GoogleTest) |
145 |
+@@ -71,7 +57,6 @@ |
146 |
+ |
147 |
+ if(APPLE) |
148 |
+ target_link_libraries(antlr4_shared ${COREFOUNDATION_LIBRARY}) |
149 |
+- target_link_libraries(antlr4_static ${COREFOUNDATION_LIBRARY}) |
150 |
+ endif() |
151 |
+ |
152 |
+ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") |
153 |
+@@ -88,16 +73,11 @@ |
154 |
+ endif() |
155 |
+ |
156 |
+ set(extra_share_compile_flags "") |
157 |
+-set(extra_static_compile_flags "") |
158 |
+-set(static_lib_suffix "") |
159 |
+ |
160 |
+ if (WIN32) |
161 |
+- set(static_lib_suffix "-static") |
162 |
+ target_compile_definitions(antlr4_shared PUBLIC ANTLR4CPP_EXPORTS) |
163 |
+- target_compile_definitions(antlr4_static PUBLIC ANTLR4CPP_STATIC) |
164 |
+ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") |
165 |
+ set(extra_share_compile_flags "-MP /wd4251") |
166 |
+- set(extra_static_compile_flags "-MP") |
167 |
+ endif() |
168 |
+ endif() |
169 |
+ |
170 |
+@@ -107,13 +87,6 @@ |
171 |
+ OUTPUT_NAME antlr4-runtime |
172 |
+ COMPILE_FLAGS "${disabled_compile_warnings} ${extra_share_compile_flags}") |
173 |
+ |
174 |
+-set_target_properties(antlr4_static |
175 |
+- PROPERTIES VERSION ${ANTLR_VERSION} |
176 |
+- SOVERSION ${ANTLR_VERSION} |
177 |
+- OUTPUT_NAME "antlr4-runtime${static_lib_suffix}" |
178 |
+- COMPILE_PDB_NAME "antlr4-runtime${static_lib_suffix}" |
179 |
+- COMPILE_FLAGS "${disabled_compile_warnings} ${extra_static_compile_flags}") |
180 |
+- |
181 |
+ if (ANTLR_BUILD_CPP_TESTS) |
182 |
+ # Copy the generated binaries to dist folder (required by test suite) |
183 |
+ add_custom_command( |
184 |
+@@ -122,24 +95,12 @@ |
185 |
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/dist |
186 |
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:antlr4_shared> ${CMAKE_HOME_DIRECTORY}/dist |
187 |
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_LINKER_FILE:antlr4_shared> ${CMAKE_HOME_DIRECTORY}/dist) |
188 |
+- |
189 |
+- add_custom_command( |
190 |
+- TARGET antlr4_static |
191 |
+- POST_BUILD |
192 |
+- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/dist |
193 |
+- COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:antlr4_static> ${CMAKE_HOME_DIRECTORY}/dist) |
194 |
+ endif() |
195 |
+ |
196 |
+ install(TARGETS antlr4_shared |
197 |
+ EXPORT antlr4-targets |
198 |
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
199 |
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
200 |
+- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
201 |
+- |
202 |
+-install(TARGETS antlr4_static |
203 |
+- EXPORT antlr4-targets |
204 |
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
205 |
+- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
206 |
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
207 |
+ |
208 |
+ install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/" |