Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yaml_cpp: Changed recipe to build v0.5.3 #7591

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions Y/yaml_cpp/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,32 @@
using BinaryBuilder, Pkg

name = "yaml_cpp"
version = v"0.7.0"
version = v"0.5.3"

# Collection of sources required to complete build
sources = [
ArchiveSource("https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-$(version).zip",
"4d5e664a7fb2d7445fc548cc8c0e1aa7b1a496540eb382d137e2cc263e6d3ef5")
GitSource("https://github.com/jbeder/yaml-cpp.git", "b57efe94e7d445713c29f863adb8c23438eaa217"),
DirectorySource("bundled"),
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/yaml-cpp*/

patch -p1 < ../patches/boost_detail_iterator_obsolete.patch

if [[ $target == *-apple-darwin* || $target == *-freebsd* ]]; then
cmake_extra_args=-DCMAKE_C_FLAGS=-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
fi

mkdir build && cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=${prefix} \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DYAML_BUILD_SHARED_LIBS=ON \
-DYAML_CPP_BUILD_TESTS=OFF
-DBUILD_SHARED_LIBS=ON \
-DYAML_CPP_BUILD_TOOLS=OFF \
stemann marked this conversation as resolved.
Show resolved Hide resolved
$cmake_extra_args

make -j${nproc}
make install
Expand All @@ -32,11 +40,12 @@ platforms = expand_cxxstring_abis(supported_platforms(; experimental=true))

stemann marked this conversation as resolved.
Show resolved Hide resolved
# The products that we will ensure are always built
products = [
LibraryProduct("libyaml-cpp", :libyaml_cpp)
LibraryProduct(["libyaml-cpp", "yaml-cpp"], :libyaml_cpp)
]

# Dependencies that must be installed before this package can be built
dependencies = Dependency[
dependencies = [
BuildDependency(PackageSpec("boost_jll", v"1.76.0")),
]

# Build the tarballs, and possibly a `build.jl` as well.
Expand Down
26 changes: 26 additions & 0 deletions Y/yaml_cpp/bundled/patches/boost_detail_iterator_obsolete.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this patch come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My hack to avoid being dependent on boost < v1.70 (I.e. making #7592 superfluous): I believe Boost v1.70 removed this method - as it was moved to std?

Similar approach: https://stackoverflow.com/a/49937378/1713725

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced the hack with a more solid patch - based on https://www.mail-archive.com/[email protected]/msg1644546.html

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/include/yaml-cpp/node/detail/iterator.h b/include/yaml-cpp/node/detail/iterator.h
index 2c701af..232fca7 100644
--- a/include/yaml-cpp/node/detail/iterator.h
+++ b/include/yaml-cpp/node/detail/iterator.h
@@ -45,7 +45,7 @@ class iterator_base
private:
friend class boost::iterator_core_access;

- void increment() { this->base_reference() = boost::next(this->base()); }
+ void increment() { this->base_reference() = std::next(this->base()); }

value_type dereference() const {
const typename base_type::value_type& v = *this->base();
diff --git a/src/node_data.cpp b/src/node_data.cpp
index a1ca900..0bdb6e7 100644
--- a/src/node_data.cpp
+++ b/src/node_data.cpp
@@ -104,7 +104,7 @@ void node_data::compute_seq_size() const {
void node_data::compute_map_size() const {
kv_pairs::iterator it = m_undefinedPairs.begin();
while (it != m_undefinedPairs.end()) {
- kv_pairs::iterator jt = boost::next(it);
+ kv_pairs::iterator jt = std::next(it);
if (it->first->is_defined() && it->second->is_defined())
m_undefinedPairs.erase(it);
it = jt;