public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-cpp/cpp-hocon/, dev-cpp/cpp-hocon/files/
@ 2019-12-15 22:06 David Seifert
  0 siblings, 0 replies; 2+ messages in thread
From: David Seifert @ 2019-12-15 22:06 UTC (permalink / raw
  To: gentoo-commits

commit:     1ae54f598de9d3c565ef7bf50b098f0c62f7e6b5
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 15 22:06:29 2019 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Dec 15 22:06:29 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ae54f59

dev-cpp/cpp-hocon: [QA] Fix ebuild

* EAPI 7
* Use GNUInstallDirs
* Remove dead variables

Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 dev-cpp/cpp-hocon/cpp-hocon-0.2.1.ebuild           | 31 ++------------
 .../cpp-hocon/files/cpp-hocon-0.2.1-cmake.patch    | 48 ++++++++++++++++++++++
 2 files changed, 52 insertions(+), 27 deletions(-)

diff --git a/dev-cpp/cpp-hocon/cpp-hocon-0.2.1.ebuild b/dev-cpp/cpp-hocon/cpp-hocon-0.2.1.ebuild
index 45f62697011..a7c2624ff27 100644
--- a/dev-cpp/cpp-hocon/cpp-hocon-0.2.1.ebuild
+++ b/dev-cpp/cpp-hocon/cpp-hocon-0.2.1.ebuild
@@ -1,7 +1,7 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
 inherit cmake-utils
 
@@ -11,37 +11,14 @@ SRC_URI="https://github.com/puppetlabs/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
 		https://github.com/puppetlabs/cpp-hocon/commit/caab275509826dc5fe5ab2632582abb8f83ea2b3.patch -> ${PN}-0.2.1-boost-filesystem.patch"
 
 LICENSE="Apache-2.0"
-SLOT="0"
+SLOT="0/${PV}"
 KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86"
-IUSE="debug test"
-RESTRICT="!test? ( test )"
+IUSE="debug"
 
 DEPEND="
-	>=sys-devel/gcc-4.9.3:*
 	>=dev-libs/boost-1.54:=[nls]
 	>=dev-libs/leatherman-0.9.3:=
 	"
 RDEPEND="${DEPEND}"
 
-src_prepare() {
-	cmake-utils_src_prepare
-	epatch "${DISTDIR}/${PN}-0.2.1-boost-filesystem.patch"
-
-	# make it support multilib
-	sed -i "s/\ lib)/\ $(get_libdir))/g" lib/CMakeLists.txt || die
-	sed -i "s/lib\")/$(get_libdir)\")/g" CMakeLists.txt || die
-}
-
-src_configure() {
-	local mycmakeargs=(
-		-DCMAKE_VERBOSE_MAKEFILE=ON
-		-DCMAKE_BUILD_TYPE=None
-		-DCMAKE_INSTALL_PREFIX=/usr
-	)
-	if use debug; then
-		mycmakeargs+=(
-			-DCMAKE_BUILD_TYPE=Debug
-		)
-	fi
-	cmake-utils_src_configure
-}
+PATCHES=( "${FILESDIR}"/${PN}-0.2.1-cmake.patch )

diff --git a/dev-cpp/cpp-hocon/files/cpp-hocon-0.2.1-cmake.patch b/dev-cpp/cpp-hocon/files/cpp-hocon-0.2.1-cmake.patch
new file mode 100644
index 00000000000..8e0ddb924a4
--- /dev/null
+++ b/dev-cpp/cpp-hocon/files/cpp-hocon-0.2.1-cmake.patch
@@ -0,0 +1,48 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -10,6 +10,8 @@
+ string(TOUPPER ${PROJECT_C_NAME} PROJECT_NAME_UPPER)
+ string(TOLOWER ${PROJECT_C_NAME} PROJECT_NAME_LOWER)
+ 
++include(GNUInstallDirs)
++
+ # Common cmake setup
+ if (NOT CMAKE_BUILD_TYPE)
+     message(STATUS "Defaulting to a release build.")
+@@ -42,7 +44,7 @@
+     set(BOOST_COMPONENTS regex)
+ endif()
+ 
+-list(APPEND BOOST_COMPONENTS thread date_time chrono system program_options)
++list(APPEND BOOST_COMPONENTS thread date_time chrono filesystem system program_options)
+ 
+ # Add other dependencies
+ find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -77,7 +77,10 @@
+ set_target_properties(libprojectsrc PROPERTIES POSITION_INDEPENDENT_CODE true)
+ 
+ add_library(lib${PROJECT_NAME} $<TARGET_OBJECTS:libprojectsrc>)
+-set_target_properties(lib${PROJECT_NAME} PROPERTIES VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
++set_target_properties(
++    lib${PROJECT_NAME}
++    PROPERTIES VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
++    OUTPUT_NAME ${PROJECT_NAME})
+ target_link_libraries(lib${PROJECT_NAME}
+     ${LEATHERMAN_LIBRARIES}
+     ${Boost_LIBRARIES}
+@@ -88,7 +91,11 @@
+ symbol_exports(lib${PROJECT_NAME} "${CMAKE_CURRENT_LIST_DIR}/inc/hocon/export.h")
+ 
+ # This correctly handles DLL installation on Windows.
+-leatherman_install(lib${PROJECT_NAME})
+-install(DIRECTORY inc/hocon DESTINATION include)
++install(
++    TARGETS lib${PROJECT_NAME}
++    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
++install(DIRECTORY inc/hocon DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ add_subdirectory(tests)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-cpp/cpp-hocon/, dev-cpp/cpp-hocon/files/
@ 2021-12-29  0:15 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2021-12-29  0:15 UTC (permalink / raw
  To: gentoo-commits

commit:     28d0fbda2fdecaddf99a2201214c7ba19926fdb8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 29 00:12:25 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 29 00:15:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28d0fbda

dev-cpp/cpp-hocon: fix build with glibc-2.34, conditionally build tests

Closes: https://bugs.gentoo.org/823419
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-cpp/cpp-hocon/cpp-hocon-0.3.0-r1.ebuild        | 40 +++++++++++++++++
 .../files/cpp-hocon-0.3.0-use-system-catch.patch   | 51 ++++++++++++++++++++++
 2 files changed, 91 insertions(+)

diff --git a/dev-cpp/cpp-hocon/cpp-hocon-0.3.0-r1.ebuild b/dev-cpp/cpp-hocon/cpp-hocon-0.3.0-r1.ebuild
new file mode 100644
index 000000000000..d1dccdfe8426
--- /dev/null
+++ b/dev-cpp/cpp-hocon/cpp-hocon-0.3.0-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake prefix
+
+DESCRIPTION="Provides C++ support for the HOCON configuration file format"
+HOMEPAGE="https://github.com/puppetlabs/cpp-hocon"
+SRC_URI="https://github.com/puppetlabs/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm ~ppc64 ~x86"
+IUSE="debug test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=dev-libs/boost-1.54:=[nls]
+	>=dev-libs/leatherman-0.9.3:=
+"
+DEPEND="${DEPEND}
+	test? ( dev-cpp/catch:1 )"
+
+#PATCHES=( "${FILESDIR}"/${PN}-0.2.1-cmake.patch )
+PATCHES=( "${FILESDIR}"/${PN}-0.3.0-use-system-catch.patch )
+
+src_prepare() {
+	cmake_src_prepare
+
+	eprefixify lib/tests/CMakeLists.txt
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DBUILD_TESTING=$(usex test)
+	)
+
+	cmake_src_configure
+}

diff --git a/dev-cpp/cpp-hocon/files/cpp-hocon-0.3.0-use-system-catch.patch b/dev-cpp/cpp-hocon/files/cpp-hocon-0.3.0-use-system-catch.patch
new file mode 100644
index 000000000000..0964e3e7bc7a
--- /dev/null
+++ b/dev-cpp/cpp-hocon/files/cpp-hocon-0.3.0-use-system-catch.patch
@@ -0,0 +1,51 @@
+https://bugs.gentoo.org/823419
+
+Wanted to make this "proper" but Catch2 lacks a pkgconfig file (or a CMake one)
+and it's easier to just do this for now.
+
+Based on patch version of sed commands from upstream bug
+(https://github.com/puppetlabs/cpp-hocon/issues/132) and
+Fedora (https://src.fedoraproject.org/rpms/cpp-hocon/blob/rawhide/f/cpp-hocon.spec#_76).
+
+Makes tests conditional too.
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -16,12 +16,16 @@ if (NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
+ endif()
+ 
+-enable_testing()
+-
+ # Leatherman setup
+-set(LEATHERMAN_COMPONENTS locale catch nowide util)
++set(LEATHERMAN_COMPONENTS locale nowide util)
+ find_package(Leatherman REQUIRED COMPONENTS ${LEATHERMAN_COMPONENTS})
+ 
++option(BUILD_TESTING "Build test suite (needs Catch)" ON)
++
++if(BUILD_TESTING)
++    enable_testing()
++endif()
++
+ ## Before we find any packages, we want to pull in the common leatherman options, as they can affect commonly-used packages.
+ include(options)
+ ## Pull in common cflags setting from leatherman. Don't override CMAKE_CXX_FLAGS at the project root to avoid impacting 3rd party code.
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -91,4 +91,6 @@ symbol_exports(lib${PROJECT_NAME} "${CMAKE_CURRENT_LIST_DIR}/inc/hocon/export.h"
+ leatherman_install(lib${PROJECT_NAME})
+ install(DIRECTORY inc/hocon DESTINATION include)
+ 
+-add_subdirectory(tests)
++if (BUILD_TESTING)
++    add_subdirectory(tests)
++endif()
+--- a/lib/tests/CMakeLists.txt
++++ b/lib/tests/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ # Setup compiling the test executable. C++ compile flags are inherited from the parent directory.
+-include_directories(${LEATHERMAN_CATCH_INCLUDE})
++include_directories(@GENTOO_PORTAGE_EPREFIX@/usr/include/catch)
+ 
+ set(TEST_CASES
+     concatenation_test.cc


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-29  0:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-15 22:06 [gentoo-commits] repo/gentoo:master commit in: dev-cpp/cpp-hocon/, dev-cpp/cpp-hocon/files/ David Seifert
  -- strict thread matches above, loose matches on Subject: below --
2021-12-29  0:15 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox