aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2024-11-17 05:43:07 +0300
committerAlexander Golubev <fatzer2@gmail.com>2024-11-17 05:49:18 +0300
commite3142a3d6556677a2a46bc7cd36e27ae71258580 (patch)
treefb4683fcf22c876cf7d8ad4c5aa56194cf14465b /dev-libs
parentnet-proxy/snowflake: add 2.10.1, drop 2.8.1 (diff)
downloadguru-e3142a3d6556677a2a46bc7cd36e27ae71258580.tar.gz
guru-e3142a3d6556677a2a46bc7cd36e27ae71258580.tar.bz2
guru-e3142a3d6556677a2a46bc7cd36e27ae71258580.zip
dev-libs/properties-cpp: ebuild maintanence
- fix tests - add missing doc dependency - remove -Werror from C/CXXFLAGS - fix incorrect version in pkg-config file - change include installation directory to not clutter /usr/include Closes: https://bugs.gentoo.org/887449 Closes: https://bugs.gentoo.org/884583 Closes: https://bugs.gentoo.org/859766 Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/properties-cpp/files/properties-cpp-0.0.2-cmake-patch.patch166
-rw-r--r--dev-libs/properties-cpp/properties-cpp-0.0.2-r1.ebuild36
-rw-r--r--dev-libs/properties-cpp/properties-cpp-0.0.2.ebuild40
3 files changed, 202 insertions, 40 deletions
diff --git a/dev-libs/properties-cpp/files/properties-cpp-0.0.2-cmake-patch.patch b/dev-libs/properties-cpp/files/properties-cpp-0.0.2-cmake-patch.patch
new file mode 100644
index 000000000..1d908e233
--- /dev/null
+++ b/dev-libs/properties-cpp/files/properties-cpp-0.0.2-cmake-patch.patch
@@ -0,0 +1,166 @@
+A lot of changes to cmake:
+ - bump cmake_minimum_required to 3.5 to avoid cmake's warnings about obsolete version
+ - avoid adding -Werror to C/XXFLAGS (it didn't actually get anywhere beside the tests)
+ - remove bundeled FindGtest in favour of use of a config file provided by GTest itself
+ - bumb CMAKE_CXX_STANDARD to 14 to apace modern GTest
+ - bump version number to 0.0.2 to match tarball
+ - change include instalation directrory to [/usr]/inclyde/properties-cpp/ to not clutter
+ the root include dir
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0c7394e..6d08f34 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 2.8)
++cmake_minimum_required(VERSION 3.5)
+
+ project(properties-cpp)
+
+@@ -8,9 +8,10 @@ include(cmake/EnableCoverageReport.cmake)
+ include(cmake/PrePush.cmake)
+ include(GNUInstallDirs)
+
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -pedantic -Wextra -fPIC -fvisibility=hidden -pthread")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror -Wall -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -pedantic -Wextra -fPIC -pthread")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wextra -fPIC -fvisibility=hidden -pthread")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -pedantic -Wextra -fPIC -pthread")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
++set(CMAKE_CXX_STANDARD 14)
+
+ #####################################################################
+ # Enable code coverage calculation with gcov/gcovr/lcov
+@@ -29,7 +30,7 @@ ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
+
+ set(PROPERTIES_CPP_VERSION_MAJOR 0)
+ set(PROPERTIES_CPP_VERSION_MINOR 0)
+-set(PROPERTIES_CPP_VERSION_PATCH 1)
++set(PROPERTIES_CPP_VERSION_PATCH 2)
+
+ include(CTest)
+
+diff --git a/cmake/FindGtest.cmake b/cmake/FindGtest.cmake
+deleted file mode 100644
+index 1283174..0000000
+--- a/cmake/FindGtest.cmake
++++ /dev/null
+@@ -1,53 +0,0 @@
+-include(ExternalProject)
+-include(FindPackageHandleStandardArgs)
+-
+-#gtest
+-set(GTEST_INSTALL_DIR /usr/src/gmock/gtest/include)
+-find_path(GTEST_INCLUDE_DIR gtest/gtest.h
+- HINTS ${GTEST_INSTALL_DIR})
+-
+-#gmock
+-find_path(GMOCK_INSTALL_DIR gmock/CMakeLists.txt
+- HINTS /usr/src)
+-if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")
+- message(FATAL_ERROR "google-mock package not found")
+-endif()
+-
+-set(GMOCK_INSTALL_DIR ${GMOCK_INSTALL_DIR}/gmock)
+-find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
+-
+-set(GMOCK_PREFIX gmock)
+-set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs)
+-set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
+-
+-set(GTEST_CMAKE_ARGS "")
+-if (${MIR_IS_CROSS_COMPILING})
+- set(GTEST_CMAKE_ARGS
+- -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
+-endif()
+-
+-ExternalProject_Add(
+- GMock
+- #where to build in source tree
+- PREFIX ${GMOCK_PREFIX}
+- #where the source is external to the project
+- SOURCE_DIR ${GMOCK_INSTALL_DIR}
+- #forward the compilers to the subproject so cross-arch builds work
+- CMAKE_ARGS ${GTEST_CMAKE_ARGS}
+- BINARY_DIR ${GMOCK_BINARY_DIR}
+-
+- #we don't need to install, so skip
+- INSTALL_COMMAND ""
+-)
+-
+-set(GMOCK_LIBRARY ${GMOCK_BINARY_DIR}/libgmock.a)
+-set(GMOCK_MAIN_LIBRARY ${GMOCK_BINARY_DIR}/libgmock_main.a)
+-set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY})
+-set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
+-set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
+-set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
+-set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
+-
+-find_package_handle_standard_args(GTest DEFAULT_MSG
+- GMOCK_INCLUDE_DIR
+- GTEST_INCLUDE_DIR)
+diff --git a/cmake/PrePush.cmake b/cmake/PrePush.cmake
+index aba8823..5f7949b 100644
+--- a/cmake/PrePush.cmake
++++ b/cmake/PrePush.cmake
+@@ -79,4 +79,4 @@ add_custom_target(
+ add_dependencies(extract-pre-push-tarball pre-push-source-tarball)
+ add_dependencies(pdebuild extract-pre-push-tarball)
+
+-add_dependencies(pre-push pdebuild android-build)
++#add_dependencies(pre-push pdebuild android-build)
+diff --git a/data/properties-cpp.pc.in b/data/properties-cpp.pc.in
+index da8c36d..db730c9 100644
+--- a/data/properties-cpp.pc.in
++++ b/data/properties-cpp.pc.in
+@@ -1,7 +1,7 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/lib
+-includedir=${exec_prefix}/include
++includedir=${exec_prefix}/include/@CMAKE_PROJECT_NAME@
+
+ Name: @CMAKE_PROJECT_NAME@
+ Description: A very simple convenience library for handling properties and signals in C++11.
+diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
+index 3a45575..bf9663c 100644
+--- a/include/CMakeLists.txt
++++ b/include/CMakeLists.txt
+@@ -1,4 +1,4 @@
+ install(
+ DIRECTORY core
+- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/
++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}
+ )
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 180498f..9303983 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,11 +1,4 @@
+-set (OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+-# Don't treat warnings as errors in 3rd_party/{gmock,cucumber-cpp}
+-string (REPLACE " -Werror " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+-find_package(Gtest REQUIRED)
+-include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
+-set (CMAKE_CXX_FLAGS ${OLD_CMAKE_CXX_FLAGS})
+-
+-include_directories(${GTEST_INCLUDE_DIRS})
++find_package(GTest REQUIRED)
+
+ add_executable(
+ properties_test
+@@ -20,13 +13,13 @@ add_executable(
+ target_link_libraries(
+ properties_test
+
+- ${GTEST_BOTH_LIBRARIES}
++ GTest::gtest GTest::gmock GTest::gtest_main
+ )
+
+ target_link_libraries(
+ signals_test
+
+- ${GTEST_BOTH_LIBRARIES}
++ GTest::gtest GTest::gmock GTest::gtest_main
+ )
+
+ add_test(properties_test ${CMAKE_CURRENT_BINARY_DIR}/properties_test)
diff --git a/dev-libs/properties-cpp/properties-cpp-0.0.2-r1.ebuild b/dev-libs/properties-cpp/properties-cpp-0.0.2-r1.ebuild
new file mode 100644
index 000000000..e73367668
--- /dev/null
+++ b/dev-libs/properties-cpp/properties-cpp-0.0.2-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="Simple convenience library for handling properties and signals in C++11"
+HOMEPAGE="https://launchpad.net/properties-cpp"
+SRC_URI="https://launchpad.net/ubuntu/+archive/primary/+files/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="doc test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ dev-libs/boost
+ doc? (
+ app-text/doxygen
+ media-gfx/graphviz
+ )
+ test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+ "${FILESDIR}/properties-cpp-0.0.2-cmake-patch.patch"
+)
+
+src_prepare() {
+ use doc || truncate -s0 doc/CMakeLists.txt || die
+ use test || truncate -s0 tests/CMakeLists.txt || die
+
+ cmake_src_prepare
+}
diff --git a/dev-libs/properties-cpp/properties-cpp-0.0.2.ebuild b/dev-libs/properties-cpp/properties-cpp-0.0.2.ebuild
deleted file mode 100644
index 3013ef07d..000000000
--- a/dev-libs/properties-cpp/properties-cpp-0.0.2.ebuild
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-URELEASE="groovy"
-inherit cmake
-
-# Handle version strings here so as not to use 'ubuntu-versionator' eclass #
-MY_PV="${PV:0:5}"
-MY_P="${PN}-${MY_PV}"
-UVER="-${PVR_PL_MINOR}"
-
-DESCRIPTION="Simple convenience library for handling properties and signals in C++11"
-HOMEPAGE="https://launchpad.net/properties-cpp"
-SRC_URI="https://launchpad.net/ubuntu/+archive/primary/+files/${PN}_${MY_PV}.orig.tar.gz"
-
-S="${WORKDIR}/${MY_P}"
-
-LICENSE="LGPL-3"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~x86"
-IUSE="doc"
-RESTRICT="mirror"
-
-DEPEND="
- dev-libs/boost
- doc? ( app-text/doxygen )
-"
-
-MAKEOPTS="${MAKEOPTS} -j1"
-
-src_prepare() {
- use !doc && truncate -s0 doc/CMakeLists.txt
-
- #Remove the test from the build
- truncate -s0 tests/CMakeLists.txt
-
- cmake_src_prepare
-}