summaryrefslogtreecommitdiff
path: root/dev-games/clanlib
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-04 16:47:34 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-04 16:47:34 -0500
commitdda948891d3731927b821ce31f9d9a2d03ba20c5 (patch)
tree99cd40be4cbb0606260da212cd81b8ab2db9da9b /dev-games/clanlib
parenta3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7 (diff)
downloadbaldeagleos-repo-dda948891d3731927b821ce31f9d9a2d03ba20c5.tar.gz
baldeagleos-repo-dda948891d3731927b821ce31f9d9a2d03ba20c5.tar.xz
baldeagleos-repo-dda948891d3731927b821ce31f9d9a2d03ba20c5.zip
Adding metadata
Diffstat (limited to 'dev-games/clanlib')
-rw-r--r--dev-games/clanlib/Manifest4
-rw-r--r--dev-games/clanlib/clanlib-0.8.1-r3.ebuild106
-rw-r--r--dev-games/clanlib/clanlib-2.3.7-r4.ebuild120
-rw-r--r--dev-games/clanlib/clanlib-4.1.0-r1.ebuild77
-rw-r--r--dev-games/clanlib/clanlib-4.2.0.ebuild78
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-docbuilder.patch28
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-gcc12.patch12
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-gcc43.patch28
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-gcc44.patch30
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-gcc47.patch10
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-gcc6.patch16
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-glibc2.34.patch17
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-libpng15.patch11
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-llvm.patch87
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-makefile-duplicate-headers.patch29
-rw-r--r--dev-games/clanlib/files/clanlib-0.8.1-ndebug.patch20
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-32bit-opengl.patch19
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-autotools.patch45
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-doc.patch14
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-freetype_pkgconfig.patch13
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-gcc47.patch107
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-gcc7.patch20
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-glibc2.34.patch17
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-no-ldflags-for-conftest.patch19
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-no-wm_type-in-fs.patch12
-rw-r--r--dev-games/clanlib/files/clanlib-2.3.7-non-x86.patch38
-rw-r--r--dev-games/clanlib/metadata.xml59
27 files changed, 1036 insertions, 0 deletions
diff --git a/dev-games/clanlib/Manifest b/dev-games/clanlib/Manifest
new file mode 100644
index 000000000000..068821810e2e
--- /dev/null
+++ b/dev-games/clanlib/Manifest
@@ -0,0 +1,4 @@
+DIST ClanLib-0.8.1.tgz 7629019 BLAKE2B 7f238111931212e3f9c82ed43842706bf16ee145896735ca35595e29dd357e52364cc592be55d88e231f962adc313bc8f57357bc74c9f1b8b134bc411497f5e9 SHA512 277daaf1055ae0198be7a6bbfd415c79cfae9e2145f62553e83849d670f56e50b8484c83f8b85f23290002e0b0c72c1e01ca597ad608a0954a4add828177293b
+DIST ClanLib-2.3.7.tgz 26132425 BLAKE2B 109ba92baf21174022c8dbc4044e39ec16ec77c730b57590733418e246ab71d18d81bbf281cd469dd9e2aebd4ac4302fbb581f27dc7fc0054a8c7ce69699e19d SHA512 73169afc0f639390f80403150757a8a14f842bc291a9457c9bca1319642b78bc4d03a93327d75254230e39545c5b4b690e56dc0149ed7b60b223e5a5364e882a
+DIST clanlib-4.1.0.tar.gz 6871886 BLAKE2B 0aeb9e89998a9ef6975bf16a2e77f461e6415aacda9a26a5c0a9c6ec3c19a136a5f092c7866b60898251fbd6cb8aa7e96c86f6b87afb564824298fac77bf20c3 SHA512 34f5d1fdb7b071a218f081a6b06a6018a9c20cedc4c8500a9796be02d335f06fa148304379eeb1a35e08b9a734e504ceb490a6558a43d1611187bd97be01f4b0
+DIST clanlib-4.2.0.tar.gz 6830997 BLAKE2B edce01df4b9cfd00a7809a4962c126ca168209d36e02f42a7c988fc1e5789601168e38c0dbc4a237f4776098850f096b8f3ac1d54c810d8515eefe2f9c8d0775 SHA512 d3e2df4e2b1c9c661df9322e97a8582b46aaacb7fddd4d86f05a6bf6e02cd5cd3cbe80dbfae16a664b23107b9606a925ac10b4baad92d352ab33bb78d8696da8
diff --git a/dev-games/clanlib/clanlib-0.8.1-r3.ebuild b/dev-games/clanlib/clanlib-0.8.1-r3.ebuild
new file mode 100644
index 000000000000..f82d2a0f58df
--- /dev/null
+++ b/dev-games/clanlib/clanlib-0.8.1-r3.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="Multi-platform game development library"
+HOMEPAGE="https://github.com/sphair/ClanLib"
+SRC_URI="mirror://gentoo/ClanLib-${PV}.tgz"
+S="${WORKDIR}"/ClanLib-${PV}
+
+LICENSE="ZLIB"
+SLOT="0.8"
+# Not big endian safe! #82779
+KEYWORDS="amd64 x86"
+IUSE="doc ipv6 mikmod opengl sdl static-libs vorbis"
+
+# opengl keyword does not drop the GL/GLU requirement.
+# Autoconf files need to be fixed
+RDEPEND="
+ media-libs/alsa-lib
+ media-libs/libpng:0
+ virtual/jpeg:0
+ virtual/glu
+ virtual/opengl
+ x11-libs/libXi
+ x11-libs/libXmu
+ x11-libs/libXxf86vm
+ mikmod? ( media-libs/libmikmod )
+ sdl? (
+ media-libs/libsdl[X]
+ media-libs/sdl-gfx
+ )
+ vorbis? ( media-libs/libvorbis )
+"
+DEPEND="
+ ${RDEPEND}
+ x11-base/xorg-proto
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-ndebug.patch"
+ "${FILESDIR}/${P}-gcc43.patch"
+ "${FILESDIR}/${P}-gcc44.patch"
+ "${FILESDIR}/${P}-gcc47.patch"
+ "${FILESDIR}/${P}-gcc6.patch"
+ "${FILESDIR}/${P}-llvm.patch"
+ "${FILESDIR}/${P}-libpng15.patch"
+ "${FILESDIR}/${P}-docbuilder.patch"
+ "${FILESDIR}/${P}-glibc2.34.patch"
+ "${FILESDIR}/${P}-gcc12.patch"
+ "${FILESDIR}"/${P}-makefile-duplicate-headers.patch
+)
+
+DOCS=(
+ CODING_STYLE CREDITS NEWS PATCHES
+ README{,.anjuta,.distros,.kdevelop,.sdl,.upgrade} INSTALL.linux
+)
+
+src_prepare() {
+ default
+ eautoreconf
+ # See #739358
+ sed -i -e "s:libdir=\${exec_prefix}/lib:libdir=@libdir@:g" \
+ pkgconfig/*.pc.in || die
+}
+
+src_configure() {
+ # -Werror=strict-aliasing
+ # https://bugs.gentoo.org/855308
+ # Fixed in newer versions
+ # Do not trust with LTO either.
+ append-flags -fno-strict-aliasing
+ filter-lto
+
+ # clanSound only controls mikmod/vorbis so there's
+ # no need to pass --{en,dis}able-clanSound ...
+ # clanDisplay only controls X, SDL, OpenGL plugins
+ # so no need to pass --{en,dis}able-clanDisplay
+ # also same reason why we don't have to use clanGUI
+ econf \
+ --enable-dyn \
+ --enable-clanNetwork \
+ $(use_enable x86 asm386) \
+ $(use_enable doc docs) \
+ $(use_enable opengl clanGL) \
+ $(use_enable sdl clanSDL) \
+ $(use_enable vorbis clanVorbis) \
+ $(use_enable mikmod clanMikMod) \
+ $(use_enable ipv6 getaddr) \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+
+ if use doc ; then
+ dodir /usr/share/doc/${PF}/html
+ mv "${D}"/usr/share/doc/clanlib/* "${D}"/usr/share/doc/${PF}/html/ || die
+ rm -rf "${D}"/usr/share/doc/clanlib
+ cp -r Examples Resources "${D}"/usr/share/doc/${PF}/ || die
+ fi
+
+ find "${ED}" -name '*.la' -delete || die
+}
diff --git a/dev-games/clanlib/clanlib-2.3.7-r4.ebuild b/dev-games/clanlib/clanlib-2.3.7-r4.ebuild
new file mode 100644
index 000000000000..3ad9f0364f97
--- /dev/null
+++ b/dev-games/clanlib/clanlib-2.3.7-r4.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+MY_P=ClanLib-${PV}
+DESCRIPTION="Multi-platform game development library"
+HOMEPAGE="https://github.com/sphair/ClanLib"
+SRC_URI="mirror://gentoo/${MY_P}.tgz"
+S="${WORKDIR}"/${MY_P}
+
+LICENSE="ZLIB"
+SLOT="2.3"
+KEYWORDS="amd64 x86"
+IUSE="doc ipv6 mikmod opengl +sound sqlite cpu_flags_x86_sse2 static-libs vorbis X"
+REQUIRED_USE="opengl? ( X )"
+
+BDEPEND="
+ virtual/pkgconfig
+ doc? (
+ app-text/doxygen
+ dev-lang/perl
+ media-gfx/graphviz
+ )
+"
+RDEPEND="
+ virtual/zlib:=
+ X? (
+ app-arch/bzip2
+ media-libs/libpng:0
+ media-libs/freetype
+ media-libs/fontconfig
+ media-libs/libjpeg-turbo:0=
+ x11-libs/libX11
+ opengl? ( virtual/opengl )
+ )
+ mikmod? (
+ media-libs/alsa-lib
+ media-libs/libmikmod
+ )
+ sqlite? ( dev-db/sqlite:3 )
+ sound? ( media-libs/alsa-lib )
+ vorbis? (
+ media-libs/alsa-lib
+ media-libs/libogg
+ media-libs/libvorbis
+ )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-autotools.patch
+ "${FILESDIR}"/${P}-doc.patch
+ "${FILESDIR}"/${P}-freetype_pkgconfig.patch #764902
+ "${FILESDIR}"/${P}-glibc2.34.patch
+ "${FILESDIR}"/${P}-32bit-opengl.patch
+ # From Fedora
+ "${FILESDIR}"/${P}-gcc47.patch
+ "${FILESDIR}"/${P}-gcc7.patch
+ "${FILESDIR}"/${P}-non-x86.patch
+ "${FILESDIR}"/${P}-no-ldflags-for-conftest.patch
+ "${FILESDIR}"/${P}-no-wm_type-in-fs.patch
+)
+
+DOCS=( CODING_STYLE CREDITS PATCHES README )
+
+src_prepare() {
+ default
+
+ eautoreconf
+
+ ln -sf ../../../Sources/API Documentation/Utilities/ReferenceDocs/ClanLib || die
+}
+
+src_configure() {
+ # Add -DPACKAGE_BUGREPORT?
+ local myeconfargs=(
+ $(use_enable doc docs)
+ $(use_enable cpu_flags_x86_sse2 sse2)
+ $(use_enable opengl clanGL)
+ $(use_enable opengl clanGL1)
+ $(use_enable opengl clanGUI)
+ $(use_enable X clanDisplay)
+ $(use_enable vorbis clanVorbis)
+ $(use_enable mikmod clanMikMod)
+ $(use_enable sqlite clanSqlite)
+ $(use_enable ipv6 getaddr)
+ $(use_enable static-libs static)
+ )
+
+ use sound \
+ || use vorbis \
+ || use mikmod \
+ || myeconfargs+=( --disable-clanSound )
+
+ tc-export PKG_CONFIG
+
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake
+
+ use doc && emake html
+}
+
+# html files are keeped in a directory that is dependent on the SLOT
+# so to keep eventual bookmarks to the doc from version to version
+src_install() {
+ default
+
+ find "${ED}" -type f -name '*.la' -delete || die
+
+ if use doc ; then
+ emake DESTDIR="${D}" install-html
+ dodoc -r Examples Resources
+ fi
+}
diff --git a/dev-games/clanlib/clanlib-4.1.0-r1.ebuild b/dev-games/clanlib/clanlib-4.1.0-r1.ebuild
new file mode 100644
index 000000000000..e927486dcde3
--- /dev/null
+++ b/dev-games/clanlib/clanlib-4.1.0-r1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+MY_PN=ClanLib
+
+DESCRIPTION="Multi-platform game development library"
+HOMEPAGE="https://github.com/sphair/ClanLib"
+SRC_URI="https://github.com/sphair/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+LICENSE="ZLIB"
+SLOT="4.1"
+KEYWORDS="amd64 x86" #not big endian safe #82779
+IUSE="cpu_flags_x86_sse2 doc examples ipv6 opengl +sound static-libs X"
+REQUIRED_USE="opengl? ( X )"
+
+RDEPEND="
+ virtual/zlib:=
+ X? (
+ media-libs/freetype:2
+ media-libs/fontconfig
+ x11-libs/libX11
+ opengl? (
+ virtual/opengl
+ x11-libs/libXrender
+ )
+ )
+ sound? ( media-libs/alsa-lib )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ virtual/pkgconfig
+ doc? (
+ app-text/doxygen
+ dev-lang/perl
+ media-gfx/graphviz
+ )"
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable doc docs)
+ $(use_enable cpu_flags_x86_sse2 sse2)
+ $(use_enable opengl clanGL)
+ $(use_enable opengl clanUI)
+ $(use_enable X clanDisplay)
+ $(use_enable sound clanSound)
+ $(use_enable ipv6 getaddr)
+ $(use_enable static-libs static)
+ )
+
+ tc-export PKG_CONFIG
+
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ default
+ use doc && emake html
+}
+
+src_install() {
+ default
+
+ use doc && emake DESTDIR="${D}" install-html
+ use examples && dodoc -r Examples Resources
+
+ # package provides .pc files
+ find "${ED}" -name '*.la' -delete || die
+}
diff --git a/dev-games/clanlib/clanlib-4.2.0.ebuild b/dev-games/clanlib/clanlib-4.2.0.ebuild
new file mode 100644
index 000000000000..ff3cd2806086
--- /dev/null
+++ b/dev-games/clanlib/clanlib-4.2.0.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+MY_PN=ClanLib
+
+DESCRIPTION="Multi-platform game development library"
+HOMEPAGE="https://github.com/sphair/ClanLib"
+SRC_URI="https://github.com/sphair/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+LICENSE="ZLIB"
+SLOT="4.2"
+KEYWORDS="amd64 x86" #not big endian safe #82779
+IUSE="cpu_flags_x86_sse2 doc examples opengl +sound static-libs X"
+REQUIRED_USE="opengl? ( X )"
+
+RDEPEND="
+ virtual/zlib:=
+ X? (
+ media-libs/freetype:2
+ media-libs/fontconfig
+ x11-libs/libX11
+ x11-libs/libXinerama
+ opengl? (
+ virtual/opengl
+ x11-libs/libXrender
+ )
+ )
+ sound? ( media-libs/alsa-lib )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ virtual/pkgconfig
+ doc? (
+ app-text/doxygen
+ dev-lang/perl
+ media-gfx/graphviz
+ )"
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --enable-getaddr
+ $(use_enable doc docs)
+ $(use_enable cpu_flags_x86_sse2 sse2)
+ $(use_enable opengl clanGL)
+ $(use_enable opengl clanUI)
+ $(use_enable X clanDisplay)
+ $(use_enable sound clanSound)
+ $(use_enable static-libs static)
+ )
+
+ tc-export PKG_CONFIG
+
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ default
+ use doc && emake html
+}
+
+src_install() {
+ default
+
+ use doc && emake DESTDIR="${D}" install-html
+ use examples && dodoc -r Examples Resources
+
+ # package provides .pc files
+ find "${ED}" -name '*.la' -delete || die
+}
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-docbuilder.patch b/dev-games/clanlib/files/clanlib-0.8.1-docbuilder.patch
new file mode 100644
index 000000000000..f5a35763c48d
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-docbuilder.patch
@@ -0,0 +1,28 @@
+--- a/Documentation/Utilities/webbuilder.pl.in
++++ b/Documentation/Utilities/webbuilder.pl.in
+@@ -68,11 +68,7 @@ sub convert
+ sub print_head
+ {
+ my ($xml_head, $file) = @ARG;
+- my $ml, $buffer;
+-
+- # Don't know what this does, but Perceps does it:
+- if ($*) { $ml=1; }
+- else { $ml=0; }
++ my $buffer;
+
+ # Read theme from disk and execute it:
+ if ( -e $file )
+@@ -93,11 +89,7 @@ sub print_head
+ sub print_body
+ {
+ my ($xml_body, $file) = @ARG;
+- my $ml, $buffer;
+-
+- # Don't know what this does, but Perceps does it:
+- if ($*) { $ml=1; }
+- else { $ml=0; }
++ my $buffer;
+
+ # Read theme from disk and execute it:
+ if ( -e $file )
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-gcc12.patch b/dev-games/clanlib/files/clanlib-0.8.1-gcc12.patch
new file mode 100644
index 000000000000..68ed616b3ca7
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-gcc12.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/877301
+--- a/Sources/API/Core/System/cl_assert.h
++++ b/Sources/API/Core/System/cl_assert.h
+@@ -33,6 +33,8 @@
+ #ifndef header_cl_assert
+ #define header_cl_assert
+
++#include <cstddef>
++
+ #ifdef CL_API_DLL
+ #ifdef CL_CORE_EXPORT
+ #define CL_API_CORE __declspec(dllexport)
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-gcc43.patch b/dev-games/clanlib/files/clanlib-0.8.1-gcc43.patch
new file mode 100644
index 000000000000..655e667ff7bf
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-gcc43.patch
@@ -0,0 +1,28 @@
+--- a/Sources/GL/opengl.cpp
++++ b/Sources/GL/opengl.cpp
+@@ -51,6 +51,8 @@
+ #endif
+ #endif
+
++#include <cstring>
++
+ std::vector<std::string> CL_OpenGL::m_ignored_gl_extension;
+
+ CL_ProcAddress *CL_OpenGL::get_proc_address(const std::string& function_name)
+@@ -414,4 +416,4 @@
+ #endif
+
+ m_ignored_gl_extension.push_back(extension_name);
+-}
+\ No newline at end of file
++}
+--- a/Sources/Network/Socket/ip_address_getsock.cpp
++++ b/Sources/Network/Socket/ip_address_getsock.cpp
+@@ -40,6 +40,7 @@
+ #include "ip_address_getsock.h"
+
+ #include <cstdlib>
++#include <cstring>
+
+ #ifndef WIN32
+ #include <sys/socket.h>
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-gcc44.patch b/dev-games/clanlib/files/clanlib-0.8.1-gcc44.patch
new file mode 100644
index 000000000000..0851074bddcb
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-gcc44.patch
@@ -0,0 +1,30 @@
+--- a/Sources/GL/canvas_opengl.cpp
++++ b/Sources/GL/canvas_opengl.cpp
+@@ -48,6 +48,7 @@
+ #include "graphic_context_opengl.h"
+ #include "surface_target_opengl.h"
+ #include <cstring>
++#include <cstdio>
+
+ /////////////////////////////////////////////////////////////////////////////
+ // CL_Canvas_OpenGL construction:
+--- a/Sources/GL/GLX/input_device_linuxevent.cpp
++++ b/Sources/GL/GLX/input_device_linuxevent.cpp
+@@ -35,6 +35,7 @@
+ #include <iostream>
+ #include <errno.h>
+ #include <cstring>
++#include <cstdio>
+
+ #include "API/Core/System/error.h"
+ #include "API/Core/System/clanstring.h"
+--- a/Sources/GL/GLX/input_device_xinput.cpp
++++ b/Sources/GL/GLX/input_device_xinput.cpp
+@@ -29,6 +29,7 @@
+
+ #include <iostream>
+ #include <cstring>
++#include <cstdio>
+ #include "API/Core/System/log.h"
+ #include "API/Display/input_device.h"
+ #include "API/Display/input_event.h"
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-gcc47.patch b/dev-games/clanlib/files/clanlib-0.8.1-gcc47.patch
new file mode 100644
index 000000000000..db9b90ff9d23
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-gcc47.patch
@@ -0,0 +1,10 @@
+--- a/Sources/Core/IOData/Generic/inputsource_file.cpp
++++ b/Sources/Core/IOData/Generic/inputsource_file.cpp
+@@ -32,6 +32,7 @@
+ #ifdef WIN32
+ #include <direct.h>
+ #endif
++#include <unistd.h>
+ #include <cstring>
+ #include <API/Core/IOData/inputsource_file.h>
+
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-gcc6.patch b/dev-games/clanlib/files/clanlib-0.8.1-gcc6.patch
new file mode 100644
index 000000000000..95284c2de4ca
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-gcc6.patch
@@ -0,0 +1,16 @@
+Bug: https://bugs.gentoo.org/596112
+
+--- a/Sources/Core/IOData/Generic/datafile_inputprovider.h
++++ b/Sources/Core/IOData/Generic/datafile_inputprovider.h
+@@ -142,9 +142,9 @@
+ void insert(const std::string &resource_id, int data_pos, int data_size)
+ {
+ cache.insert(
+- std::make_pair<std::string const, std::pair<int, int> >(
++ std::pair<std::string const, std::pair<int, int> >(
+ resource_id,
+- std::make_pair<int,int>(data_pos, data_size)));
++ std::pair<int,int>(data_pos, data_size)));
+ }
+
+ private:
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-glibc2.34.patch b/dev-games/clanlib/files/clanlib-0.8.1-glibc2.34.patch
new file mode 100644
index 000000000000..85c20ccdbcfd
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-glibc2.34.patch
@@ -0,0 +1,17 @@
+pthread_mutexattr_setkind_np() is long deprecated and should be using
+pthread_mutexattr_settype() instead even on Linux. Fixes consumers
+when built against glibc-2.34.
+
+https://bugs.gentoo.org/808707
+--- a/Sources/Core/System/Unix/mutex_pthread.cpp
++++ b/Sources/Core/System/Unix/mutex_pthread.cpp
+@@ -42,3 +42,3 @@
+ {
+-#ifdef __FreeBSD__
++#if 1
+ int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
+@@ -65,3 +65,3 @@
+ #else
+-#ifdef __FreeBSD__
++#if 1
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-libpng15.patch b/dev-games/clanlib/files/clanlib-0.8.1-libpng15.patch
new file mode 100644
index 000000000000..81a216f221ad
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-libpng15.patch
@@ -0,0 +1,11 @@
+--- a/Sources/Display/Providers/png_provider_generic.cpp
++++ b/Sources/Display/Providers/png_provider_generic.cpp
+@@ -107,7 +107,7 @@
+ png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
+ cl_assert(false);
+ }
+- if (setjmp(png_ptr->jmpbuf))
++ if (setjmp(png_jmpbuf(png_ptr)))
+ {
+ png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
+ cl_assert(false);
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-llvm.patch b/dev-games/clanlib/files/clanlib-0.8.1-llvm.patch
new file mode 100644
index 000000000000..63f9a1415423
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-llvm.patch
@@ -0,0 +1,87 @@
+--- a/Sources/Display/graphic_context.cpp
++++ b/Sources/Display/graphic_context.cpp
+@@ -237,18 +237,18 @@ void CL_GraphicContext::fill_triangle(
+ grad.bottom_left.get_alpha()/256.0};
+ */
+ unsigned char color_array[] = {
+- grad.top_left.get_red(),
+- grad.top_left.get_green(),
+- grad.top_left.get_blue(),
+- grad.top_left.get_alpha(),
+- grad.top_right.get_red(),
+- grad.top_right.get_green(),
+- grad.top_right.get_blue(),
+- grad.top_right.get_alpha(),
+- grad.bottom_left.get_red(),
+- grad.bottom_left.get_green(),
+- grad.bottom_left.get_blue(),
+- grad.bottom_left.get_alpha()};
++ static_cast<unsigned char>(grad.top_left.get_red()),
++ static_cast<unsigned char>(grad.top_left.get_green()),
++ static_cast<unsigned char>(grad.top_left.get_blue()),
++ static_cast<unsigned char>(grad.top_left.get_alpha()),
++ static_cast<unsigned char>(grad.top_right.get_red()),
++ static_cast<unsigned char>(grad.top_right.get_green()),
++ static_cast<unsigned char>(grad.top_right.get_blue()),
++ static_cast<unsigned char>(grad.top_right.get_alpha()),
++ static_cast<unsigned char>(grad.bottom_left.get_red()),
++ static_cast<unsigned char>(grad.bottom_left.get_green()),
++ static_cast<unsigned char>(grad.bottom_left.get_blue()),
++ static_cast<unsigned char>(grad.bottom_left.get_alpha())};
+
+ params.count = 1;
+ params.vertices = vertice_array;
+--- a/Sources/GL/graphic_context_opengl.cpp
++++ b/Sources/GL/graphic_context_opengl.cpp
+@@ -355,8 +355,8 @@ void CL_GraphicContext_OpenGL::draw_quad(const CL_Quad &quad, const CL_Color &co
+ state.blendfunc[3] = blend_one_minus_src_alpha;
+ state.fillmode = fillmode_line;
+
+- double qx[4] = { quad.x1, quad.x2, quad.x3, quad.x4 };
+- double qy[4] = { quad.y1, quad.y2, quad.y3, quad.y4 };
++ double qx[4] = { static_cast<double>(quad.x1), static_cast<double>(quad.x2), static_cast<double>(quad.x3), static_cast<double>(quad.x4) };
++ double qy[4] = { static_cast<double>(quad.y1), static_cast<double>(quad.y2), static_cast<double>(quad.y3), static_cast<double>(quad.y4) };
+ int tx[4] = { quad.x1, quad.x2, quad.x3, quad.x4 };
+ int ty[4] = { quad.y1, quad.y2, quad.y3, quad.y4 };
+
+@@ -380,8 +380,8 @@ void CL_GraphicContext_OpenGL::fill_quad(const CL_Quad &quad, const CL_Color &co
+ state.blendfunc[3] = blend_one_minus_src_alpha;
+ state.fillmode = fillmode_solid;
+
+- double qx[4] = { quad.x1, quad.x2, quad.x3, quad.x4 };
+- double qy[4] = { quad.y1, quad.y2, quad.y3, quad.y4 };
++ double qx[4] = { static_cast<double>(quad.x1), static_cast<double>(quad.x2), static_cast<double>(quad.x3), static_cast<double>(quad.x4) };
++ double qy[4] = { static_cast<double>(quad.y1), static_cast<double>(quad.y2), static_cast<double>(quad.y3), static_cast<double>(quad.y4) };
+ int tx[4] = { quad.x1, quad.x2, quad.x3, quad.x4 };
+ int ty[4] = { quad.y1, quad.y2, quad.y3, quad.y4 };
+
+--- a/Sources/SDL/graphic_context_sdl.cpp
++++ b/Sources/SDL/graphic_context_sdl.cpp
+@@ -410,7 +410,7 @@ void CL_GraphicContext_SDL::update_cliprect()
+ }
+ else
+ {
+- SDL_Rect crect = {rect.left,rect.top,rect.get_width(),rect.get_height()};
++ SDL_Rect crect = {static_cast<Sint16>(rect.left),static_cast<Sint16>(rect.top),static_cast<Uint16>(rect.get_width()),static_cast<Uint16>(rect.get_height())};
+ SDL_SetClipRect(SDL_GetVideoSurface(),&crect);
+ }
+ }
+--- a/Sources/SDL/surface_sdl.cpp
++++ b/Sources/SDL/surface_sdl.cpp
+@@ -259,13 +259,13 @@ void CL_Surface_SDL::draw(
+ CL_Surface_TargetDrawParams1 *t_params1,
+ CL_GraphicContext *context)
+ {
+- SDL_Rect source = {params2.srcX, params2.srcY, params2.srcWidth, params2.srcHeight};
++ SDL_Rect source = {static_cast<Sint16>(params2.srcX), static_cast<Sint16>(params2.srcY), static_cast<Uint16>(params2.srcWidth), static_cast<Uint16>(params2.srcHeight)};
+
+ SDL_Rect dst = {
+ static_cast<Sint16>(t_params1->pixDestX + context->get_modelview().get_origin_x()),
+ static_cast<Sint16>(t_params1->pixDestY + context->get_modelview().get_origin_y()),
+- static_cast<Sint16>(t_params1->destWidth),
+- static_cast<Sint16>(t_params1->destHeight)
++ static_cast<Uint16>(t_params1->destWidth),
++ static_cast<Uint16>(t_params1->destHeight)
+ };
+
+ if (t_params1->destWidth == params2.srcWidth && t_params1->destHeight == params2.srcHeight)
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-makefile-duplicate-headers.patch b/dev-games/clanlib/files/clanlib-0.8.1-makefile-duplicate-headers.patch
new file mode 100644
index 000000000000..cdd7e67f83ab
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-makefile-duplicate-headers.patch
@@ -0,0 +1,29 @@
+From 54eb2a8e72f782792ab53d7c989deec52059990a Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Sun, 30 Jun 2024 19:24:50 -0400
+Subject: [PATCH] build: fix duplicated header in Makefile.am
+
+Regenerating configure/Makefiles with newer autotools versions results
+in build failures: a more optimized routine is used for installing
+headers in bulk, which is sensitive to listing the same file twice as
+part of a single `install ...` invocation. Not present in newer clanlib
+versions.
+---
+ Sources/API/Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Sources/API/Makefile.am b/Sources/API/Makefile.am
+index 5686330..8dcb56e 100644
+--- a/Sources/API/Makefile.am
++++ b/Sources/API/Makefile.am
+@@ -232,7 +232,6 @@ clanCore_includes = \
+ Core/System/event_trigger.h \
+ Core/System/console_window.h \
+ Core/System/keep_alive.h \
+- Core/System/log.h \
+ Core/System/crash_reporter.h \
+ Core/System/call_stack.h \
+ Core/System/clanstring.h \
+--
+2.44.2
+
diff --git a/dev-games/clanlib/files/clanlib-0.8.1-ndebug.patch b/dev-games/clanlib/files/clanlib-0.8.1-ndebug.patch
new file mode 100644
index 000000000000..b9a891e99a7a
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-0.8.1-ndebug.patch
@@ -0,0 +1,20 @@
+Patch for clanlib-0.7.8-r2 Bug 154513:
+
+Signal handler deinit() was not declared.
+
+This leads to a compilation failure when a release version
+rather than a debug version is built (-DNDEBUG).
+
+This patch adds the missing declaration, thus make the
+file compile with or without -DNDEBUG.
+
+--- a/Sources/Core/System/Unix/init_linux.cpp
++++ b/Sources/Core/System/Unix/init_linux.cpp
+@@ -52,6 +52,7 @@
+ _begin_time = (long) tv.tv_sec*(long) 1000+(long) tv.tv_usec/(long) 1000;
+
+ #ifdef NDEBUG
++ sighandler_t deinit;
+ signal(SIGSEGV, deinit);
+ #endif
+ }
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-32bit-opengl.patch b/dev-games/clanlib/files/clanlib-2.3.7-32bit-opengl.patch
new file mode 100644
index 000000000000..73d5287c5dd9
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-32bit-opengl.patch
@@ -0,0 +1,19 @@
+Patch taken from Fedora, removes redefinitions that conflicts on x86.
+--- a/Sources/API/GL/opengl_defines.h
++++ b/Sources/API/GL/opengl_defines.h
+@@ -69,6 +69,4 @@
+ typedef void GLvoid;
+ typedef char GLchar;
+-typedef ptrdiff_t GLintptr;
+-typedef ptrdiff_t GLsizeiptr;
+ typedef struct __CLsync *CLsync;
+
+--- a/Sources/API/GL1/opengl1_defines.h
++++ b/Sources/API/GL1/opengl1_defines.h
+@@ -65,6 +65,4 @@
+ typedef void GLvoid;
+ typedef char GLchar;
+-typedef ptrdiff_t GLintptr;
+-typedef ptrdiff_t GLsizeiptr;
+
+ #else
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-autotools.patch b/dev-games/clanlib/files/clanlib-2.3.7-autotools.patch
new file mode 100644
index 000000000000..eccc7e291323
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-autotools.patch
@@ -0,0 +1,45 @@
+--- a/Documentation/Reference/Makefile.am
++++ b/Documentation/Reference/Makefile.am
+@@ -10,7 +10,7 @@
+ mkdir doxyoutput;
+ mkdir reftest
+ doxygen ./clanlib.doxygen
+- make -C ../Utilities/ReferenceDocs
++ $(MAKE) -C ../Utilities/ReferenceDocs
+ ../Utilities/ReferenceDocs/ReferenceDocs
+
+ install-html:
+--- a/configure.ac
++++ b/configure.ac
+@@ -337,11 +337,9 @@
+
+ dnl Optional linux/joystick.h
+ AC_CHECK_HEADERS(linux/joystick.h, linux_joystick=yes)
+- AM_CONDITIONAL(LINUX_JOYSTICK, test x$linux_joystick = xyes)
+
+ dnl Optional linux/input.h
+ AC_CHECK_HEADERS(linux/input.h, linux_input=yes)
+- AM_CONDITIONAL(LINUX_INPUT, test x$linux_input = xyes)
+
+ if test "$WIN32" = "no" && test "$enable_clanDisplay" != "no"; then
+ CLANLIB_CHECK_LIB(fontconfig, [`cat $srcdir/Setup/Tests/fontconfig.cpp`], clanDisplay, [ *** Cannot find fontconfig (See http://fontconfig.org/ ) (Try libfontconfig1-dev or better) ], [-lfontconfig])
+@@ -358,6 +356,8 @@
+ clanDisplay, [ *** Cannot find version 8 of DirectInput], [-ldxguid -lole32 -ldinput8])
+ fi
+ fi
++AM_CONDITIONAL(LINUX_JOYSTICK, test x$linux_joystick = xyes)
++AM_CONDITIONAL(LINUX_INPUT, test x$linux_input = xyes)
+
+ have_xrender=no
+
+@@ -515,9 +515,9 @@
+ fi
+
+ if test "$enable_clanSound" = "auto"; then enable_clanSound=yes; fi
+- AM_CONDITIONAL(ALSA, test x$have_alsa = xyes)
+
+ fi
++AM_CONDITIONAL(ALSA, test x$have_alsa = xyes)
+
+ if test "$enable_clanSound" != "no"; then
+ enable_clanSound=yes
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-doc.patch b/dev-games/clanlib/files/clanlib-2.3.7-doc.patch
new file mode 100644
index 000000000000..d207f2df3cca
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-doc.patch
@@ -0,0 +1,14 @@
+--- a/Documentation/Utilities/ReferenceDocs/Makefile
++++ b/Documentation/Utilities/ReferenceDocs/Makefile
+@@ -3,7 +3,10 @@
+ LIBS=clanCore
+ EXTRA_LIBS=-lpthread
+
+-include ../../../Examples/Makefile.conf
++CXXFLAGS += -pthread -std=c++0x -I.
++all: $(EXAMPLE_BIN)
++$(EXAMPLE_BIN): $(OBJF)
++ $(CXX) $(CXXFLAGS) $(OBJF) -o $(EXAMPLE_BIN) -Wl,-R../../Sources/Core/.libs -L../../../Sources/Core/.libs -lclan23Core $(EXTRA_LIBS)
+
+ # EOF #
+
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-freetype_pkgconfig.patch b/dev-games/clanlib/files/clanlib-2.3.7-freetype_pkgconfig.patch
new file mode 100644
index 000000000000..cadb3b90b530
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-freetype_pkgconfig.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/764902
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -342,7 +342,7 @@
+ echo "=============================="
+ CLANLIB_CHECK_LIB(png, [`cat $srcdir/Setup/Tests/png.cpp`], clanDisplay, [ *** Cannot find png (See http://www.libpng.org ) (Try libpng12-dev or better) ], [-lz -lpng])
+ CLANLIB_CHECK_LIB(jpeg, [`cat $srcdir/Setup/Tests/jpeg.cpp`], clanDisplay, [ *** Cannot find jpeg (See http://www.ijg.org ) (Try libjpeg62-dev or better) ], [ -ljpeg])
+- CLANLIB_CHECK_LIB(ttf, [`cat $srcdir/Setup/Tests/ttf.cpp`], clanDisplay, [ *** Cannot find ttf (freetype) (See http://freetype.sourceforge.net ) (Try libfreetype6-dev or better) ], [`freetype-config --libs` ], [ `freetype-config --cflags`])
++ CLANLIB_CHECK_LIB(ttf, [`cat $srcdir/Setup/Tests/ttf.cpp`], clanDisplay, [ *** Cannot find ttf (freetype) (See http://freetype.sourceforge.net ) (Try libfreetype6-dev or better) ], [`${PKG_CONFIG} --libs freetype2` ], [ `${PKG_CONFIG} --cflags freetype2`])
+
+ dnl Optional linux/joystick.h
+ AC_CHECK_HEADERS(linux/joystick.h, linux_joystick=yes)
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-gcc47.patch b/dev-games/clanlib/files/clanlib-2.3.7-gcc47.patch
new file mode 100644
index 000000000000..58b55ccf0291
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-gcc47.patch
@@ -0,0 +1,107 @@
+diff -up ClanLib-2.3.4/Sources/Core/IOData/file_help.cpp~ ClanLib-2.3.4/Sources/Core/IOData/file_help.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/file_help.cpp~ 2011-07-22 10:03:21.000000000 +0200
++++ ClanLib-2.3.4/Sources/Core/IOData/file_help.cpp 2012-01-12 22:16:39.779011207 +0100
+@@ -34,6 +34,7 @@
+ #include "API/Core/System/exception.h"
+
+ #ifndef WIN32
++#include <unistd.h>
+ #include <sys/stat.h>
+ #endif
+
+diff -up ClanLib-2.3.4/Sources/Core/IOData/path_help.cpp~ ClanLib-2.3.4/Sources/Core/IOData/path_help.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/path_help.cpp~ 2011-08-03 10:13:57.000000000 +0200
++++ ClanLib-2.3.4/Sources/Core/IOData/path_help.cpp 2012-01-12 22:18:30.754009662 +0100
+@@ -43,6 +43,7 @@
+
+ #ifndef WIN32
+ #include <cstring>
++#include <unistd.h>
+ #endif
+
+ /////////////////////////////////////////////////////////////////////////////
+diff -up ClanLib-2.3.4/Sources/Core/IOData/iodevice_provider_pipe_connection.cpp~ ClanLib-2.3.4/Sources/Core/IOData/iodevice_provider_pipe_connection.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/iodevice_provider_pipe_connection.cpp~ 2011-01-27 10:03:39.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/IOData/iodevice_provider_pipe_connection.cpp 2012-01-12 22:24:55.536004557 +0100
+@@ -33,6 +33,7 @@
+ #include "API/Core/Text/string_help.h"
+ #include "API/Core/Text/string_format.h"
+ #ifndef WIN32
++#include <unistd.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ #ifndef UNIX_PATH_MAX
+diff -up ClanLib-2.3.4/Sources/Core/IOData/pipe_listen_impl.cpp~ ClanLib-2.3.4/Sources/Core/IOData/pipe_listen_impl.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/pipe_listen_impl.cpp~ 2011-01-13 12:17:34.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/IOData/pipe_listen_impl.cpp 2012-01-12 22:25:17.359004259 +0100
+@@ -36,6 +36,7 @@
+ #include "API/Core/Text/string_help.h"
+ #ifndef WIN32
+ #include "Network/Socket/event_provider_unixsocket.h"
++#include <unistd.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ #ifndef UNIX_PATH_MAX
+diff -up ClanLib-2.3.4/Sources/Core/IOData/security_identifier.cpp~ ClanLib-2.3.4/Sources/Core/IOData/security_identifier.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/security_identifier.cpp~ 2011-01-13 12:17:34.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/IOData/security_identifier.cpp 2012-01-12 22:26:06.047003649 +0100
+@@ -31,6 +31,9 @@
+ #include "API/Core/System/exception.h"
+ #ifdef WIN32
+ #include <AclAPI.h>
++#else
++#include <unistd.h>
++#include <sys/types.h>
+ #endif
+
+ /////////////////////////////////////////////////////////////////////////////
+diff -up ClanLib-2.3.4/Sources/Core/IOData/virtual_directory.cpp~ ClanLib-2.3.4/Sources/Core/IOData/virtual_directory.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/virtual_directory.cpp~ 2011-11-25 09:16:46.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/IOData/virtual_directory.cpp 2012-01-12 22:26:37.583003215 +0100
+@@ -38,6 +38,10 @@
+ #include "API/Core/System/weakptr.h"
+ #include "API/Core/Text/string_help.h"
+
++#ifndef WIN32
++#include <unistd.h>
++#endif
++
+ /////////////////////////////////////////////////////////////////////////////
+ // CL_VirtualDirectory_Impl Class:
+
+diff -up ClanLib-2.3.4/Sources/Core/System/Unix/service_unix.cpp~ ClanLib-2.3.4/Sources/Core/System/Unix/service_unix.cpp
+--- ClanLib-2.3.4/Sources/Core/System/Unix/service_unix.cpp~ 2011-01-13 12:17:34.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/System/Unix/service_unix.cpp 2012-01-12 22:29:12.478001042 +0100
+@@ -35,6 +35,7 @@
+ #include "service_unix.h"
+ #include <iostream>
+ #include <signal.h>
++#include <unistd.h>
+
+ /////////////////////////////////////////////////////////////////////////////
+ // CL_Service_Unix Construction:
+diff -up ClanLib-2.3.4/Sources/Core/Text/console_logger.cpp~ ClanLib-2.3.4/Sources/Core/Text/console_logger.cpp
+--- ClanLib-2.3.4/Sources/Core/Text/console_logger.cpp~ 2011-01-13 12:17:34.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/Text/console_logger.cpp 2012-01-12 22:27:54.446002158 +0100
+@@ -33,6 +33,10 @@
+ #include "API/Core/Text/string_format.h"
+ #include "API/Core/System/datetime.h"
+
++#ifndef WIN32
++#include <unistd.h>
++#endif
++
+ /////////////////////////////////////////////////////////////////////////////
+ // CL_ConsoleLogger Construction:
+
+diff -up ClanLib-2.3.4/Sources/Display/X11/x11_window.cpp~ ClanLib-2.3.4/Sources/Display/X11/x11_window.cpp
+--- ClanLib-2.3.4/Sources/Display/X11/x11_window.cpp~ 2012-01-12 22:18:49.000000000 +0100
++++ ClanLib-2.3.4/Sources/Display/X11/x11_window.cpp 2012-01-12 22:30:46.492999847 +0100
+@@ -50,6 +50,7 @@
+ #include "display_message_queue_x11.h"
+ #include <X11/Xatom.h>
+ #include <cstdio>
++#include <unistd.h>
+ #include "../Window/input_context_impl.h"
+ #include <X11/XKBlib.h>
+ #include <dlfcn.h>
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-gcc7.patch b/dev-games/clanlib/files/clanlib-2.3.7-gcc7.patch
new file mode 100644
index 000000000000..22cce76debfb
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-gcc7.patch
@@ -0,0 +1,20 @@
+diff -up ClanLib-2.3.7/configure.ac~ ClanLib-2.3.7/configure.ac
+--- ClanLib-2.3.7/configure.ac~ 2012-04-11 08:55:49.000000000 +0200
++++ ClanLib-2.3.7/configure.ac 2017-02-21 11:57:23.482504683 +0100
+@@ -119,7 +119,6 @@ case $target in
+ *)
+ X11="yes"
+ WIN32="no"
+- CXXFLAGS="$CXXFLAGS -std=c++0x"
+ ;;
+ esac
+
+@@ -259,7 +258,7 @@ if test "$use_sse2" != "no"; then
+ fi
+
+ if test "$WIN32" = "no"; then
+- extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -pthread -std=c++0x"
++ extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -pthread"
+ else
+ extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -mthreads -std=c++0x"
+ fi
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-glibc2.34.patch b/dev-games/clanlib/files/clanlib-2.3.7-glibc2.34.patch
new file mode 100644
index 000000000000..05e7320428ca
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-glibc2.34.patch
@@ -0,0 +1,17 @@
+pthread_mutexattr_setkind_np() is long deprecated and should be using
+pthread_mutexattr_settype() instead even on Linux. Fixes consumers
+when built against glibc-2.34.
+
+https://bugs.gentoo.org/811591
+--- a/Sources/Core/System/mutex.cpp
++++ b/Sources/Core/System/mutex.cpp
+@@ -37,3 +37,3 @@
+ {
+-#if defined(__APPLE__) || defined (__FreeBSD__) || defined(__OpenBSD__)
++#if 1
+ int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
+@@ -55,3 +55,3 @@
+ pthread_mutexattr_init(&attr);
+- #if defined(__FreeBSD__) || defined(__APPLE__)
++ #if 1
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-no-ldflags-for-conftest.patch b/dev-games/clanlib/files/clanlib-2.3.7-no-ldflags-for-conftest.patch
new file mode 100644
index 000000000000..c22e58106485
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-no-ldflags-for-conftest.patch
@@ -0,0 +1,19 @@
+diff -up ClanLib-2.3.7/acinclude.m4~ ClanLib-2.3.7/acinclude.m4
+--- ClanLib-2.3.7/acinclude.m4~ 2011-11-24 11:57:30.000000000 +0100
++++ ClanLib-2.3.7/acinclude.m4 2015-04-02 15:22:52.060631122 +0200
+@@ -5,6 +5,7 @@ dnl CLANLIB_CHECK_LIB(lib, testprog, mod
+ define([CLANLIB_CHECK_LIB],[if test "$enable_$3" != "no"; then
+ OLDLIBS="$LIBS"; LIBS="$5"; AC_MSG_CHECKING(for $1)
+ OLD_CXXFLAGS="$CXXFLAGS"; CXXFLAGS="$6";
++ OLD_LDFLAGS="$LDFLAGS"; LDFLAGS=;
+ AC_RUN_IFELSE([AC_LANG_SOURCE($2)], [CL_RESULT=yes], [CL_RESULT=no], [AC_LINK_IFELSE([AC_LANG_SOURCE($2)], [CL_RESULT="yes, linked"],[CL_RESULT=no])])
+ AC_MSG_RESULT([$CL_RESULT])
+ if test "$CL_RESULT" = "no"; then
+@@ -14,6 +15,7 @@ define([CLANLIB_CHECK_LIB],[if test "$en
+ extra_LIBS_$3=" $extra_LIBS_$3 $LIBS "
+ fi
+ CXXFLAGS="$OLD_CXXFLAGS"
++ LDFLAGS="$OLD_LDFLAGS"
+ LIBS="$OLDLIBS"
+ fi])
+
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-no-wm_type-in-fs.patch b/dev-games/clanlib/files/clanlib-2.3.7-no-wm_type-in-fs.patch
new file mode 100644
index 000000000000..48799baa42c2
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-no-wm_type-in-fs.patch
@@ -0,0 +1,12 @@
+diff -up ClanLib-2.3.7/Sources/Display/X11/x11_window.cpp~ ClanLib-2.3.7/Sources/Display/X11/x11_window.cpp
+--- ClanLib-2.3.7/Sources/Display/X11/x11_window.cpp~ 2013-08-01 16:32:37.866001296 +0200
++++ ClanLib-2.3.7/Sources/Display/X11/x11_window.cpp 2013-08-01 16:33:26.267001811 +0200
+@@ -289,7 +289,7 @@ void CL_X11Window::create(XVisualInfo *v
+ // Retrieve the frame size (emulating microsoft windows)
+ bool window_is_frameless = false;
+ bool window_has_thin_frame = false;
+- if ((!desc.has_caption()) || (!desc.get_decorations()))
++ if (!desc.is_fullscreen() && (!desc.has_caption() || !desc.get_decorations()))
+ {
+ if (desc.is_tool_window())
+ {
diff --git a/dev-games/clanlib/files/clanlib-2.3.7-non-x86.patch b/dev-games/clanlib/files/clanlib-2.3.7-non-x86.patch
new file mode 100644
index 000000000000..acaa8520b645
--- /dev/null
+++ b/dev-games/clanlib/files/clanlib-2.3.7-non-x86.patch
@@ -0,0 +1,38 @@
+diff -up ClanLib-2.3.6/Sources/Core/System/detect_cpu_ext.cpp.non-x86 ClanLib-2.3.6/Sources/Core/System/detect_cpu_ext.cpp
+--- ClanLib-2.3.6/Sources/Core/System/detect_cpu_ext.cpp.non-x86 2011-11-15 13:15:42.000000000 +0100
++++ ClanLib-2.3.6/Sources/Core/System/detect_cpu_ext.cpp 2013-01-08 13:33:20.000000000 +0100
+@@ -30,7 +30,7 @@
+ #include "Core/precomp.h"
+ #include "API/Core/System/system.h"
+
+-#ifdef CL_ARM_PLATFORM
++#if ! (defined(__i386__) || defined(__x86_64__) || defined(__amd64__))
+ bool CL_System::detect_cpu_extension(CL_CPU_ExtensionPPC ext)
+ {
+ throw ("Congratulations, you've just been selected to code this feature!");
+@@ -48,11 +48,12 @@ bool CL_System::detect_cpu_extension(CL_
+ #ifdef __GNUC__
+
+
+-#ifdef __amd64__
++#if defined(__amd64__) || defined(__x86_64__)
+
+ #define __cpuid(out, infoType)\
+ asm("cpuid": "=a" ((out)[0]), "=b" ((out)[1]), "=c" ((out)[2]), "=d" ((out)[3]): "a" (infoType));
+-#else
++
++#elif defined(__i386__)
+
+ #define __cpuid(out, infoType) \
+ asm volatile( "pushl %%ebx \n" \
+@@ -61,6 +62,10 @@ bool CL_System::detect_cpu_extension(CL_
+ "popl %%ebx" \
+ : "=a" ((out)[0]), "=r" ((out)[1]), "=c" ((out)[2]), "=d" ((out)[3]): "a" (infoType));
+
++#else
++
++#define __cpuid(out, infoType) {}
++
+ #endif
+
+ #endif
diff --git a/dev-games/clanlib/metadata.xml b/dev-games/clanlib/metadata.xml
new file mode 100644
index 000000000000..f7ba18ede490
--- /dev/null
+++ b/dev-games/clanlib/metadata.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <longdescription>
+Welcome to ClanLib, a multi-platform game development library.
+
+ClanLib is a medium level development kit. At its lowest level, it provides a
+platform independent (as much as that is possible in C++) way of dealing with
+display, sound, input, networking, files, threadding and such.
+
+On top of that, ClanLib builds a generic game development framework, giving you
+easy handling of resources, network object replication, graphical user
+interfaces (GUI) with theme support, game scripting and more.
+
+The goal of ClanLib is to allow the game developer to focus on stuff that
+matters, avoiding all those nasty (and boring) lowlevel trivials like setting up
+a directdraw window, sound mixing, reading image files, etc. All those things
+are simplified into object oriented classes and function calls, making it a joy
+to write your game.
+
+ClanLib uses a resource system to keep track of images, fonts, samples and
+music. It supports Targa, PCX, JPEG, PNG and BMP for images. Wave files for
+sample. Ogg Vorbis (open sound format that has same sound quality as mp3) and
+MikMod for music. By using a resource system, you cleanly seperate the physical
+data formats from your code, and makes it easy to make themes and other plugins
+for your game. The resource system is written in a manner that allows you to add
+your own custom resources.
+
+All classes in clanlib focus on making simple interfaces that are customizeable
+and expandable. This keeps your game code clean and simple; but still allows you
+to do advanced stuff. As an example, look at some sound code:
+CL_SoundBuffer my_sample("Weapon/Minigun/sound", resources);
+my_sample.play();
+
+In this example, we play a simple sound effect, and afterwards forget all about
+it. Nice and simple. But if we want to adjust the frequency during its playback
+(eg. for a dobbler effect), it could look like this:
+CL_SoundBuffer_Session playback = my_sample.play();
+playback.set_frequency(1.2f); // increase frequency by 20%
+
+We only need to keep the session handle if we are going to use it. Keep things
+simple when they are simple, and make them complex when they are complex. :)
+
+The object oriented nature of ClanLib allows you to operate both at high and low
+levels, minimizing redundant code and still allows you to do stuff that isnt
+supported by clanlib's high level APIs.
+
+ClanLib currently support Windows 98, Windows 2000, Windows XP and Linux. The
+following display targets are supported under linux: X11 and OpenGL. Some parts
+of ClanLib still isnt entirely endian clean, so it will currently only work
+without problems on the x86 architecture. Work is underway for a MacOS port.
+Current compilers supported is VC++ 6.0, VC++ 7.0, GCC, Borland and MingW.
+ </longdescription>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>