Skip to content

Commit

Permalink
yaml_cpp: Changed recipe to build v0.5.3
Browse files Browse the repository at this point in the history
Including:
* Replaced GitHub automatic archive source with git source.
* Added patch for obsolete boost/detail/iterator header.
* Fixed Windows library name.
* Fixed Clang platforms by enabling C++17 removed features - to get support for std::auto_ptr
  • Loading branch information
stemann committed Oct 31, 2023
1 parent cb76427 commit bc3aa0c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 7 deletions.
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 \
$cmake_extra_args
make -j${nproc}
make install
Expand All @@ -32,11 +40,12 @@ platforms = expand_cxxstring_abis(supported_platforms(; experimental=true))

# 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 = [
Dependency("boost_jll", v"1.79.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
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;

0 comments on commit bc3aa0c

Please sign in to comment.