testing/supercollider: rebuild against boost 1.84

This commit is contained in:
Holger Jaekel 2024-05-18 22:39:02 +02:00 committed by Andy Postnikov
parent ff771fe14d
commit 75195270e0
2 changed files with 110 additions and 1 deletions

View File

@ -0,0 +1,107 @@
From 61076b5adba9eb9226c9e929af4a28b9a31e460e Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Tue, 30 Jan 2024 23:56:14 +0100
Subject: [PATCH] Import boost_string_file.hpp from boost-1.83 and put it to
use immediately
string_file.hpp was deprecated in boost-1.79.0 and removed in 1.84.0
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
common/boost_string_file.hpp | 59 ++++++++++++++++++++++++++++++++++
lang/LangSource/PyrLexer.cpp | 2 +-
server/scsynth/SC_GraphDef.cpp | 2 +-
3 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 common/boost_string_file.hpp
diff --git a/common/boost_string_file.hpp b/common/boost_string_file.hpp
new file mode 100644
index 00000000000..1ccb63de6b2
--- /dev/null
+++ b/common/boost_string_file.hpp
@@ -0,0 +1,59 @@
+// filesystem/string_file.hpp --------------------------------------------------------//
+
+// Copyright Beman Dawes 2015
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Library home page: http://www.boost.org/libs/filesystem
+
+#ifndef BOOST_FILESYSTEM_STRING_FILE_HPP
+#define BOOST_FILESYSTEM_STRING_FILE_HPP
+
+#include <boost/filesystem/config.hpp>
+
+#include <cstddef>
+#include <limits>
+#include <string>
+#include <ios>
+#include <stdexcept>
+#include <boost/cstdint.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <boost/filesystem/operations.hpp>
+
+#include <boost/filesystem/detail/header.hpp> // must be the last #include
+
+namespace boost {
+namespace filesystem {
+
+inline void save_string_file(path const& p, std::string const& str)
+{
+ filesystem::ofstream file;
+ file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
+ file.open(p, std::ios_base::binary);
+ const std::size_t sz = str.size();
+ if (BOOST_UNLIKELY(sz > static_cast< boost::uintmax_t >((std::numeric_limits< std::streamsize >::max)())))
+ BOOST_FILESYSTEM_THROW(std::length_error("String size exceeds max write size"));
+ file.write(str.c_str(), static_cast< std::streamsize >(sz));
+}
+
+inline void load_string_file(path const& p, std::string& str)
+{
+ filesystem::ifstream file;
+ file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
+ file.open(p, std::ios_base::binary);
+ const boost::uintmax_t sz = filesystem::file_size(p);
+ if (BOOST_UNLIKELY(sz > static_cast< boost::uintmax_t >((std::numeric_limits< std::streamsize >::max)())))
+ BOOST_FILESYSTEM_THROW(std::length_error("File size exceeds max read size"));
+ str.resize(static_cast< std::size_t >(sz), '\0');
+ if (sz > 0u)
+ file.read(&str[0], static_cast< std::streamsize >(sz));
+}
+
+} // namespace filesystem
+} // namespace boost
+
+#include <boost/filesystem/detail/footer.hpp>
+
+#endif // BOOST_FILESYSTEM_STRING_FILE_HPP
diff --git a/lang/LangSource/PyrLexer.cpp b/lang/LangSource/PyrLexer.cpp
index 7ebe3d7262d..06c1454ca63 100644
--- a/lang/LangSource/PyrLexer.cpp
+++ b/lang/LangSource/PyrLexer.cpp
@@ -38,7 +38,7 @@
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/string_file.hpp>
+#include "boost_string_file.hpp"
#include "PyrParseNode.h"
#include "Bison/lang11d_tab.h"
diff --git a/server/scsynth/SC_GraphDef.cpp b/server/scsynth/SC_GraphDef.cpp
index 957aca1934b..5f8f15741a9 100644
--- a/server/scsynth/SC_GraphDef.cpp
+++ b/server/scsynth/SC_GraphDef.cpp
@@ -46,7 +46,7 @@
#include <string>
#include <boost/filesystem/operations.hpp> // recursive_directory_iterator
-#include <boost/filesystem/string_file.hpp> // load_string_file
+#include "boost_string_file.hpp" // load_string_file
namespace bfs = boost::filesystem;

View File

@ -2,7 +2,7 @@
# Maintainer: Leon ROUX <leon.roux@federate.us>
pkgname=supercollider
pkgver=3.13.0
pkgrel=4
pkgrel=5
pkgdesc="An audio server, programming language, and IDE for sound synthesis and algorithmic composition."
url="https://supercollider.github.io/"
arch="x86_64 x86 aarch64 armv7 armhf" # blocked by qt5-qtwebengine
@ -35,6 +35,7 @@ checkdepends="xvfb-run"
subpackages="$pkgname-dev"
source="https://github.com/supercollider/supercollider/releases/download/Version-$pkgver/SuperCollider-$pkgver-Source.tar.bz2
00-fortified-headers.patch
10-boost_1.84.patch
"
builddir="$srcdir/SuperCollider-$pkgver-Source"
@ -66,4 +67,5 @@ package() {
sha512sums="
a60a128f7646f077f91adae666fa4014529aa9df78cf0dfe5d68c9bd6447f008af7da2970b8736f3f29d0adbaf67bce680a8201fcbe7e1aba29c3499a57f89cd SuperCollider-3.13.0-Source.tar.bz2
cef3e1bdaecd4278d14fcabc39d2a69cfab1216ff3dedd3e54997470955dd310e502732ff2c0f76e95f349c31deb964eff456f49f51d7e3c83421521d0c30c43 00-fortified-headers.patch
9526fc6559c04d08f008c9ec30f6896389256c0ac9ed7f8b0840329592ee8aed70afae0ce9fb66d02f50ab4e4eba46fbeb09338c37d73523cd672e21170ebcab 10-boost_1.84.patch
"