From 739fe14573d5c89b19bbbb89253e0389efb9db529db09a998f9aa3886efa952f Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 20 Jun 2021 08:39:31 +0000 Subject: [PATCH] Accepting request 900836 from home:StefanBruens:branches:games - Fix build on TW with asio 1.18.x, add 0001-Replace-boost-bind-usage-with-std-bind.patch and 0002-Replace-obsoleted-asio-basic_stream_socket-get_io_se.patch - Disable GTK2 example on TW - Disable wxWidgets example - Do not package huge ChangeLog (commit log) OBS-URL: https://build.opensuse.org/request/show/900836 OBS-URL: https://build.opensuse.org/package/show/games/OpenSceneGraph?expand=0&rev=73 --- OpenSceneGraph.changes | 10 ++ OpenSceneGraph.spec | 39 ++++--- ...place-boost-bind-usage-with-std-bind.patch | 103 ++++++++++++++++++ ...d-asio-basic_stream_socket-get_io_se.patch | 26 +++++ OpenSceneGraph-rpmlintrc | 6 - 5 files changed, 160 insertions(+), 24 deletions(-) create mode 100644 0001-Replace-boost-bind-usage-with-std-bind.patch create mode 100644 0002-Replace-obsoleted-asio-basic_stream_socket-get_io_se.patch delete mode 100644 OpenSceneGraph-rpmlintrc diff --git a/OpenSceneGraph.changes b/OpenSceneGraph.changes index 4dc54c4..55c2446 100644 --- a/OpenSceneGraph.changes +++ b/OpenSceneGraph.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Sat Jun 19 00:11:55 UTC 2021 - Stefan BrĂ¼ns + +- Fix build on TW with asio 1.18.x, add + 0001-Replace-boost-bind-usage-with-std-bind.patch and + 0002-Replace-obsoleted-asio-basic_stream_socket-get_io_se.patch +- Disable GTK2 example on TW +- Disable wxWidgets example +- Do not package huge ChangeLog (commit log) + ------------------------------------------------------------------- Fri Jul 31 10:15:55 UTC 2020 - Michel Normand diff --git a/OpenSceneGraph.spec b/OpenSceneGraph.spec index d1ab454..0024dc3 100644 --- a/OpenSceneGraph.spec +++ b/OpenSceneGraph.spec @@ -1,7 +1,7 @@ # # spec file for package OpenSceneGraph # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,23 +23,18 @@ %else %bcond_with gdal %endif -# asio is not available in Leap < 15.2 and SLE15SP1 -# dcmtk is not available in SLE15SP1 and causes a build issue in Leap 15.1 -%if 0%{?sle_version} < 150200 && 0%{?suse_version} == 1500 -%bcond_with asio -%bcond_with dcmtk -%else + %bcond_without asio %bcond_without dcmtk -%endif -# occt and fox are not available in SLE15SP1 -%if 0%{?is_opensuse} || 0%{?sle_version} >= 150200 %bcond_without fox %bcond_without occt + +%if 0%{?suse_version} >= 1550 +%bcond_with gtk2 %else -%bcond_with fox -%bcond_with occt +%bcond_without gtk2 %endif + Name: OpenSceneGraph Version: 3.6.5 Release: 0 @@ -53,7 +48,9 @@ License: LGPL-2.1-only WITH WxWindows-exception-3.1 Group: Productivity/Graphics/Other URL: http://openscenegraph.org/projects/osg Source0: https://github.com/openscenegraph/%{name}/archive/%{name}-%{version}.tar.gz -Source99: %{name}-rpmlintrc +# PATCH-FIX-OPENSUSE - fix build with asio >= 1.14.0, https://github.com/openscenegraph/OpenSceneGraph/issues/921 +Patch0: 0001-Replace-boost-bind-usage-with-std-bind.patch +Patch1: 0002-Replace-obsoleted-asio-basic_stream_socket-get_io_se.patch BuildRequires: cmake BuildRequires: curl-devel BuildRequires: ffmpeg-devel @@ -66,7 +63,6 @@ BuildRequires: libpng-devel BuildRequires: pkgconfig BuildRequires: unzip BuildRequires: update-desktop-files -BuildRequires: wxWidgets-devel BuildRequires: pkgconfig(IlmBase) BuildRequires: pkgconfig(OpenEXR) BuildRequires: pkgconfig(freetype2) @@ -77,8 +73,10 @@ BuildRequires: pkgconfig(gstreamer-base-1.0) BuildRequires: pkgconfig(gstreamer-fft-1.0) BuildRequires: pkgconfig(gstreamer-pbutils-1.0) BuildRequires: pkgconfig(gstreamer-video-1.0) +%if %{with gtk2} BuildRequires: pkgconfig(gtk+-2.0) BuildRequires: pkgconfig(gtkglext-1.0) +%endif BuildRequires: pkgconfig(librsvg-2.0) >= 2.35 BuildRequires: pkgconfig(libtiff-4) BuildRequires: pkgconfig(libvncserver) @@ -89,6 +87,7 @@ BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(xrandr) %if %{with dcmtk} BuildRequires: cmake(DCMTK) +BuildRequires: pkgconfig(icu-uc) %endif %if %{with fox} BuildRequires: pkgconfig(fox) @@ -213,19 +212,23 @@ This package contains some example applications built with OpenSceneGraph %prep %setup -q -n %{name}-%{name}-%{version} +%if 0%{?suse_version} >= 1550 +%patch0 -p1 +%patch1 -p1 +%endif -for file in *.md *.txt ChangeLog; do +for file in *.md *.txt; do sed -i "s/\r//g" "$file" done -chmod 644 *.md *.txt ChangeLog +chmod 644 *.md *.txt %build %cmake \ + -DCMAKE_RELWITHDEBINFO_POSTFIX="" \ -DBUILD_OSG_EXAMPLES=ON \ -DBUILD_OSG_PLUGINS=ON \ -DBUILD_DOCUMENTATION=OFF \ -DBUILD_OSG_APPLICATIONS=ON \ - -DCMAKE_BUILD_TYPE=Release \ -DDYNAMIC_OPENSCENEGRAPH=ON \ -DDYNAMIC_OPENTHREADS=ON \ %if "%{_lib}" == "lib64" @@ -248,7 +251,7 @@ mv %{buildroot}%{_datadir}/OpenSceneGraph \ %files %license LICENSE.txt -%doc AUTHORS.txt NEWS.txt README.md ChangeLog +%doc AUTHORS.txt NEWS.txt README.md %{_bindir}/osg2cpp %{_bindir}/osgarchive %{_bindir}/osgconv diff --git a/0001-Replace-boost-bind-usage-with-std-bind.patch b/0001-Replace-boost-bind-usage-with-std-bind.patch new file mode 100644 index 0000000..c548835 --- /dev/null +++ b/0001-Replace-boost-bind-usage-with-std-bind.patch @@ -0,0 +1,103 @@ +From b94971dd5528bfcc73e69eeada000b1785649472 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Fri, 18 Jun 2021 17:14:45 +0200 +Subject: [PATCH 1/2] Replace boost::bind usage with std::bind + +asio no longer enables boost support when built in C++11 or later mode. +--- + src/osgPlugins/RestHttpDevice/connection.cpp | 21 ++++++++++---------- + src/osgPlugins/RestHttpDevice/server.cpp | 9 ++++----- + 2 files changed, 14 insertions(+), 16 deletions(-) + +diff --git a/src/osgPlugins/RestHttpDevice/connection.cpp b/src/osgPlugins/RestHttpDevice/connection.cpp +index f591083..5826dd2 100644 +--- a/src/osgPlugins/RestHttpDevice/connection.cpp ++++ b/src/osgPlugins/RestHttpDevice/connection.cpp +@@ -10,7 +10,6 @@ + + #include "connection.hpp" + #include +-#include + #include "request_handler.hpp" + #include + +@@ -39,9 +38,9 @@ void connection::start() + OSG_DEBUG << "RestHttpDevice :: connection::start" << std::endl; + + socket_.async_read_some(asio::buffer(buffer_), +- boost::bind(&connection::handle_read, shared_from_this(), +- asio::placeholders::error, +- asio::placeholders::bytes_transferred)); ++ std::bind(&connection::handle_read, shared_from_this(), ++ std::placeholders::_1, ++ std::placeholders::_2)); + } + + void connection::handle_read(const asio::error_code& e, +@@ -57,22 +56,22 @@ void connection::handle_read(const asio::error_code& e, + { + request_handler_.handle_request(request_, reply_); + asio::async_write(socket_, reply_.to_buffers(), +- boost::bind(&connection::handle_write, shared_from_this(), +- asio::placeholders::error)); ++ std::bind(&connection::handle_write, shared_from_this(), ++ std::placeholders::_1)); + } + else if (!result) + { + reply_ = reply::stock_reply(reply::bad_request); + asio::async_write(socket_, reply_.to_buffers(), +- boost::bind(&connection::handle_write, shared_from_this(), +- asio::placeholders::error)); ++ std::bind(&connection::handle_write, shared_from_this(), ++ std::placeholders::_1)); + } + else + { + socket_.async_read_some(asio::buffer(buffer_), +- boost::bind(&connection::handle_read, shared_from_this(), +- asio::placeholders::error, +- asio::placeholders::bytes_transferred)); ++ std::bind(&connection::handle_read, shared_from_this(), ++ std::placeholders::_1, ++ std::placeholders::_2)); + } + } + +diff --git a/src/osgPlugins/RestHttpDevice/server.cpp b/src/osgPlugins/RestHttpDevice/server.cpp +index d0231ef..e01555a 100644 +--- a/src/osgPlugins/RestHttpDevice/server.cpp ++++ b/src/osgPlugins/RestHttpDevice/server.cpp +@@ -9,7 +9,6 @@ + // + + #include "server.hpp" +-#include + + namespace http { + namespace server { +@@ -31,8 +30,8 @@ server::server(const std::string& address, const std::string& port, + acceptor_.bind(endpoint); + acceptor_.listen(); + acceptor_.async_accept(new_connection_->socket(), +- boost::bind(&server::handle_accept, this, +- asio::placeholders::error)); ++ std::bind(&server::handle_accept, this, ++ std::placeholders::_1)); + } + + void server::run() +@@ -56,8 +55,8 @@ void server::handle_accept(const asio::error_code& e) + new_connection_.reset(new connection( + io_service_pool_.get_io_service(), request_handler_)); + acceptor_.async_accept(new_connection_->socket(), +- boost::bind(&server::handle_accept, this, +- asio::placeholders::error)); ++ std::bind(&server::handle_accept, this, ++ std::placeholders::_1)); + } + else + { +-- +2.32.0 + diff --git a/0002-Replace-obsoleted-asio-basic_stream_socket-get_io_se.patch b/0002-Replace-obsoleted-asio-basic_stream_socket-get_io_se.patch new file mode 100644 index 0000000..6b994f7 --- /dev/null +++ b/0002-Replace-obsoleted-asio-basic_stream_socket-get_io_se.patch @@ -0,0 +1,26 @@ +From 0ea968fc046b72b2a5855c848e96eebecd08f942 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Fri, 18 Jun 2021 17:30:28 +0200 +Subject: [PATCH 2/2] Replace obsoleted + asio::basic_stream_socket::get_io_service + +--- + src/osgPlugins/RestHttpDevice/server.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/osgPlugins/RestHttpDevice/server.cpp b/src/osgPlugins/RestHttpDevice/server.cpp +index e01555a..cf113bc 100644 +--- a/src/osgPlugins/RestHttpDevice/server.cpp ++++ b/src/osgPlugins/RestHttpDevice/server.cpp +@@ -22,7 +22,7 @@ server::server(const std::string& address, const std::string& port, + request_handler_(doc_root) + { + // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR). +- asio::ip::tcp::resolver resolver(acceptor_.get_io_service()); ++ asio::ip::tcp::resolver resolver(acceptor_.get_executor()); + asio::ip::tcp::resolver::query query(address, port); + asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); + acceptor_.open(endpoint.protocol()); +-- +2.32.0 + diff --git a/OpenSceneGraph-rpmlintrc b/OpenSceneGraph-rpmlintrc deleted file mode 100644 index e61388c..0000000 --- a/OpenSceneGraph-rpmlintrc +++ /dev/null @@ -1,6 +0,0 @@ -# This line is mandatory to access the configuration functions -from Config import * - -# libOpenSceneGraph55.i586: W: shlib-policy-missing-lib :) -addFilter("package-with-huge-docs") -