summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-games/openscenegraph-openmw/Manifest1
-rw-r--r--dev-games/openscenegraph-openmw/files/openscenegraph-3.6.3-cmake.patch12
-rw-r--r--dev-games/openscenegraph-openmw/files/openscenegraph-3.6.5-cmake_lua_version.patch14
-rw-r--r--dev-games/openscenegraph-openmw/files/openscenegraph-3.6.5-use_boost_asio.patch263
-rw-r--r--dev-games/openscenegraph-openmw/metadata.xml6
-rw-r--r--dev-games/openscenegraph-openmw/openscenegraph-openmw-3.6_p20210610.ebuild167
6 files changed, 463 insertions, 0 deletions
diff --git a/dev-games/openscenegraph-openmw/Manifest b/dev-games/openscenegraph-openmw/Manifest
index 16fc597107e4..f6fca44cefbd 100644
--- a/dev-games/openscenegraph-openmw/Manifest
+++ b/dev-games/openscenegraph-openmw/Manifest
@@ -1 +1,2 @@
DIST openscenegraph-openmw-3.4_p20200425.tar.gz 5698786 BLAKE2B 43684fa898912434dae9a7b41070a893c407dceba7e468a3f3dede32e24aea55d921098faf8d9d05708d2ef01a3507b2f126939dc13b8693002a0bec189bbaf7 SHA512 9bb4d2a6ca4694ee22a29508b74a095a483584ea801dc8298ec8a9b41c4d4fe18c52a21849ae9ec1065060479dcad5156227f82feed13c177415662ecba1da70
+DIST openscenegraph-openmw-3.6_p20210610.tar.gz 5788655 BLAKE2B fdf345502ee7bb742741da758ae212028882544766a6acba3309d27e2fffa230e4a07626c9a39dbdf1310374b765b3941c915d7b6d527fc7cb75ba028230b4a0 SHA512 1964b12fedf297b8baf77d4db2eb4ce6732925bb3974fb4d8d20b1dec751400ceb57faf0b069c2a5cf45728cad83ea434356edbcb19413d650717c3d2ac39a03
diff --git a/dev-games/openscenegraph-openmw/files/openscenegraph-3.6.3-cmake.patch b/dev-games/openscenegraph-openmw/files/openscenegraph-3.6.3-cmake.patch
new file mode 100644
index 000000000000..708c68659680
--- /dev/null
+++ b/dev-games/openscenegraph-openmw/files/openscenegraph-3.6.3-cmake.patch
@@ -0,0 +1,12 @@
+--- a/CMakeModules/OsgMacroUtils.cmake
++++ b/CMakeModules/OsgMacroUtils.cmake
+@@ -463,7 +463,7 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
+ IF(APPLE)
+ INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
+ ELSE(APPLE)
+- INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
++ INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph-examples )
+ IF(MSVC)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
+
diff --git a/dev-games/openscenegraph-openmw/files/openscenegraph-3.6.5-cmake_lua_version.patch b/dev-games/openscenegraph-openmw/files/openscenegraph-3.6.5-cmake_lua_version.patch
new file mode 100644
index 000000000000..1373b296da04
--- /dev/null
+++ b/dev-games/openscenegraph-openmw/files/openscenegraph-3.6.5-cmake_lua_version.patch
@@ -0,0 +1,14 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -771,10 +771,7 @@
+ FIND_PACKAGE(LIBLAS)
+
+ IF (NOT(OSG_USE_LOCAL_LUA_SOURCE))
+- FIND_PACKAGE(Lua52)
+- IF (NOT (LUA_LIBRARIES AND LUA_INCLUDE_DIR))
+- FIND_PACKAGE(Lua51)
+- ENDIF()
++ FIND_PACKAGE(Lua ${LUA_VERSION} EXACT)
+ ENDIF()
+
+ # V8 and Python plugins are tests for linking against these libraries but aren't functionality beyond this.
diff --git a/dev-games/openscenegraph-openmw/files/openscenegraph-3.6.5-use_boost_asio.patch b/dev-games/openscenegraph-openmw/files/openscenegraph-3.6.5-use_boost_asio.patch
new file mode 100644
index 000000000000..f9a32c0dc601
--- /dev/null
+++ b/dev-games/openscenegraph-openmw/files/openscenegraph-3.6.5-use_boost_asio.patch
@@ -0,0 +1,263 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -764,7 +764,7 @@
+ FIND_PACKAGE(DirectInput)
+ FIND_PACKAGE(NVTT)
+ IF (NOT WIN32)
+- FIND_PACKAGE(Asio)
++ FIND_PACKAGE(Boost)
+ ENDIF()
+ FIND_PACKAGE(ZeroConf)
+
+--- a/CMakeModules/FindAsio.cmake
++++ b/CMakeModules/FindAsio.cmake
+@@ -1,22 +0,0 @@
+-# Locate ASIO-headers (http://think-async.com/Asio)
+-# This module defines
+-# ASIO_FOUND, if false, do not try to link to gdal
+-# ASIO_INCLUDE_DIR, where to find the headers
+-#
+-# Created by Stephan Maximilian Huber
+-
+-FIND_PATH(ASIO_INCLUDE_DIR
+- NAMES
+- asio.hpp
+- PATHS
+- /usr/include
+- /usr/local/include
+-)
+-
+-SET(ASIO_FOUND "NO")
+-IF(ASIO_INCLUDE_DIR)
+- FIND_PACKAGE( Boost 1.37 )
+- IF(Boost_FOUND)
+- SET(ASIO_FOUND "YES")
+- ENDIF()
+-ENDIF()
+--- a/src/osgPlugins/CMakeLists.txt
++++ b/src/osgPlugins/CMakeLists.txt
+@@ -299,13 +299,13 @@
+ #
+ # Device integration plugins
+ #
+-IF (SDL_FOUND)
++IF(SDL_FOUND)
+ ADD_PLUGIN_DIRECTORY(sdl)
+-ENDIF(SDL_FOUND)
++ENDIF()
+
+-IF(ASIO_FOUND)
++IF(Boost_FOUND)
+ ADD_PLUGIN_DIRECTORY(RestHttpDevice)
+-ENDIF(ASIO_FOUND)
++ENDIF()
+
+
+ IF(ZEROCONF_FOUND)
+--- a/src/osgPlugins/RestHttpDevice/CMakeLists.txt
++++ b/src/osgPlugins/RestHttpDevice/CMakeLists.txt
+@@ -1,6 +1,5 @@
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+-INCLUDE_DIRECTORIES(${ASIO_INCLUDE_DIR})
+-
++
+ SET(TARGET_SRC
+ connection.cpp
+ io_service_pool.cpp
+@@ -26,7 +25,7 @@
+ RestHttpDevice.hpp
+ )
+
+-SET(TARGET_ADDED_LIBRARIES osgPresentation )
++SET(TARGET_ADDED_LIBRARIES osgPresentation)
+
+ #### end var setup ###
+ SETUP_PLUGIN(resthttp)
+--- a/src/osgPlugins/RestHttpDevice/connection.cpp
++++ b/src/osgPlugins/RestHttpDevice/connection.cpp
+@@ -37,14 +37,14 @@
+ 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));
+ }
+
+-void connection::handle_read(const asio::error_code& e,
++void connection::handle_read(const boost::system::error_code& e,
+ std::size_t bytes_transferred)
+ {
+ if (!e)
+@@ -82,12 +82,12 @@
+ // handler returns. The connection class's destructor closes the socket.
+ }
+
+-void connection::handle_write(const asio::error_code& e)
++void connection::handle_write(const boost::system::error_code& e)
+ {
+ if (!e)
+ {
+ // Initiate graceful connection closure.
+- asio::error_code ignored_ec;
++ boost::system::error_code ignored_ec;
+ socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec);
+ }
+
+--- a/src/osgPlugins/RestHttpDevice/connection.hpp
++++ b/src/osgPlugins/RestHttpDevice/connection.hpp
+@@ -11,7 +11,7 @@
+ #ifndef HTTP_SERVER_CONNECTION_HPP
+ #define HTTP_SERVER_CONNECTION_HPP
+
+-#include <asio.hpp>
++#include <boost/asio.hpp>
+ #include <boost/array.hpp>
+ #include <boost/noncopyable.hpp>
+ #include <boost/shared_ptr.hpp>
+@@ -21,6 +21,8 @@
+ #include "request_handler.hpp"
+ #include "request_parser.hpp"
+
++using namespace boost;
++
+ namespace http {
+ namespace server {
+
+@@ -42,11 +44,11 @@
+ ~connection();
+ private:
+ /// Handle completion of a read operation.
+- void handle_read(const asio::error_code& e,
++ void handle_read(const boost::system::error_code& e,
+ std::size_t bytes_transferred);
+
+ /// Handle completion of a write operation.
+- void handle_write(const asio::error_code& e);
++ void handle_write(const boost::system::error_code& e);
+
+ /// Socket for the connection.
+ asio::ip::tcp::socket socket_;
+--- a/src/osgPlugins/RestHttpDevice/io_service_pool.cpp
++++ b/src/osgPlugins/RestHttpDevice/io_service_pool.cpp
+@@ -11,7 +11,7 @@
+ #include "server.hpp"
+ #include <stdexcept>
+ #include <boost/bind.hpp>
+-#include <boost/shared_ptr.hpp>
++#include <boost/thread.hpp>
+
+ namespace http {
+ namespace server {
+@@ -36,17 +36,14 @@
+ void io_service_pool::run()
+ {
+ // Create a pool of threads to run all of the io_services.
+- std::vector<boost::shared_ptr<asio::thread> > threads;
++ std::vector<thread> threads;
+ for (std::size_t i = 0; i < io_services_.size(); ++i)
+- {
+- boost::shared_ptr<asio::thread> thread(new asio::thread(
+- boost::bind(&asio::io_service::run, io_services_[i])));
+- threads.push_back(thread);
+- }
++ threads.emplace_back(thread(boost::bind(&asio::io_service::run,
++ io_services_[i])));
+
+ // Wait for all threads in the pool to exit.
+ for (std::size_t i = 0; i < threads.size(); ++i)
+- threads[i]->join();
++ threads[i].join();
+ }
+
+ void io_service_pool::stop()
+--- a/src/osgPlugins/RestHttpDevice/io_service_pool.hpp
++++ b/src/osgPlugins/RestHttpDevice/io_service_pool.hpp
+@@ -11,11 +11,13 @@
+ #ifndef HTTP_SERVER_IO_SERVICE_POOL_HPP
+ #define HTTP_SERVER_IO_SERVICE_POOL_HPP
+
+-#include <asio.hpp>
++#include <boost/asio.hpp>
+ #include <vector>
+ #include <boost/noncopyable.hpp>
+ #include <boost/shared_ptr.hpp>
+
++using namespace boost;
++
+ namespace http {
+ namespace server {
+
+--- a/src/osgPlugins/RestHttpDevice/reply.hpp
++++ b/src/osgPlugins/RestHttpDevice/reply.hpp
+@@ -13,9 +13,11 @@
+
+ #include <string>
+ #include <vector>
+-#include <asio.hpp>
++#include <boost/asio.hpp>
+ #include "header.hpp"
+
++using namespace boost;
++
+ namespace http {
+ namespace server {
+
+--- a/src/osgPlugins/RestHttpDevice/server.cpp
++++ b/src/osgPlugins/RestHttpDevice/server.cpp
+@@ -23,7 +23,7 @@
+ 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(io_service_pool_.get_io_service());
+ asio::ip::tcp::resolver::query query(address, port);
+ asio::ip::tcp::endpoint endpoint = *resolver.resolve(query);
+ acceptor_.open(endpoint.protocol());
+@@ -47,7 +47,7 @@
+ io_service_pool_.stop();
+ }
+
+-void server::handle_accept(const asio::error_code& e)
++void server::handle_accept(const boost::system::error_code& e)
+ {
+ if (!e)
+ {
+--- a/src/osgPlugins/RestHttpDevice/server.hpp
++++ b/src/osgPlugins/RestHttpDevice/server.hpp
+@@ -11,7 +11,7 @@
+ #ifndef HTTP_SERVER_SERVER_HPP
+ #define HTTP_SERVER_SERVER_HPP
+
+-#include <asio.hpp>
++#include <boost/asio.hpp>
+ #include <string>
+ #include <vector>
+ #include <boost/noncopyable.hpp>
+@@ -20,6 +20,8 @@
+ #include "io_service_pool.hpp"
+ #include "request_handler.hpp"
+
++using namespace boost;
++
+ namespace http {
+ namespace server {
+
+@@ -38,12 +40,12 @@
+
+ /// Stop the server.
+ void stop();
+-
++
+ void setCallback(request_handler::Callback* cb) { request_handler_.setCallback(cb); }
+
+ private:
+ /// Handle completion of an asynchronous accept operation.
+- void handle_accept(const asio::error_code& e);
++ void handle_accept(const boost::system::error_code& e);
+
+ /// The pool of io_service objects used to perform asynchronous operations.
+ io_service_pool io_service_pool_;
diff --git a/dev-games/openscenegraph-openmw/metadata.xml b/dev-games/openscenegraph-openmw/metadata.xml
index 6e5dbab66570..c9b5ea504b4b 100644
--- a/dev-games/openscenegraph-openmw/metadata.xml
+++ b/dev-games/openscenegraph-openmw/metadata.xml
@@ -16,10 +16,16 @@
<longdescription lang="en">
OpenSceneGraph on steroids. This fork was created to experiment with performance enhancements for OpenMW that are too controversial to be included in the general purpose OSG project - either for design reasons or backward compatibility reasons. OpenMW still works with "vanilla" OpenSceneGraph, but it is recommended to use the fork for better performance (around 10-15% on most devices). Note that the improvements are very specific to OpenMW and its animation code in particular; other OpenSceneGraph applications are not likely to see the same speed-up, or any speed-up at all if they are already GPU limited.
</longdescription>
+ <upstream>
+ <remote-id type="github">OpenMW/osg</remote-id>
+ </upstream>
<use>
+ <flag name="collada">Enable DAE file support via <pkg>dev-libs/collada-dom</pkg></flag>
+ <flag name="dicom">Enable DICOM medical image file support via <pkg>sci-libs/dcmtk</pkg></flag>
<flag name="egl">Enable EGL support</flag>
<flag name="fox">Build examples using <pkg>x11-libs/fox</pkg> library</flag>
<flag name="gdal">Enable support for <pkg>sci-libs/gdal</pkg> library</flag>
+ <flag name="las">Enable support for geospatial data LAS LiDAR format using <pkg>sci-geosciences/liblas</pkg></flag>
<flag name="openinventor">Build OpenInventor plugin</flag>
<flag name="osgapps">Build osg applications</flag>
<flag name="sdl2">Use <pkg>media-libs/libsdl2</pkg> additionally to <pkg>media-libs/libsdl</pkg></flag>
diff --git a/dev-games/openscenegraph-openmw/openscenegraph-openmw-3.6_p20210610.ebuild b/dev-games/openscenegraph-openmw/openscenegraph-openmw-3.6_p20210610.ebuild
new file mode 100644
index 000000000000..1fe85653833c
--- /dev/null
+++ b/dev-games/openscenegraph-openmw/openscenegraph-openmw-3.6_p20210610.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LUA_COMPAT=( lua5-1 )
+
+WX_GTK_VER="3.0-gtk3"
+inherit cmake flag-o-matic lua-single wxwidgets
+
+MY_COMMIT="b02abe200c4847e73b887b064a89ea1758a5b733"
+
+DESCRIPTION="OpenMW-specific fork of OpenSceneGraph"
+HOMEPAGE="https://github.com/OpenMW/osg"
+SRC_URI="https://github.com/OpenMW/osg/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/osg-${MY_COMMIT}"
+
+LICENSE="wxWinLL-3 LGPL-2.1"
+SLOT="0/162" # NOTE: CHECK WHEN BUMPING! Subslot is SOVERSION
+KEYWORDS="~amd64 ~x86"
+IUSE="
+ collada curl dicom debug doc egl examples ffmpeg fltk fox gdal
+ gif glut gstreamer jpeg las lua openexr openinventor osgapps pdf png
+ sdl sdl2 svg tiff truetype vnc wxwidgets xrandr +zlib
+"
+
+REQUIRED_USE="
+ dicom? ( zlib )
+ lua? ( ${LUA_REQUIRED_USE} )
+ openexr? ( zlib )
+ sdl2? ( sdl )
+"
+
+# TODO: FBX, GTA, NVTT, OpenVRML, Performer
+BDEPEND="
+ app-arch/unzip
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+"
+RDEPEND="
+ !dev-games/openscenegraph
+ media-libs/mesa[egl(+)?]
+ virtual/glu
+ virtual/opengl
+ x11-libs/libSM
+ x11-libs/libXext
+ collada? ( dev-libs/collada-dom:= )
+ curl? ( net-misc/curl )
+ examples? (
+ fltk? ( x11-libs/fltk:1[opengl] )
+ fox? ( x11-libs/fox:1.6[opengl] )
+ glut? ( media-libs/freeglut )
+ sdl2? ( media-libs/libsdl2 )
+ wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[opengl,X] )
+ )
+ ffmpeg? ( media-video/ffmpeg:0= )
+ gdal? ( sci-libs/gdal:= )
+ gif? ( media-libs/giflib:= )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ jpeg? ( virtual/jpeg:0 )
+ las? ( >=sci-geosciences/liblas-1.8.0 )
+ lua? ( ${LUA_DEPS} )
+ openexr? (
+ media-libs/ilmbase:=
+ media-libs/openexr:=
+ )
+ openinventor? ( media-libs/coin )
+ pdf? ( app-text/poppler[cairo] )
+ png? ( media-libs/libpng:0= )
+ sdl? ( media-libs/libsdl )
+ svg? (
+ gnome-base/librsvg
+ x11-libs/cairo
+ )
+ tiff? ( media-libs/tiff:0 )
+ truetype? ( media-libs/freetype:2 )
+ vnc? ( net-libs/libvncserver )
+ xrandr? ( x11-libs/libXrandr )
+ zlib? ( sys-libs/zlib )
+"
+DEPEND="${RDEPEND}
+ dev-libs/boost
+ x11-base/xorg-proto
+"
+
+PATCHES=(
+ "${FILESDIR}"/openscenegraph-3.6.3-cmake.patch
+ "${FILESDIR}"/openscenegraph-3.6.3-docdir.patch
+ "${FILESDIR}"/openscenegraph-3.6.5-use_boost_asio.patch
+ "${FILESDIR}"/openscenegraph-3.6.5-cmake_lua_version.patch
+)
+
+pkg_setup() {
+ use lua && lua-single_pkg_setup
+}
+
+src_configure() {
+ if use examples && use wxwidgets; then
+ setup-wxwidgets unicode
+ fi
+
+ # Needed by FFmpeg
+ append-cppflags -D__STDC_CONSTANT_MACROS
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DDYNAMIC_OPENSCENEGRAPH=ON
+ -DLIB_POSTFIX=${libdir/lib}
+ -DOPENGL_PROFILE=GL2 #GL1 GL2 GL3 GLES1 GLES3 GLES3
+ $(cmake_use_find_package collada COLLADA)
+ $(cmake_use_find_package curl CURL)
+ -DBUILD_DOCUMENTATION=$(usex doc)
+ $(cmake_use_find_package dicom DCMTK)
+ $(cmake_use_find_package egl EGL)
+ -DBUILD_OSG_EXAMPLES=$(usex examples)
+ $(cmake_use_find_package ffmpeg FFmpeg)
+ $(cmake_use_find_package gdal GDAL)
+ $(cmake_use_find_package gif GIFLIB)
+ $(cmake_use_find_package gstreamer GLIB)
+ $(cmake_use_find_package gstreamer GStreamer)
+ -DCMAKE_DISABLE_FIND_PACKAGE_GtkGl=ON
+ $(cmake_use_find_package jpeg JPEG)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Jasper=ON
+ $(cmake_use_find_package las LIBLAS)
+ $(cmake_use_find_package lua Lua)
+ -DCMAKE_DISABLE_FIND_PACKAGE_OpenCascade=ON
+ $(cmake_use_find_package openexr OpenEXR)
+ $(cmake_use_find_package openinventor Inventor)
+ -DBUILD_OSG_APPLICATIONS=$(usex osgapps)
+ $(cmake_use_find_package pdf Poppler-glib)
+ $(cmake_use_find_package png PNG)
+ $(cmake_use_find_package sdl SDL)
+ $(cmake_use_find_package sdl2 SDL2)
+ $(cmake_use_find_package svg RSVG)
+ $(cmake_use_find_package tiff TIFF)
+ $(cmake_use_find_package truetype Freetype)
+ $(cmake_use_find_package vnc LibVNCServer)
+ -DOSGVIEWER_USE_XRANDR=$(usex xrandr)
+ $(cmake_use_find_package zlib ZLIB)
+ -DOSG_USE_LOCAL_LUA_SOURCE=OFF
+ )
+
+ if use examples; then
+ mycmakeargs+=(
+ $(cmake_use_find_package fltk FLTK)
+ $(cmake_use_find_package fox FOX)
+ $(cmake_use_find_package glut GLUT)
+ $(cmake_use_find_package wxwidgets wxWidgets)
+ )
+ fi
+
+ if use lua; then
+ mycmakeargs+=(
+ -DLUA_VERSION="$(lua_get_version)"
+ )
+ fi
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+ use doc && cmake_src_compile doc_openscenegraph doc_openthreads
+}