Skip to content

Commit

Permalink
yaml_cpp: Changed recipe to build v0.5.3 (JuliaPackaging#7591)
Browse files Browse the repository at this point in the history
* yaml_cpp: Changed recipe to build v0.5.3

Including:
* Added boost_jll as a build dep.
* 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

* Rectified patch for missing <boost/next_prior.hpp> include.
  • Loading branch information
stemann authored and amontoison committed Nov 27, 2023
1 parent c743b7b commit 1ec2fa8
Show file tree
Hide file tree
Showing 2 changed files with 28 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/missing_boost_next_prior_include.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 = [
BuildDependency(PackageSpec("boost_jll", v"1.76.0")),
]

# Build the tarballs, and possibly a `build.jl` as well.
Expand Down
12 changes: 12 additions & 0 deletions Y/yaml_cpp/bundled/patches/missing_boost_next_prior_include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/include/yaml-cpp/node/detail/iterator.h b/include/yaml-cpp/node/detail/iterator.h
index 2c701af..08e2672 100644
--- a/include/yaml-cpp/node/detail/iterator.h
+++ b/include/yaml-cpp/node/detail/iterator.h
@@ -11,6 +11,7 @@
#include "yaml-cpp/node/ptr.h"
#include "yaml-cpp/node/detail/node_iterator.h"
#include <boost/iterator/iterator_adaptor.hpp>
+#include <boost/next_prior.hpp>
#include <boost/utility.hpp>

namespace YAML {

0 comments on commit 1ec2fa8

Please sign in to comment.