Date: Friday, July 16, 2021 @ 07:43:50 Author: bastelfreak Revision: 977577
archrelease: copy trunk to community-testing-x86_64 Added: facter/repos/community-testing-x86_64/ facter/repos/community-testing-x86_64/FindRuby-2.7.patch (from rev 977576, facter/trunk/FindRuby-2.7.patch) facter/repos/community-testing-x86_64/PKGBUILD (from rev 977576, facter/trunk/PKGBUILD) facter/repos/community-testing-x86_64/fix-shared-libwhereami-detection.patch (from rev 977576, facter/trunk/fix-shared-libwhereami-detection.patch) facter/repos/community-testing-x86_64/rapidjson-1.1-compat.patch (from rev 977576, facter/trunk/rapidjson-1.1-compat.patch) facter/repos/community-testing-x86_64/shared_cpp_hcon.patch (from rev 977576, facter/trunk/shared_cpp_hcon.patch) facter/repos/community-testing-x86_64/workaround-broken-double-test.patch (from rev 977576, facter/trunk/workaround-broken-double-test.patch) ----------------------------------------+ FindRuby-2.7.patch | 13 +++ PKGBUILD | 102 +++++++++++++++++++++++++++++++ fix-shared-libwhereami-detection.patch | 13 +++ rapidjson-1.1-compat.patch | 60 ++++++++++++++++++ shared_cpp_hcon.patch | 11 +++ workaround-broken-double-test.patch | 16 ++++ 6 files changed, 215 insertions(+) Copied: facter/repos/community-testing-x86_64/FindRuby-2.7.patch (from rev 977576, facter/trunk/FindRuby-2.7.patch) =================================================================== --- community-testing-x86_64/FindRuby-2.7.patch (rev 0) +++ community-testing-x86_64/FindRuby-2.7.patch 2021-07-16 07:43:50 UTC (rev 977577) @@ -0,0 +1,13 @@ +diff --git a/cmake/FindRuby.cmake b/cmake/FindRuby.cmake +index 4f57d619e..075ab52fe 100644 +--- a/cmake/FindRuby.cmake ++++ b/cmake/FindRuby.cmake +@@ -55,7 +55,7 @@ + + # Determine the list of possible names of the ruby executable depending + # on which version of ruby is required +-set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby) ++set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby-2.7) + + # if 1.9 is required, don't look for ruby18 and ruby1.8, default to version 1.8 + if(DEFINED Ruby_FIND_VERSION_MAJOR AND DEFINED Ruby_FIND_VERSION_MINOR) Copied: facter/repos/community-testing-x86_64/PKGBUILD (from rev 977576, facter/trunk/PKGBUILD) =================================================================== --- community-testing-x86_64/PKGBUILD (rev 0) +++ community-testing-x86_64/PKGBUILD 2021-07-16 07:43:50 UTC (rev 977577) @@ -0,0 +1,102 @@ +# Maintainer: Thore Bödecker <fox...@archlinux.org> +# Maintainer: Tim Meusel <t...@bastelfreak.de> +# Contributor: Christian Rebischke <chris.rebischke at archlinux.org> +# Contributor: Jonathan Steel <jsteel at archlinux.org> +# Contributor: Greg Sutcliffe <facter_aur (at) emeraldreverie.orgr> +# Contributor: Hyacinthe Cartiaux <hyacinthe.carti...@free.fr> +# Contributor: Thomas S Hatch <thatch45 (at) Gmail.com> +# Contributor: Dave Simons <miouhpi (at) Gmail (dot) com> +# Contributor: Niels Abspoel <aboe76 (at) Gmail (dot) com> + +pkgname=facter +pkgver=3.14.16 +pkgrel=5 +pkgdesc="Collect and display system facts" +arch=('x86_64') +url="https://puppetlabs.com/facter" +license=('APACHE') +depends=('yaml-cpp' 'boost-libs' 'curl' 'libwhereami' 'libwhereami.so' 'cpp-hocon' 'libcpp-hocon.so' + 'systemd-libs' 'leatherman' 'leatherman_curl.so' 'leatherman_ruby.so' 'leatherman_execution.so' + 'leatherman_file_util.so' 'leatherman_util.so' 'leatherman_logging.so' 'leatherman_locale.so' + 'openssl' 'gcc-libs' 'glibc' 'util-linux-libs' 'ruby2.7' 'libblkid.so' 'yaml-cpp') +makedepends=('boost' 'cmake' 'java-environment>=10' 'python' 'rapidjson') +checkdepends=('ruby27-rake' 'ruby27-diff-lcs' 'ruby27-mocha' 'ruby27-rspec-support' + 'ruby27-rspec-core' 'ruby27-rspec-expectations' 'ruby27-rspec-mocks' + 'ruby27-rspec') +optdepends=('java-runtime>=8: jruby support' + 'puppet: retrieve puppet facts') +replaces=('cfacter') +provides=('libfacter.so') +source=("https://downloads.puppet.com/facter/facter-${pkgver}.tar.gz"{,.asc} + 'fix-shared-libwhereami-detection.patch' + 'shared_cpp_hcon.patch' + 'rapidjson-1.1-compat.patch' + 'workaround-broken-double-test.patch' + 'FindRuby-2.7.patch') +validpgpkeys=('D6811ED3ADEEB8441AF5AA8F4528B6CD9E61EF26') # "Puppet, Inc. Release Key (Puppet, Inc. Release Key) <rele...@puppet.com>" +sha512sums=('d17102d331a2bf71f38ecd295617a2f51f2f26b5a18a3b161a5588601065430db570b681c65af4b7aff75e17c80c8025da4817024cdc850fb6a89398f690d5ef' + 'SKIP' + '1f5d2595cd6b2a63fc01c92c84eccf8f92bd9e9f0721ea1a3f59836d7d02f5ec6e6e3711b223b240d46ca55f7377f27339b7458c12d6c21564a2764c76df12b2' + '15fdfb75bb1045e160c095b62025f10d0a04c167223340072a9b8d065a2a185e942d299f86c80449661f37be5e1807efb49e77def44b8de4a9a9f7c2cc111e1a' + 'a1fb08be2c6c9b2a4085404f1d13b13c9d41e3c1a38d35cbad1d29bbd497380492dab368a0fa7288d141f7f94ff7a7a0ae5ce271119e7074e039868682cc766f' + '335c6db6a4953cf3678877ba81506c475d93f461ec2ee75c22fba4a3f938db0bca7f6cf3ee0376eb4c34b43f1f3fb1a35a0a0e64be5a484c344bd689641ddc2b' + '84d6f0ac1f4a47269d3e9bb75036b0cf15ce8624ab293355795e8318be4248958a927d31bba182e064fca581edd4ea1e4f1399c77612a9ce6d98c1ec6c06ebeb') + +prepare() { + cd "${srcdir}/${pkgname}-${pkgver}" + + # Puppet builds Facter in a way that the java library is compatible with Java 6 + # We require at least Java 8. 7 technically works, but already throws a deprecation warning + sed --in-place 's/-source 1.6 -target 1.6/-source 1.8 -target 1.8/' CMakeLists.txt + + # https://tickets.puppetlabs.com/browse/FACT-1968 + # facter is designed for ruby 2.4, which uses rb_data_object_alloc. + # This is deprecated in our Ruby 2.6 version + sed --in-place 's/rb_data_object_alloc/rb_data_object_wrap/g' lib/src/ruby/*.cc + + # strip version boundary of gems + sed -i -r 's|(gem .\w+.).*|\1|' lib/Gemfile + + # patch *.cmake so that it works with shared libs + patch -p1 -N -i "${srcdir}/fix-shared-libwhereami-detection.patch" + patch -p1 -N -i "${srcdir}/shared_cpp_hcon.patch" + patch -p1 -N -i "${srcdir}/rapidjson-1.1-compat.patch" + + patch -p1 -N -i "${srcdir}/workaround-broken-double-test.patch" + # build against Ruby-2.7 and not Ruby + patch -p1 -N -i "${srcdir}/FindRuby-2.7.patch" +} + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + + export JAVA_HOME=/usr/lib/jvm/default + cmake \ + -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr \ + -DENABLE_CXX_WERROR=OFF \ + -DBUILD_SHARED_LIBS=ON + make -C build +} + +check(){ + cd "${srcdir}/${pkgname}-${pkgver}/build" + make test +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + + local _gemdir="$(gem-2.7 env gemdir)" + + make -C build DESTDIR="${pkgdir}" install + + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + # install the gemspec file + # this allows other gems to load puppet as a library (for example puppet-strings) + install -Dm644 .gemspec "${pkgdir}/${_gemdir}/specifications/${pkgname}-${pkgver}.gemspec" +} + +# vim: ts=2 sw=2 et: Copied: facter/repos/community-testing-x86_64/fix-shared-libwhereami-detection.patch (from rev 977576, facter/trunk/fix-shared-libwhereami-detection.patch) =================================================================== --- community-testing-x86_64/fix-shared-libwhereami-detection.patch (rev 0) +++ community-testing-x86_64/fix-shared-libwhereami-detection.patch 2021-07-16 07:43:50 UTC (rev 977577) @@ -0,0 +1,13 @@ +diff -upr a/cmake/FindWHEREAMI.cmake b/cmake/FindWHEREAMI.cmake +--- a/cmake/FindWHEREAMI.cmake 2019-07-19 10:11:10.000000000 +0200 ++++ b/cmake/FindWHEREAMI.cmake 2019-08-12 14:49:04.730902701 +0200 +@@ -1,6 +1,6 @@ + include(FindDependency) +-find_dependency(WHEREAMI DISPLAY "whereami" HEADERS "whereami/whereami.hpp" LIBRARIES "libwhereami.a") ++find_dependency(WHEREAMI DISPLAY "whereami" HEADERS "whereami/whereami.hpp" LIBRARIES "libwhereami.so") + + include(FeatureSummary) + set_package_properties(WHEREAMI PROPERTIES DESCRIPTION "A hypervisor detection library" URL "https://github.com/puppetlabs/libwhereami") +-set_package_properties(WHEREAMI PROPERTIES PURPOSE "Reports hypervisors in use.") +\ No newline at end of file ++set_package_properties(WHEREAMI PROPERTIES PURPOSE "Reports hypervisors in use.") Copied: facter/repos/community-testing-x86_64/rapidjson-1.1-compat.patch (from rev 977576, facter/trunk/rapidjson-1.1-compat.patch) =================================================================== --- community-testing-x86_64/rapidjson-1.1-compat.patch (rev 0) +++ community-testing-x86_64/rapidjson-1.1-compat.patch 2021-07-16 07:43:50 UTC (rev 977577) @@ -0,0 +1,60 @@ +From 7a1c680a2b140e2bab7d1b8a85b3dc97c8a131ba Mon Sep 17 00:00:00 2001 +From: Apollon Oikonomopoulos <apol...@skroutz.gr> +Date: Mon, 19 Mar 2018 14:21:22 +0200 +Subject: [PATCH] rapidjson 1.1 compatibility + +RapidJSON 1.1 slightly changed its API for custom handlers, by +introducing the RawNumber method, see [1]. Instead of defining the +method itself, change all handlers to inherit from +rapidjson::BaseReaderHandler. + +Additionally, the facter::facts::<anon>::stream_adapter must typedef Ch. + +[1] https://github.com/Tencent/rapidjson/issues/581 +--- + lib/inc/facter/facts/collection.hpp | 1 + + lib/src/facts/external/json_resolver.cc | 2 +- + lib/src/facts/resolvers/gce_resolver.cc | 2 +- + 3 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/inc/facter/facts/collection.hpp b/lib/inc/facter/facts/collection.hpp +index c89daa5e..570cc67d 100644 +--- a/lib/inc/facter/facts/collection.hpp ++++ b/lib/inc/facter/facts/collection.hpp +@@ -46,6 +46,7 @@ namespace facter { namespace facts { + */ + struct stream_adapter + { ++ typedef char Ch; + /** + * Constructs an adapter for use with rapidjson around the given stream. + * @param stream an output stream to which JSON will be written +diff --git a/lib/src/facts/external/json_resolver.cc b/lib/src/facts/external/json_resolver.cc +index 8edc0467..35817d59 100644 +--- a/lib/src/facts/external/json_resolver.cc ++++ b/lib/src/facts/external/json_resolver.cc +@@ -24,7 +24,7 @@ using namespace rapidjson; + namespace facter { namespace facts { namespace external { + + // Helper event handler for parsing JSON data +- struct json_event_handler ++ struct json_event_handler : public rapidjson::BaseReaderHandler<> + { + explicit json_event_handler(collection& facts) : + _initialized(false), +diff --git a/lib/src/facts/resolvers/gce_resolver.cc b/lib/src/facts/resolvers/gce_resolver.cc +index ed579e5f..6ea737fa 100644 +--- a/lib/src/facts/resolvers/gce_resolver.cc ++++ b/lib/src/facts/resolvers/gce_resolver.cc +@@ -35,7 +35,7 @@ namespace facter { namespace facts { namespace resolvers { + #endif + + // Helper event handler for parsing JSON data +- struct gce_event_handler ++ struct gce_event_handler : public rapidjson::BaseReaderHandler<> + { + explicit gce_event_handler(map_value& root) : + _initialized(false), +-- +2.16.1 + Copied: facter/repos/community-testing-x86_64/shared_cpp_hcon.patch (from rev 977576, facter/trunk/shared_cpp_hcon.patch) =================================================================== --- community-testing-x86_64/shared_cpp_hcon.patch (rev 0) +++ community-testing-x86_64/shared_cpp_hcon.patch 2021-07-16 07:43:50 UTC (rev 977577) @@ -0,0 +1,11 @@ +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") Copied: facter/repos/community-testing-x86_64/workaround-broken-double-test.patch (from rev 977576, facter/trunk/workaround-broken-double-test.patch) =================================================================== --- community-testing-x86_64/workaround-broken-double-test.patch (rev 0) +++ community-testing-x86_64/workaround-broken-double-test.patch 2021-07-16 07:43:50 UTC (rev 977577) @@ -0,0 +1,16 @@ +--- a/lib/tests/facts/double_value.cc 2019-09-30 09:13:02.000000000 +0200 ++++ b/lib/tests/facts/double_value.cc 2019-10-12 19:54:49.184377937 +0200 +@@ -23,13 +23,6 @@ SCENARIO("using a double fact value") { + REQUIRE(json.GetDouble() == Approx(42.4242)); + } + } +- WHEN("serialized to YAML") { +- THEN("it should have the same value") { +- Emitter emitter; +- value.write(emitter); +- REQUIRE(string(emitter.c_str()) == "42.4242"); +- } +- } + WHEN("serialized to text") { + THEN("it should have the same value") { + ostringstream stream;