diff options
author | V3n3RiX <venerix@koprulu.sector> | 2021-11-13 13:10:00 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2021-11-13 13:10:00 +0000 |
commit | e9d044d4b9b71200a96adfa280848858c0f468c9 (patch) | |
tree | 1bd8ef816043a8cd340f1d774e79553a1a7d31d8 /dev-cpp/muParser | |
parent | fc2f1018fc323ef2c6572734a9b130427cba76a6 (diff) |
gentoo resync : 13.11.2021
Diffstat (limited to 'dev-cpp/muParser')
-rw-r--r-- | dev-cpp/muParser/Manifest | 3 | ||||
-rw-r--r-- | dev-cpp/muParser/files/muParser-2.3-export-cmake.patch | 405 | ||||
-rw-r--r-- | dev-cpp/muParser/muParser-2.3.2-r1.ebuild | 35 |
3 files changed, 443 insertions, 0 deletions
diff --git a/dev-cpp/muParser/Manifest b/dev-cpp/muParser/Manifest index 2fa797dc5d63..da427c0b597a 100644 --- a/dev-cpp/muParser/Manifest +++ b/dev-cpp/muParser/Manifest @@ -1,4 +1,7 @@ AUX muParser-1.32-parallel-build.patch 680 BLAKE2B 7699b129186f0173bfbc7f742d51175ed67eddb9898b61f7d6a3a462e1a262112a2d4af445e12501caa88d4630308bb5f273ef2a704e2948db9cdb7649ee6bb7 SHA512 a39af330803786ebb86259dd86ecfac00ca04978b0e623b418d887f6b20a6eb6cee2b37da8164aa7038b3accf388b40b6a6d4eccd2f20afdfd6051cc3505ac90 +AUX muParser-2.3-export-cmake.patch 13652 BLAKE2B a83680f1214a6941a89f28fbdf0789fd665ca002d4259ffb802cc32c37f83a48f45b601c52640a9e0bcb39b4e4869317ccb71898b557f9b19caaf5b3ee11ecec SHA512 a126199cb71e8160f78bd3872fe252ce7cc77f99185af8922750bee85b0a60a2657a688913a9df897d15c76bd0446d16371cf792f334b96e101e07d84856bb6b DIST muParser-2.2.6.1.tar.gz 755653 BLAKE2B b3b6b8da57c0e8a0bda74038689d444ba8da00d6cce80030d8b35693209f0293874e4822c4941974be21fd4b7c09ba7df2c9cef861bc10b890aae4f641040faf SHA512 01bfc8cc48158c8413ae5e1da2ddbac1c9f0b9075470b1ab75853587d641dd195ebea268e1060a340098fd8015bc5f77d8e9cde5f81cffeade2f157c5f295496 +DIST muParser-2.3.2.tar.gz 103979 BLAKE2B f892b4d440a1b7326be27aa0a2b703ccafc02de5e881ef4780e8907688cf7905284f3e5f5855ad2596683f1dad309d287ebae527d917ebf5e0dad045551df7de SHA512 8ef5c8b3834da3995a782b7364a4eb4197fb706bee4cadabe5511d2a9cf2912c3db6de422a91eff7f9690f8c9c355b9900335e940749d5c243cb732ac1992aef EBUILD muParser-2.2.6.1.ebuild 884 BLAKE2B 0632f4ac0e8b1c70fa866d0113496891d28dd7a3ef42f6124326e175e98a11922bbef7653c317b9e80186ba0e3ed7d888f7416f7893632184c2a155cd09137f3 SHA512 886577b677945b49b0422733c0f4f78bf0d4a239ee1fc41ad6b420484d8d461254eb8b6e71599799764258820b8de88768caf3e552c460bdcf33caeabf04cbb9 +EBUILD muParser-2.3.2-r1.ebuild 759 BLAKE2B d0cf80151df77795cc47e099dbc5319af65e1cd85e70ff18b4445fc56fc8c427bc2d68bd472cf6281a89bf25197711ff006f5924982b627085b2c74e2bf81760 SHA512 7aace9aec071b81b463dc2eeff86d1091148cc0e91ffe90c84a6a66e0967f5c553dbbd9978a59d5ce1bcdbe7d35cade97ddc4509b2dae37df0dccda24105d9d6 MISC metadata.xml 625 BLAKE2B 319444cf45ae4e0e7ad24cc11590e5141a5a7b05404fcb9b95373e548e4ca0b23dda45057317a68051006805c77d031cdd4ff55b6b4c827e1cdf36ac9b0df3b7 SHA512 029296e964eecf47ba83943e51bb14dc251d55de449a0d6c3f0396f5b3e8fcd19c02074f46ad5d71dd03f46c61029d6300569d3b9bfaa106464515adecf0b1ee diff --git a/dev-cpp/muParser/files/muParser-2.3-export-cmake.patch b/dev-cpp/muParser/files/muParser-2.3-export-cmake.patch new file mode 100644 index 000000000000..79254626db6a --- /dev/null +++ b/dev-cpp/muParser/files/muParser-2.3-export-cmake.patch @@ -0,0 +1,405 @@ +From a9e6626c9b2e250eb9161c767d2fb2e5a07315e2 Mon Sep 17 00:00:00 2001 +From: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca> +Date: Wed, 8 Jul 2020 14:59:27 -0400 +Subject: [PATCH] Export muparser cmake targets + +Export muparser targets, such that client projects can +import it using find_package(). This mechanism for both the build tree +and the install tree. The provided example3 shows how to import muparser +targets. + +Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca> +Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org> +--- + CMakeLists.txt | 39 ++++++- + CMakeLists.txt.orig | 173 ++++++++++++++++++++++++++++++++ + muparserConfig.cmake.in | 6 ++ + samples/example3/CMakeLists.txt | 12 +++ + samples/example3/README.md | 2 + + samples/example3/build.sh | 23 +++++ + samples/example3/example3.cpp | 49 +++++++++ + 7 files changed, 301 insertions(+), 3 deletions(-) + create mode 100644 CMakeLists.txt.orig + create mode 100644 muparserConfig.cmake.in + create mode 100644 samples/example3/CMakeLists.txt + create mode 100644 samples/example3/README.md + create mode 100755 samples/example3/build.sh + create mode 100644 samples/example3/example3.cpp + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cfdce99..aecc67d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -55,6 +55,11 @@ add_library(muparser + src/muParserTest.cpp + src/muParserTokenReader.cpp + ) ++# use the headers in the build-tree or the installed ones ++target_include_directories(muparser PUBLIC ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> ++ $<INSTALL_INTERFACE:include> ++) + + # this compiles the "DLL" interface (C API) + target_compile_definitions(muparser PRIVATE MUPARSER_DLL) +@@ -77,9 +82,6 @@ set_target_properties(muparser PROPERTIES + SOVERSION ${MUPARSER_VERSION_MAJOR} + ) + +-# Install the export set for use with the install-tree +-export(TARGETS muparser FILE "${CMAKE_BINARY_DIR}/muparser-targets.cmake") +- + if(ENABLE_SAMPLES) + add_executable(example1 samples/example1/example1.cpp) + target_link_libraries(example1 muparser) +@@ -91,8 +93,10 @@ endif() + # The GNUInstallDirs defines ${CMAKE_INSTALL_DATAROOTDIR} + # See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html + include (GNUInstallDirs) ++set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/muparser) + + install(TARGETS muparser ++ EXPORT muparser-export + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeLibraries +@@ -116,6 +120,35 @@ install(FILES + COMPONENT Development + ) + ++# Export the target under the build-tree (no need to install) ++export(EXPORT muparser-export ++ FILE "${CMAKE_BINARY_DIR}/muparser-targets.cmake" ++ NAMESPACE muparser:: ++) ++ ++# Export the installed target (typically for packaging) ++include(CMakePackageConfigHelpers) ++write_basic_package_version_file( ++ "${CMAKE_CURRENT_BINARY_DIR}/muparserConfigVersion.cmake" ++ VERSION ${MUPARSER_VERSION} ++ COMPATIBILITY AnyNewerVersion ++) ++configure_file(muparserConfig.cmake.in ++ "${CMAKE_CURRENT_BINARY_DIR}/muparserConfig.cmake" ++ COPYONLY ++) ++install(EXPORT muparser-export ++ FILE muparser-targets.cmake ++ NAMESPACE muparser:: ++ DESTINATION ${INSTALL_CONFIGDIR} ++) ++install(FILES ++ ${CMAKE_CURRENT_BINARY_DIR}/muparserConfig.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/muparserConfigVersion.cmake ++ DESTINATION ${INSTALL_CONFIGDIR} ++ COMPONENT Development ++) ++ + # Define variables for the pkg-config file + set(PACKAGE_NAME muparser) + configure_file( +diff --git a/CMakeLists.txt.orig b/CMakeLists.txt.orig +new file mode 100644 +index 0000000..b496584 +--- /dev/null ++++ b/CMakeLists.txt.orig +@@ -0,0 +1,173 @@ ++# CMake based on work from @xantares ++cmake_minimum_required (VERSION 3.1.0) ++set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD_REQUIRED ON) ++ ++# By default, build in Release mode. Must appear before project() command ++if (NOT DEFINED CMAKE_BUILD_TYPE) ++ set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type") ++endif () ++ ++project(muParserProject) ++ ++ ++ ++# Bump versions on release ++set(MUPARSER_VERSION_MAJOR 2) ++set(MUPARSER_VERSION_MINOR 3) ++set(MUPARSER_VERSION_PATCH 2) ++set(MUPARSER_VERSION ${MUPARSER_VERSION_MAJOR}.${MUPARSER_VERSION_MINOR}.${MUPARSER_VERSION_PATCH}) ++ ++# Build options ++option(ENABLE_SAMPLES "Build the samples" ON) ++option(ENABLE_OPENMP "Enable OpenMP for multithreading" ON) ++option(BUILD_SHARED_LIBS "Build shared/static libs" ON) ++ ++if(ENABLE_OPENMP) ++ find_package(OpenMP REQUIRED) ++ set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}") ++ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") ++endif() ++ ++ ++# Credit: https://stackoverflow.com/questions/2368811/how-to-set-warning-level-in-cmake/3818084 ++if(MSVC) ++ # Force to always compile with W4 ++ if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") ++ string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ++ else() ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") ++ endif() ++elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) ++ # Update if necessary ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic") ++endif() ++ ++include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") ++add_library(muparser ++ src/muParserBase.cpp ++ src/muParserBytecode.cpp ++ src/muParserCallback.cpp ++ src/muParser.cpp ++ src/muParserDLL.cpp ++ src/muParserError.cpp ++ src/muParserInt.cpp ++ src/muParserTest.cpp ++ src/muParserTokenReader.cpp ++) ++<<<<<<< HEAD ++======= ++# use the headers in the build-tree or the installed ones ++target_include_directories(muparser PUBLIC ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> ++ $<INSTALL_INTERFACE:include> ++) ++>>>>>>> e259981 (Export muparser cmake targets) ++ ++# this compiles the "DLL" interface (C API) ++target_compile_definitions(muparser PRIVATE MUPARSER_DLL) ++ ++if (BUILD_SHARED_LIBS) ++ target_compile_definitions(muparser PRIVATE MUPARSERLIB_EXPORTS) ++else () ++ target_compile_definitions(muparser PUBLIC MUPARSER_STATIC) ++endif() ++ ++if (CMAKE_BUILD_TYPE STREQUAL Debug) ++ target_compile_definitions(muparser PRIVATE _DEBUG) ++endif () ++ ++if(ENABLE_OPENMP) ++ target_compile_definitions(muparser PRIVATE MUP_USE_OPENMP) ++endif() ++set_target_properties(muparser PROPERTIES ++ VERSION ${MUPARSER_VERSION} ++ SOVERSION ${MUPARSER_VERSION_MAJOR} ++) ++ ++if(ENABLE_SAMPLES) ++ add_executable(example1 samples/example1/example1.cpp) ++ target_link_libraries(example1 muparser) ++ ++ add_executable(example2 samples/example2/example2.c) ++ target_link_libraries(example2 muparser) ++endif() ++ ++# The GNUInstallDirs defines ${CMAKE_INSTALL_DATAROOTDIR} ++# See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html ++include (GNUInstallDirs) ++set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/muparser) ++ ++install(TARGETS muparser ++ EXPORT muparser-export ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeLibraries ++) ++ ++install(FILES ++ include/muParserBase.h ++ include/muParserBytecode.h ++ include/muParserCallback.h ++ include/muParserDef.h ++ include/muParserDLL.h ++ include/muParserError.h ++ include/muParserFixes.h ++ include/muParser.h ++ include/muParserInt.h ++ include/muParserTemplateMagic.h ++ include/muParserTest.h ++ include/muParserToken.h ++ include/muParserTokenReader.h ++ DESTINATION include ++ COMPONENT Development ++) ++ ++# Export the target under the build-tree (no need to install) ++export(EXPORT muparser-export ++ FILE "${CMAKE_BINARY_DIR}/muparser-targets.cmake" ++ NAMESPACE muparser:: ++) ++ ++# Export the installed target (typically for packaging) ++include(CMakePackageConfigHelpers) ++write_basic_package_version_file( ++ "${CMAKE_CURRENT_BINARY_DIR}/muparserConfigVersion.cmake" ++ VERSION ${MUPARSER_VERSION} ++ COMPATIBILITY AnyNewerVersion ++) ++configure_file(muparserConfig.cmake.in ++ "${CMAKE_CURRENT_BINARY_DIR}/muparserConfig.cmake" ++ COPYONLY ++) ++install(EXPORT muparser-export ++ FILE muparser-targets.cmake ++ NAMESPACE muparser:: ++ DESTINATION ${INSTALL_CONFIGDIR} ++) ++install(FILES ++ ${CMAKE_CURRENT_BINARY_DIR}/muparserConfig.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/muparserConfigVersion.cmake ++ DESTINATION ${INSTALL_CONFIGDIR} ++ COMPONENT Development ++) ++ ++# Define variables for the pkg-config file ++set(PACKAGE_NAME muparser) ++configure_file( ++ muparser.pc.in ++ ${CMAKE_BINARY_DIR}/muparser.pc ++ @ONLY ++) ++install( ++ FILES ${CMAKE_BINARY_DIR}/muparser.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ++) ++ ++include(CTest) ++enable_testing() ++ ++add_executable (t_ParserTest test/t_ParserTest.cpp) ++target_link_libraries(t_ParserTest muparser) ++add_test (NAME ParserTest COMMAND t_ParserTest) ++ +diff --git a/muparserConfig.cmake.in b/muparserConfig.cmake.in +new file mode 100644 +index 0000000..6a28a5e +--- /dev/null ++++ b/muparserConfig.cmake.in +@@ -0,0 +1,6 @@ ++get_filename_component(muparser_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) ++include(CMakeFindDependencyMacro) ++ ++if(NOT TARGET muparser::muparser) ++ include("${muparser_CMAKE_DIR}/muparser-targets.cmake") ++endif() +diff --git a/samples/example3/CMakeLists.txt b/samples/example3/CMakeLists.txt +new file mode 100644 +index 0000000..0049c3e +--- /dev/null ++++ b/samples/example3/CMakeLists.txt +@@ -0,0 +1,12 @@ ++cmake_minimum_required(VERSION 3.2) ++project(muparser-example3) ++ ++# find muparser target already installed ++find_package(muparser 2.0 REQUIRED) ++ ++add_executable(example3 example3.cpp) ++target_link_libraries(example3 muparser::muparser) ++ ++include(CTest) ++add_test(example3 example3) ++ +diff --git a/samples/example3/README.md b/samples/example3/README.md +new file mode 100644 +index 0000000..73e15d4 +--- /dev/null ++++ b/samples/example3/README.md +@@ -0,0 +1,2 @@ ++The example3 shows how to import and use muparser as an installed external ++dependency using cmake `find_package()`. +diff --git a/samples/example3/build.sh b/samples/example3/build.sh +new file mode 100755 +index 0000000..289fac9 +--- /dev/null ++++ b/samples/example3/build.sh +@@ -0,0 +1,23 @@ ++#!/bin/bash -x ++ ++CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ++MP_SOURCES=${CWD}/../../ ++MP_BUILD=${CWD}/muparser-build ++MP_INSTALL=${CWD}/muparser-install ++EX3_BUILD_TREE=${CWD}/example3-using-buildtree ++EX3_INSTALL_TREE=${CWD}/example3-using-installtree ++ ++# Build muparser and install it ++cmake -H${MP_SOURCES} -B${MP_BUILD} -DCMAKE_INSTALL_PREFIX=${MP_INSTALL} ++cmake --build ${MP_BUILD} --target install ++ ++# Build the example using muparser build tree ++cmake -H${CWD} -B${EX3_BUILD_TREE} -DCMAKE_PREFIX_PATH=${MP_BUILD} ++cmake --build ${EX3_BUILD_TREE} --target all ++cmake --build ${EX3_BUILD_TREE} --target test ++ ++# Build the example using muparser install tree ++cmake -H${CWD} -B${EX3_INSTALL_TREE} -DCMAKE_PREFIX_PATH=${MP_INSTALL} ++cmake --build ${EX3_INSTALL_TREE} --target all ++cmake --build ${EX3_INSTALL_TREE} --target test ++ +diff --git a/samples/example3/example3.cpp b/samples/example3/example3.cpp +new file mode 100644 +index 0000000..78df86f +--- /dev/null ++++ b/samples/example3/example3.cpp +@@ -0,0 +1,49 @@ ++/* ++ ++ _____ __ _____________ _______ ______ ___________ ++ / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \ ++ | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/ ++ |__|_| /____/| __(____ /__| /____ >\___ >__| ++ \/ |__| \/ \/ \/ ++ Copyright (C) 2004 - 2020 Ingo Berg ++ ++ Redistribution and use in source and binary forms, with or without modification, are permitted ++ provided that the following conditions are met: ++ ++ * Redistributions of source code must retain the above copyright notice, this list of ++ conditions and the following disclaimer. ++ * Redistributions in binary form must reproduce the above copyright notice, this list of ++ conditions and the following disclaimer in the documentation and/or other materials provided ++ with the distribution. ++ ++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR ++ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND ++ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ++ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER ++ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ++ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++*/ ++ ++// Small example using the cmake imported target. Include file and link library ++// should work automagically. ++ ++#include <muParser.h> ++#include <muParserDef.h> ++ ++int main() ++{ ++ mu::Parser parser; ++ ++ mu::value_type values[] = { 1, 2 }; ++ parser.DefineVar("a", &values[0]); ++ parser.DefineVar("b", &values[1]); ++ ++ std::string expr = "a + b"; ++ parser.SetExpr("a + b"); ++ mu::value_type ans = parser.Eval(); ++ std::cout << expr << " == " << ans << "\n"; ++ ++ return (ans == 3.0) ? 0 : -1; ++} +-- +2.33.1 + diff --git a/dev-cpp/muParser/muParser-2.3.2-r1.ebuild b/dev-cpp/muParser/muParser-2.3.2-r1.ebuild new file mode 100644 index 000000000000..010002a56d2e --- /dev/null +++ b/dev-cpp/muParser/muParser-2.3.2-r1.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="Library for parsing mathematical expressions" +HOMEPAGE="http://muparser.beltoforion.de/" +SRC_URI="https://github.com/beltoforion/muparser/archive/v${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}"/muparser-${PV} + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="doc openmp test" +RESTRICT="!test? ( test )" + +PATCHES=( "${FILESDIR}/muParser-2.3-export-cmake.patch" ) + +src_configure() { + mycmakeargs=( + -DENABLE_OPENMP=$(usex openmp) + ) + cmake_src_configure +} + +src_test() { + cmake_src_compile test +} + +src_install() { + cmake_src_install + dodoc Changes.txt +} |