Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/muParser/files/
Date: Wed, 01 Feb 2023 01:18:12
Message-Id: 1675213983.1892c3d4615b35c5ca02206002ecacb6f1799d26.conikost@gentoo
1 commit: 1892c3d4615b35c5ca02206002ecacb6f1799d26
2 Author: Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
3 AuthorDate: Mon Jan 30 19:10:33 2023 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 1 01:13:03 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1892c3d4
7
8 dev-cpp/muParser: remove unused patch(es)
9
10 Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
11 Closes: https://github.com/gentoo/gentoo/pull/29346
12 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
13
14 .../muParser/files/muParser-2.3-export-cmake.patch | 405 ---------------------
15 1 file changed, 405 deletions(-)
16
17 diff --git a/dev-cpp/muParser/files/muParser-2.3-export-cmake.patch b/dev-cpp/muParser/files/muParser-2.3-export-cmake.patch
18 deleted file mode 100644
19 index 79254626db6a..000000000000
20 --- a/dev-cpp/muParser/files/muParser-2.3-export-cmake.patch
21 +++ /dev/null
22 @@ -1,405 +0,0 @@
23 -From a9e6626c9b2e250eb9161c767d2fb2e5a07315e2 Mon Sep 17 00:00:00 2001
24 -From: Francis Giraldeau <francis.giraldeau@×××××××××××.ca>
25 -Date: Wed, 8 Jul 2020 14:59:27 -0400
26 -Subject: [PATCH] Export muparser cmake targets
27 -
28 -Export muparser targets, such that client projects can
29 -import it using find_package(). This mechanism for both the build tree
30 -and the install tree. The provided example3 shows how to import muparser
31 -targets.
32 -
33 -Signed-off-by: Francis Giraldeau <francis.giraldeau@×××××××××××.ca>
34 -Signed-off-by: Alexey Shvetsov <alexxy@g.o>
35 ----
36 - CMakeLists.txt | 39 ++++++-
37 - CMakeLists.txt.orig | 173 ++++++++++++++++++++++++++++++++
38 - muparserConfig.cmake.in | 6 ++
39 - samples/example3/CMakeLists.txt | 12 +++
40 - samples/example3/README.md | 2 +
41 - samples/example3/build.sh | 23 +++++
42 - samples/example3/example3.cpp | 49 +++++++++
43 - 7 files changed, 301 insertions(+), 3 deletions(-)
44 - create mode 100644 CMakeLists.txt.orig
45 - create mode 100644 muparserConfig.cmake.in
46 - create mode 100644 samples/example3/CMakeLists.txt
47 - create mode 100644 samples/example3/README.md
48 - create mode 100755 samples/example3/build.sh
49 - create mode 100644 samples/example3/example3.cpp
50 -
51 -diff --git a/CMakeLists.txt b/CMakeLists.txt
52 -index cfdce99..aecc67d 100644
53 ---- a/CMakeLists.txt
54 -+++ b/CMakeLists.txt
55 -@@ -55,6 +55,11 @@ add_library(muparser
56 - src/muParserTest.cpp
57 - src/muParserTokenReader.cpp
58 - )
59 -+# use the headers in the build-tree or the installed ones
60 -+target_include_directories(muparser PUBLIC
61 -+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
62 -+ $<INSTALL_INTERFACE:include>
63 -+)
64 -
65 - # this compiles the "DLL" interface (C API)
66 - target_compile_definitions(muparser PRIVATE MUPARSER_DLL)
67 -@@ -77,9 +82,6 @@ set_target_properties(muparser PROPERTIES
68 - SOVERSION ${MUPARSER_VERSION_MAJOR}
69 - )
70 -
71 --# Install the export set for use with the install-tree
72 --export(TARGETS muparser FILE "${CMAKE_BINARY_DIR}/muparser-targets.cmake")
73 --
74 - if(ENABLE_SAMPLES)
75 - add_executable(example1 samples/example1/example1.cpp)
76 - target_link_libraries(example1 muparser)
77 -@@ -91,8 +93,10 @@ endif()
78 - # The GNUInstallDirs defines ${CMAKE_INSTALL_DATAROOTDIR}
79 - # See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
80 - include (GNUInstallDirs)
81 -+set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/muparser)
82 -
83 - install(TARGETS muparser
84 -+ EXPORT muparser-export
85 - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
86 - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
87 - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeLibraries
88 -@@ -116,6 +120,35 @@ install(FILES
89 - COMPONENT Development
90 - )
91 -
92 -+# Export the target under the build-tree (no need to install)
93 -+export(EXPORT muparser-export
94 -+ FILE "${CMAKE_BINARY_DIR}/muparser-targets.cmake"
95 -+ NAMESPACE muparser::
96 -+)
97 -+
98 -+# Export the installed target (typically for packaging)
99 -+include(CMakePackageConfigHelpers)
100 -+write_basic_package_version_file(
101 -+ "${CMAKE_CURRENT_BINARY_DIR}/muparserConfigVersion.cmake"
102 -+ VERSION ${MUPARSER_VERSION}
103 -+ COMPATIBILITY AnyNewerVersion
104 -+)
105 -+configure_file(muparserConfig.cmake.in
106 -+ "${CMAKE_CURRENT_BINARY_DIR}/muparserConfig.cmake"
107 -+ COPYONLY
108 -+)
109 -+install(EXPORT muparser-export
110 -+ FILE muparser-targets.cmake
111 -+ NAMESPACE muparser::
112 -+ DESTINATION ${INSTALL_CONFIGDIR}
113 -+)
114 -+install(FILES
115 -+ ${CMAKE_CURRENT_BINARY_DIR}/muparserConfig.cmake
116 -+ ${CMAKE_CURRENT_BINARY_DIR}/muparserConfigVersion.cmake
117 -+ DESTINATION ${INSTALL_CONFIGDIR}
118 -+ COMPONENT Development
119 -+)
120 -+
121 - # Define variables for the pkg-config file
122 - set(PACKAGE_NAME muparser)
123 - configure_file(
124 -diff --git a/CMakeLists.txt.orig b/CMakeLists.txt.orig
125 -new file mode 100644
126 -index 0000000..b496584
127 ---- /dev/null
128 -+++ b/CMakeLists.txt.orig
129 -@@ -0,0 +1,173 @@
130 -+# CMake based on work from @xantares
131 -+cmake_minimum_required (VERSION 3.1.0)
132 -+set(CMAKE_CXX_STANDARD 11)
133 -+set(CMAKE_CXX_STANDARD_REQUIRED ON)
134 -+
135 -+# By default, build in Release mode. Must appear before project() command
136 -+if (NOT DEFINED CMAKE_BUILD_TYPE)
137 -+ set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
138 -+endif ()
139 -+
140 -+project(muParserProject)
141 -+
142 -+
143 -+
144 -+# Bump versions on release
145 -+set(MUPARSER_VERSION_MAJOR 2)
146 -+set(MUPARSER_VERSION_MINOR 3)
147 -+set(MUPARSER_VERSION_PATCH 2)
148 -+set(MUPARSER_VERSION ${MUPARSER_VERSION_MAJOR}.${MUPARSER_VERSION_MINOR}.${MUPARSER_VERSION_PATCH})
149 -+
150 -+# Build options
151 -+option(ENABLE_SAMPLES "Build the samples" ON)
152 -+option(ENABLE_OPENMP "Enable OpenMP for multithreading" ON)
153 -+option(BUILD_SHARED_LIBS "Build shared/static libs" ON)
154 -+
155 -+if(ENABLE_OPENMP)
156 -+ find_package(OpenMP REQUIRED)
157 -+ set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
158 -+ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
159 -+endif()
160 -+
161 -+
162 -+# Credit: https://stackoverflow.com/questions/2368811/how-to-set-warning-level-in-cmake/3818084
163 -+if(MSVC)
164 -+ # Force to always compile with W4
165 -+ if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
166 -+ string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
167 -+ else()
168 -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
169 -+ endif()
170 -+elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
171 -+ # Update if necessary
172 -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic")
173 -+endif()
174 -+
175 -+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
176 -+add_library(muparser
177 -+ src/muParserBase.cpp
178 -+ src/muParserBytecode.cpp
179 -+ src/muParserCallback.cpp
180 -+ src/muParser.cpp
181 -+ src/muParserDLL.cpp
182 -+ src/muParserError.cpp
183 -+ src/muParserInt.cpp
184 -+ src/muParserTest.cpp
185 -+ src/muParserTokenReader.cpp
186 -+)
187 -+<<<<<<< HEAD
188 -+=======
189 -+# use the headers in the build-tree or the installed ones
190 -+target_include_directories(muparser PUBLIC
191 -+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
192 -+ $<INSTALL_INTERFACE:include>
193 -+)
194 -+>>>>>>> e259981 (Export muparser cmake targets)
195 -+
196 -+# this compiles the "DLL" interface (C API)
197 -+target_compile_definitions(muparser PRIVATE MUPARSER_DLL)
198 -+
199 -+if (BUILD_SHARED_LIBS)
200 -+ target_compile_definitions(muparser PRIVATE MUPARSERLIB_EXPORTS)
201 -+else ()
202 -+ target_compile_definitions(muparser PUBLIC MUPARSER_STATIC)
203 -+endif()
204 -+
205 -+if (CMAKE_BUILD_TYPE STREQUAL Debug)
206 -+ target_compile_definitions(muparser PRIVATE _DEBUG)
207 -+endif ()
208 -+
209 -+if(ENABLE_OPENMP)
210 -+ target_compile_definitions(muparser PRIVATE MUP_USE_OPENMP)
211 -+endif()
212 -+set_target_properties(muparser PROPERTIES
213 -+ VERSION ${MUPARSER_VERSION}
214 -+ SOVERSION ${MUPARSER_VERSION_MAJOR}
215 -+)
216 -+
217 -+if(ENABLE_SAMPLES)
218 -+ add_executable(example1 samples/example1/example1.cpp)
219 -+ target_link_libraries(example1 muparser)
220 -+
221 -+ add_executable(example2 samples/example2/example2.c)
222 -+ target_link_libraries(example2 muparser)
223 -+endif()
224 -+
225 -+# The GNUInstallDirs defines ${CMAKE_INSTALL_DATAROOTDIR}
226 -+# See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
227 -+include (GNUInstallDirs)
228 -+set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/muparser)
229 -+
230 -+install(TARGETS muparser
231 -+ EXPORT muparser-export
232 -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
233 -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
234 -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeLibraries
235 -+)
236 -+
237 -+install(FILES
238 -+ include/muParserBase.h
239 -+ include/muParserBytecode.h
240 -+ include/muParserCallback.h
241 -+ include/muParserDef.h
242 -+ include/muParserDLL.h
243 -+ include/muParserError.h
244 -+ include/muParserFixes.h
245 -+ include/muParser.h
246 -+ include/muParserInt.h
247 -+ include/muParserTemplateMagic.h
248 -+ include/muParserTest.h
249 -+ include/muParserToken.h
250 -+ include/muParserTokenReader.h
251 -+ DESTINATION include
252 -+ COMPONENT Development
253 -+)
254 -+
255 -+# Export the target under the build-tree (no need to install)
256 -+export(EXPORT muparser-export
257 -+ FILE "${CMAKE_BINARY_DIR}/muparser-targets.cmake"
258 -+ NAMESPACE muparser::
259 -+)
260 -+
261 -+# Export the installed target (typically for packaging)
262 -+include(CMakePackageConfigHelpers)
263 -+write_basic_package_version_file(
264 -+ "${CMAKE_CURRENT_BINARY_DIR}/muparserConfigVersion.cmake"
265 -+ VERSION ${MUPARSER_VERSION}
266 -+ COMPATIBILITY AnyNewerVersion
267 -+)
268 -+configure_file(muparserConfig.cmake.in
269 -+ "${CMAKE_CURRENT_BINARY_DIR}/muparserConfig.cmake"
270 -+ COPYONLY
271 -+)
272 -+install(EXPORT muparser-export
273 -+ FILE muparser-targets.cmake
274 -+ NAMESPACE muparser::
275 -+ DESTINATION ${INSTALL_CONFIGDIR}
276 -+)
277 -+install(FILES
278 -+ ${CMAKE_CURRENT_BINARY_DIR}/muparserConfig.cmake
279 -+ ${CMAKE_CURRENT_BINARY_DIR}/muparserConfigVersion.cmake
280 -+ DESTINATION ${INSTALL_CONFIGDIR}
281 -+ COMPONENT Development
282 -+)
283 -+
284 -+# Define variables for the pkg-config file
285 -+set(PACKAGE_NAME muparser)
286 -+configure_file(
287 -+ muparser.pc.in
288 -+ ${CMAKE_BINARY_DIR}/muparser.pc
289 -+ @ONLY
290 -+)
291 -+install(
292 -+ FILES ${CMAKE_BINARY_DIR}/muparser.pc
293 -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
294 -+)
295 -+
296 -+include(CTest)
297 -+enable_testing()
298 -+
299 -+add_executable (t_ParserTest test/t_ParserTest.cpp)
300 -+target_link_libraries(t_ParserTest muparser)
301 -+add_test (NAME ParserTest COMMAND t_ParserTest)
302 -+
303 -diff --git a/muparserConfig.cmake.in b/muparserConfig.cmake.in
304 -new file mode 100644
305 -index 0000000..6a28a5e
306 ---- /dev/null
307 -+++ b/muparserConfig.cmake.in
308 -@@ -0,0 +1,6 @@
309 -+get_filename_component(muparser_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
310 -+include(CMakeFindDependencyMacro)
311 -+
312 -+if(NOT TARGET muparser::muparser)
313 -+ include("${muparser_CMAKE_DIR}/muparser-targets.cmake")
314 -+endif()
315 -diff --git a/samples/example3/CMakeLists.txt b/samples/example3/CMakeLists.txt
316 -new file mode 100644
317 -index 0000000..0049c3e
318 ---- /dev/null
319 -+++ b/samples/example3/CMakeLists.txt
320 -@@ -0,0 +1,12 @@
321 -+cmake_minimum_required(VERSION 3.2)
322 -+project(muparser-example3)
323 -+
324 -+# find muparser target already installed
325 -+find_package(muparser 2.0 REQUIRED)
326 -+
327 -+add_executable(example3 example3.cpp)
328 -+target_link_libraries(example3 muparser::muparser)
329 -+
330 -+include(CTest)
331 -+add_test(example3 example3)
332 -+
333 -diff --git a/samples/example3/README.md b/samples/example3/README.md
334 -new file mode 100644
335 -index 0000000..73e15d4
336 ---- /dev/null
337 -+++ b/samples/example3/README.md
338 -@@ -0,0 +1,2 @@
339 -+The example3 shows how to import and use muparser as an installed external
340 -+dependency using cmake `find_package()`.
341 -diff --git a/samples/example3/build.sh b/samples/example3/build.sh
342 -new file mode 100755
343 -index 0000000..289fac9
344 ---- /dev/null
345 -+++ b/samples/example3/build.sh
346 -@@ -0,0 +1,23 @@
347 -+#!/bin/bash -x
348 -+
349 -+CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
350 -+MP_SOURCES=${CWD}/../../
351 -+MP_BUILD=${CWD}/muparser-build
352 -+MP_INSTALL=${CWD}/muparser-install
353 -+EX3_BUILD_TREE=${CWD}/example3-using-buildtree
354 -+EX3_INSTALL_TREE=${CWD}/example3-using-installtree
355 -+
356 -+# Build muparser and install it
357 -+cmake -H${MP_SOURCES} -B${MP_BUILD} -DCMAKE_INSTALL_PREFIX=${MP_INSTALL}
358 -+cmake --build ${MP_BUILD} --target install
359 -+
360 -+# Build the example using muparser build tree
361 -+cmake -H${CWD} -B${EX3_BUILD_TREE} -DCMAKE_PREFIX_PATH=${MP_BUILD}
362 -+cmake --build ${EX3_BUILD_TREE} --target all
363 -+cmake --build ${EX3_BUILD_TREE} --target test
364 -+
365 -+# Build the example using muparser install tree
366 -+cmake -H${CWD} -B${EX3_INSTALL_TREE} -DCMAKE_PREFIX_PATH=${MP_INSTALL}
367 -+cmake --build ${EX3_INSTALL_TREE} --target all
368 -+cmake --build ${EX3_INSTALL_TREE} --target test
369 -+
370 -diff --git a/samples/example3/example3.cpp b/samples/example3/example3.cpp
371 -new file mode 100644
372 -index 0000000..78df86f
373 ---- /dev/null
374 -+++ b/samples/example3/example3.cpp
375 -@@ -0,0 +1,49 @@
376 -+/*
377 -+
378 -+ _____ __ _____________ _______ ______ ___________
379 -+ / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
380 -+ | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
381 -+ |__|_| /____/| __(____ /__| /____ >\___ >__|
382 -+ \/ |__| \/ \/ \/
383 -+ Copyright (C) 2004 - 2020 Ingo Berg
384 -+
385 -+ Redistribution and use in source and binary forms, with or without modification, are permitted
386 -+ provided that the following conditions are met:
387 -+
388 -+ * Redistributions of source code must retain the above copyright notice, this list of
389 -+ conditions and the following disclaimer.
390 -+ * Redistributions in binary form must reproduce the above copyright notice, this list of
391 -+ conditions and the following disclaimer in the documentation and/or other materials provided
392 -+ with the distribution.
393 -+
394 -+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
395 -+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
396 -+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
397 -+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
398 -+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
399 -+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
400 -+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
401 -+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
402 -+*/
403 -+
404 -+// Small example using the cmake imported target. Include file and link library
405 -+// should work automagically.
406 -+
407 -+#include <muParser.h>
408 -+#include <muParserDef.h>
409 -+
410 -+int main()
411 -+{
412 -+ mu::Parser parser;
413 -+
414 -+ mu::value_type values[] = { 1, 2 };
415 -+ parser.DefineVar("a", &values[0]);
416 -+ parser.DefineVar("b", &values[1]);
417 -+
418 -+ std::string expr = "a + b";
419 -+ parser.SetExpr("a + b");
420 -+ mu::value_type ans = parser.Eval();
421 -+ std::cout << expr << " == " << ans << "\n";
422 -+
423 -+ return (ans == 3.0) ? 0 : -1;
424 -+}
425 ---
426 -2.33.1
427 -