diff options
author | Luca Weiss <luca@z3ntu.xyz> | 2018-09-26 14:42:20 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-09-26 16:19:04 +0000 |
commit | 1622f7c905bc251e56b62a84a2c350e8b5b827df (patch) | |
tree | d116a4ca2e3fe097299af47c7d44ac0efefbaa16 /community/yaml-cpp | |
parent | cd24d5a65b7192c31509c46f38545631fce0afa3 (diff) | |
download | aports-1622f7c905bc251e56b62a84a2c350e8b5b827df.tar.bz2 aports-1622f7c905bc251e56b62a84a2c350e8b5b827df.tar.xz |
community/yaml-cpp: Fix headers of gmock and gtest being installed
patch is from upstream.
https://github.com/jbeder/yaml-cpp/issues/539
Diffstat (limited to 'community/yaml-cpp')
-rw-r--r-- | community/yaml-cpp/3e33bb316651981916d623488caf2f8ee1b79b50.patch | 209 | ||||
-rw-r--r-- | community/yaml-cpp/APKBUILD | 8 |
2 files changed, 214 insertions, 3 deletions
diff --git a/community/yaml-cpp/3e33bb316651981916d623488caf2f8ee1b79b50.patch b/community/yaml-cpp/3e33bb316651981916d623488caf2f8ee1b79b50.patch new file mode 100644 index 0000000000..6c73af9489 --- /dev/null +++ b/community/yaml-cpp/3e33bb316651981916d623488caf2f8ee1b79b50.patch @@ -0,0 +1,209 @@ +From 3e33bb316651981916d623488caf2f8ee1b79b50 Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com> +Date: Thu, 9 Aug 2018 15:11:50 +0300 +Subject: [PATCH] Improvements to CMake buildsystem (#563) + +* Move enable_testing() into proper place + +* Added CMake's checks for C++11 standards + +Raised minimal version of CMake to 3.1, since on old systems there no +decent compilers that supports c++11. + +Closes #377. + +* Externalize googletest project + +Externalize gtest to avoid installation, fixes #539. + +* Remove defined cmake_policies + +CMP0012 - OLD marked as deprecated for >=cmake-3.1 and will be removed +CMP0015 - does not affect to build process +CMP0042 - already NEW for >=cmake-3.1 + +Fixes #505 + +* Fix compiling in Windows MSVC +--- + CMakeLists.txt | 26 +++++------------- + test/CMakeLists.txt | 67 +++++++++++++++++++++++++++++---------------- + util/CMakeLists.txt | 4 +-- + 3 files changed, 51 insertions(+), 46 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 715c8466..154230ac 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,26 +1,11 @@ + ### + ### CMake settings + ### +-## Due to Mac OSX we need to keep compatibility with CMake 2.6 + # see http://www.cmake.org/Wiki/CMake_Policies +-cmake_minimum_required(VERSION 2.6) +-# see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0012 +-if(POLICY CMP0012) +- cmake_policy(SET CMP0012 OLD) +-endif() +-# see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0015 +-if(POLICY CMP0015) +- cmake_policy(SET CMP0015 OLD) +-endif() +-# see https://cmake.org/cmake/help/latest/policy/CMP0042.html +-if(POLICY CMP0042) +- # Enable MACOSX_RPATH by default. +- cmake_policy(SET CMP0042 NEW) +-endif() ++cmake_minimum_required(VERSION 3.1) + + include(CheckCXXCompilerFlag) + +- + ### + ### Project settings + ### +@@ -31,8 +16,6 @@ set(YAML_CPP_VERSION_MINOR "6") + set(YAML_CPP_VERSION_PATCH "2") + set(YAML_CPP_VERSION "${YAML_CPP_VERSION_MAJOR}.${YAML_CPP_VERSION_MINOR}.${YAML_CPP_VERSION_PATCH}") + +-enable_testing() +- + + ### + ### Project options +@@ -48,6 +31,10 @@ option(YAML_CPP_BUILD_CONTRIB "Enable contrib stuff in library" ON) + # http://www.cmake.org/cmake/help/cmake2.6docs.html#command:add_library + option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF) + ++# Set minimum C++ to 2011 standards ++set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD_REQUIRED ON) ++ + # --> Apple + option(APPLE_UNIVERSAL_BIN "Apple: Build universal binary" OFF) + +@@ -188,7 +175,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR + set(GCC_EXTRA_OPTIONS "${GCC_EXTRA_OPTIONS} ${FLAG_TESTED}") + endif() + # +- set(yaml_cxx_flags "-Wall ${GCC_EXTRA_OPTIONS} -pedantic -Wno-long-long -std=c++11 ${yaml_cxx_flags}") ++ set(yaml_cxx_flags "-Wall ${GCC_EXTRA_OPTIONS} -pedantic -Wno-long-long ${yaml_cxx_flags}") + + ### Make specific + if(${CMAKE_BUILD_TOOL} MATCHES make OR ${CMAKE_BUILD_TOOL} MATCHES gmake) +@@ -360,6 +347,7 @@ endif() + ### Extras + ### + if(YAML_CPP_BUILD_TESTS) ++ enable_testing() + add_subdirectory(test) + endif() + if(YAML_CPP_BUILD_TOOLS) +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index ad61a3c0..a83d9ddb 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -1,26 +1,39 @@ +-set(gtest_force_shared_crt ${MSVC_SHARED_RT} CACHE BOOL +- "Use shared (DLL) run-time lib even when Google Test built as a static lib.") +-add_subdirectory(gtest-1.8.0) +-include_directories(SYSTEM gtest-1.8.0/googlemock/include) +-include_directories(SYSTEM gtest-1.8.0/googletest/include) +- +-if(WIN32 AND BUILD_SHARED_LIBS) +- add_definitions("-DGTEST_LINKED_AS_SHARED_LIBRARY") ++include(ExternalProject) ++ ++if(MSVC) ++ # MS Visual Studio expects lib prefix on static libraries, ++ # but CMake compiles them without prefix ++ # See https://gitlab.kitware.com/cmake/cmake/issues/17338 ++ set(CMAKE_STATIC_LIBRARY_PREFIX "") + endif() + ++ExternalProject_Add( ++ googletest_project ++ SOURCE_DIR "${CMAKE_SOURCE_DIR}/test/gtest-1.8.0" ++ INSTALL_DIR "${CMAKE_BINARY_DIR}/prefix" ++ CMAKE_ARGS ++ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> ++ -DBUILD_GMOCK=ON ++ -Dgtest_force_shared_crt=ON ++) ++ ++add_library(gmock UNKNOWN IMPORTED) ++set_target_properties(gmock PROPERTIES ++ IMPORTED_LOCATION ++ ${PROJECT_BINARY_DIR}/prefix/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX} ++) ++ ++find_package(Threads) ++ ++include_directories(SYSTEM "${PROJECT_BINARY_DIR}/prefix/include") ++ + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR +- CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(yaml_test_flags "-Wno-variadic-macros -Wno-sign-compare") +- +- if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(yaml_test_flags "${yaml_test_flags} -Wno-c99-extensions") +- endif() +- +- if(CMAKE_COMPILER_IS_GNUCXX) +- set(yaml_test_flags "${yaml_test_flags} -std=gnu++11") +- else() +- set(yaml_test_flags "${yaml_test_flags} -std=c++11") +- endif() ++ CMAKE_CXX_COMPILER_ID MATCHES "Clang") ++ set(yaml_test_flags "-Wno-variadic-macros -Wno-sign-compare") ++ ++ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") ++ set(yaml_test_flags "${yaml_test_flags} -Wno-c99-extensions") ++ endif() + endif() + + file(GLOB test_headers [a-z_]*.h) +@@ -34,12 +47,18 @@ include_directories(${YAML_CPP_SOURCE_DIR}/src) + include_directories(${YAML_CPP_SOURCE_DIR}/test) + + add_executable(run-tests +- ${test_sources} +- ${test_headers} ++ ${test_sources} ++ ${test_headers} + ) ++ ++add_dependencies(run-tests googletest_project) ++ + set_target_properties(run-tests PROPERTIES +- COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags} ${yaml_test_flags}" ++ COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags} ${yaml_test_flags}" + ) +-target_link_libraries(run-tests yaml-cpp gmock) ++target_link_libraries(run-tests ++ yaml-cpp ++ gmock ++ ${CMAKE_THREAD_LIBS_INIT}) + + add_test(yaml-test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/run-tests) +diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt +index 931884f6..8a803b08 100644 +--- a/util/CMakeLists.txt ++++ b/util/CMakeLists.txt +@@ -3,14 +3,12 @@ cmake_minimum_required(VERSION 3.5) + add_sources(parse.cpp) + add_executable(parse parse.cpp) + target_link_libraries(parse yaml-cpp) +-set_target_properties(parse PROPERTIES COMPILE_FLAGS "-std=c++11") + + add_sources(sandbox.cpp) + add_executable(sandbox sandbox.cpp) + target_link_libraries(sandbox yaml-cpp) +-set_target_properties(sandbox PROPERTIES COMPILE_FLAGS "-std=c++11") + + add_sources(read.cpp) + add_executable(read read.cpp) + target_link_libraries(read yaml-cpp) +-set_target_properties(read PROPERTIES COMPILE_FLAGS "-std=c++11") ++ diff --git a/community/yaml-cpp/APKBUILD b/community/yaml-cpp/APKBUILD index 23c69c1aa8..b3f5aa0b8b 100644 --- a/community/yaml-cpp/APKBUILD +++ b/community/yaml-cpp/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=yaml-cpp pkgver=0.6.2 -pkgrel=1 +pkgrel=2 pkgdesc="YAML parser and emitter in C++ matching YAML 1.2 spec" url="https://github.com/jbeder/yaml-cpp" arch="all" @@ -10,7 +10,8 @@ license="MIT" depends="" makedepends="cmake" subpackages="$pkgname-dev" -source="https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-$pkgver.tar.gz" +source="https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-$pkgver.tar.gz + 3e33bb316651981916d623488caf2f8ee1b79b50.patch" builddir="$srcdir/$pkgname-$pkgname-$pkgver" build() { @@ -32,4 +33,5 @@ package() { make DESTDIR="$pkgdir" install } -sha512sums="fea8ce0a20a00cbc75023d1db442edfcd32d0ac57a3c41b32ec8d56f87cc1d85d7dd7a923ce662f5d3a315f91a736d6be0d649997acd190915c1d68cc93795e4 yaml-cpp-0.6.2.tar.gz" +sha512sums="fea8ce0a20a00cbc75023d1db442edfcd32d0ac57a3c41b32ec8d56f87cc1d85d7dd7a923ce662f5d3a315f91a736d6be0d649997acd190915c1d68cc93795e4 yaml-cpp-0.6.2.tar.gz +1724ba4be7b28415824b8f11ea46fd4fab076f4672927f7263303963812c36f48ed32f83647066bc3d3d08607bf63a9de15d834c7a29a6d2708cdf5f58aaaaa5 3e33bb316651981916d623488caf2f8ee1b79b50.patch" |