From 6989f25460bd1948f62fa8316a9ca3971be64908 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Sun, 20 Nov 2022 13:19:04 +0100 Subject: [PATCH 1/2] cpp-hocon: build shared library, disable tests tests do not build with gcc 12 --- common/shlibs | 1 + srcpkgs/cpp-hocon-devel | 1 + .../patches/disable-building-tests.patch | 8 ++++++++ srcpkgs/cpp-hocon/template | 17 ++++++++++------- 4 files changed, 20 insertions(+), 7 deletions(-) create mode 120000 srcpkgs/cpp-hocon-devel create mode 100644 srcpkgs/cpp-hocon/patches/disable-building-tests.patch diff --git a/common/shlibs b/common/shlibs index 3da9f38d56a0..8fd417267d4d 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4205,3 +4205,4 @@ libtraceevent.so.1 libtraceevent-1.6.2_1 libtracefs.so.1 libtracefs-1.4.2_1 libtracecmd.so.1 libtracecmd-3.1.2_1 libkshark.so.2 libkshark-2.1.1_1 +libcpp-hocon.so.0.3.0 cpp-hocon-0.3.0_5 diff --git a/srcpkgs/cpp-hocon-devel b/srcpkgs/cpp-hocon-devel new file mode 120000 index 000000000000..8d8bc1453e86 --- /dev/null +++ b/srcpkgs/cpp-hocon-devel @@ -0,0 +1 @@ +cpp-hocon \ No newline at end of file diff --git a/srcpkgs/cpp-hocon/patches/disable-building-tests.patch b/srcpkgs/cpp-hocon/patches/disable-building-tests.patch new file mode 100644 index 000000000000..27db097479c7 --- /dev/null +++ b/srcpkgs/cpp-hocon/patches/disable-building-tests.patch @@ -0,0 +1,8 @@ +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -90,5 +90,3 @@ 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) +- +-add_subdirectory(tests) diff --git a/srcpkgs/cpp-hocon/template b/srcpkgs/cpp-hocon/template index f61316adcc11..ce521b1395ae 100644 --- a/srcpkgs/cpp-hocon/template +++ b/srcpkgs/cpp-hocon/template @@ -1,20 +1,23 @@ # Template file for 'cpp-hocon' pkgname=cpp-hocon version=0.3.0 -revision=4 +revision=5 build_style=cmake +configure_args="-DBUILD_SHARED_LIBS=ON" hostmakedepends="pkg-config" makedepends="boost-devel leatherman-devel libcurl-devel" short_desc="C++ port of the Typesafe Config library" maintainer="Orphaned " license="Apache-2.0" homepage="https://github.com/puppetlabs/cpp-hocon/" -distfiles="https://github.com/puppetlabs/cpp-hocon/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz" +distfiles="https://github.com/puppetlabs/cpp-hocon/archive/${version}.tar.gz" checksum=dab02354046f05aca6275c746d7583ee5f71853aa5b1d93529564632e184c3dd -post_install() { - # this package is a static library, - # needs to be rebuild when update boost, - # force an shlib-dependencies - vbin build/bin/libcpp-hocon_test +cpp-hocon-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + } } From 2093b3e1fdfe623d4606cf8a3c3fded53bc91bda Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Sun, 20 Nov 2022 13:35:34 +0100 Subject: [PATCH 2/2] facter: use shared cpp-hocon --- srcpkgs/facter/patches/shared_cpp_hcon.patch | 13 +++++++++++++ srcpkgs/facter/template | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/facter/patches/shared_cpp_hcon.patch diff --git a/srcpkgs/facter/patches/shared_cpp_hcon.patch b/srcpkgs/facter/patches/shared_cpp_hcon.patch new file mode 100644 index 000000000000..37c475697a96 --- /dev/null +++ b/srcpkgs/facter/patches/shared_cpp_hcon.patch @@ -0,0 +1,13 @@ +https://github.com/archlinux/svntogit-community/blob/0eb74a76c976a7fd638fbf6cd1c3b47be3dccd8b/trunk/shared_cpp_hcon.patch + +diff --git a/cmake/FindCPPHOCON.cmake b/cmake/FindCPPHOCON.cmake +index 00ba8bd..0df0a51 100644 +--- a/cmake/FindCPPHOCON.cmake ++++ b/cmake/FindCPPHOCON.cmake +@@ -1,5 +1,5 @@ + include(FindDependency) +-find_dependency(CPPHOCON DISPLAY "cpp-hocon" HEADERS "hocon/config.hpp" LIBRARIES "libcpp-hocon.a") ++find_dependency(CPPHOCON DISPLAY "cpp-hocon" HEADERS "hocon/config.hpp" LIBRARIES "libcpp-hocon.so") + + include(FeatureSummary) + set_package_properties(CPPHOCON PROPERTIES DESCRIPTION "A C++ parser for the HOCON configuration language" URL "https://github.com/puppetlabs/cpp-hocon") diff --git a/srcpkgs/facter/template b/srcpkgs/facter/template index 45c921a0b72d..f92ea61d20ce 100644 --- a/srcpkgs/facter/template +++ b/srcpkgs/facter/template @@ -1,12 +1,12 @@ # Template file for 'facter' pkgname=facter version=3.14.16 -revision=4 +revision=5 build_style=cmake configure_args="-DRUBY_CONFIG_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include -DENABLE_CXX_WERROR=OFF -DCMAKE_INSTALL_LIBDIR=/usr/lib" hostmakedepends="ruby-devel" -makedepends="boost-devel cpp-hocon leatherman-devel libblkid-devel libcurl-devel +makedepends="boost-devel cpp-hocon-devel leatherman-devel libblkid-devel libcurl-devel ruby-devel yaml-cpp-devel" depends="net-tools ruby" short_desc="Collect and display system facts" @@ -18,13 +18,13 @@ checksum=196c69b1ae325dbf11f68025eb12b9c53c054bee9112bd4f3e2ece8c5fe76571 pre_configure() { case "$XBPS_TARGET_MACHINE" in - mips*) sed -i lib/CMakeLists.txt -e'/add_subdirectory(tests)/d' ;; + mips*) vsed -i lib/CMakeLists.txt -e'/add_subdirectory(tests)/d' ;; esac } post_build() { # fixup vendor_ruby usr/lib{32,64} install path to always use usr/lib - vsed -i build/lib/cmake_install.cmake -e "s;lib32;lib;g" -e "s;lib64;lib;g" + vsed -i build/lib/cmake_install.cmake -e "s;lib\(32\|64\);lib;g" } facter-devel_package() {