commit:     2e08b4ad3c761f5095ec51b38c9bf298ad5349dc
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Wed May  7 08:48:08 2025 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu May  8 20:44:49 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e08b4ad

media-libs/libsfml: add 3.0.1

Based on the work on the work in NHorus's previous PR.

Closes: https://bugs.gentoo.org/951166
Thanks-To: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/41992
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 media-libs/libsfml/Manifest                        |  1 +
 .../libsfml/files/libsfml-3.0.0-catch-depend.patch | 28 +++++++
 media-libs/libsfml/libsfml-3.0.1.ebuild            | 97 ++++++++++++++++++++++
 3 files changed, 126 insertions(+)

diff --git a/media-libs/libsfml/Manifest b/media-libs/libsfml/Manifest
index dca278b61e11..e83c172b7051 100644
--- a/media-libs/libsfml/Manifest
+++ b/media-libs/libsfml/Manifest
@@ -1,2 +1,3 @@
 DIST libsfml-2.6.1.tar.gz 25499153 BLAKE2B 
0e4251d7aade5a596e9d0afdaa86d843fb5ba3ca63fc4f9dccb2e7db70aa8ae253af30dba68d57dd6869a6142818575e6fd843005a6e54fe186b20b573ad8f63
 SHA512 
b376d3b00277ed60d107fe1268c210749b3aafcee618a8f924b181a9b476e92b9cb9baddecf70a8913b5910c471d53ea0260a876ad7b2db2b98b944d9f508714
 DIST libsfml-2.6.2.tar.gz 28624288 BLAKE2B 
52442ef05a2719c1e7cd45ba15a4a41af7f3026c7c3a01c55993769bde39c9426962d640ffa2ac293dd4d90b9290b5f0895fffe7c10d3ffadbc189b10001c7ff
 SHA512 
d8a8bee3aa9acda4609104c2a9d4a2512e4be6d6e85fd4b24c287c03f60cfb888e669e61bfac4113dae35f0c3492559b65b3453baf38766d8c0223d9ab77aada
+DIST libsfml-3.0.1.tar.gz 4383964 BLAKE2B 
00aa84ae65ee5d3994b1eac365b7231dde60d9d18243d9282d9660773b46c7292e8abdd19d0a64ebe9526e746c43ba479e5301da111ccbf127a8d26305364981
 SHA512 
cee56eef93728aef9b361f8b1080572532ce5247c80a9d1be53b30dab4d67e8588316890555d4c4ba423e87b09f954327d70615e1ba72d458d8238fa84e589f9

diff --git a/media-libs/libsfml/files/libsfml-3.0.0-catch-depend.patch 
b/media-libs/libsfml/files/libsfml-3.0.0-catch-depend.patch
new file mode 100644
index 000000000000..5a22a1f0ac82
--- /dev/null
+++ b/media-libs/libsfml/files/libsfml-3.0.0-catch-depend.patch
@@ -0,0 +1,28 @@
+Unbundle dev-cpp/catch
+https://bugs.gentoo.org/951166
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -5,22 +5,9 @@
+
+ set(CATCH_CONFIG_FAST_COMPILE ON CACHE BOOL "")
+ set(CATCH_CONFIG_NO_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT ON CACHE BOOL "")
+-FetchContent_Declare(Catch2
+-    GIT_REPOSITORY https://github.com/catchorg/Catch2.git
+-    GIT_TAG v3.8.1
+-    GIT_SHALLOW ON)
+-FetchContent_MakeAvailable(Catch2)
++find_package(Catch2 REQUIRED)
+ include(Catch)
+
+-# Build Catch2 in C++17 mode to enable C++17 features
+-target_compile_features(Catch2 PRIVATE cxx_std_17)
+-
+-# Ensure that Catch2 sources and headers are not analyzed by any tools
+-set_target_properties(Catch2 PROPERTIES COMPILE_OPTIONS "" 
EXPORT_COMPILE_COMMANDS OFF)
+-set_target_properties(Catch2WithMain PROPERTIES EXPORT_COMPILE_COMMANDS OFF)
+-set_target_properties(Catch2 Catch2WithMain PROPERTIES FOLDER "Dependencies")
+-get_target_property(CATCH2_INCLUDE_DIRS Catch2 INTERFACE_INCLUDE_DIRECTORIES)
+-target_include_directories(Catch2 SYSTEM INTERFACE ${CATCH2_INCLUDE_DIRS})
+
+ add_library(sfml-test-main STATIC
+     TestUtilities/SystemUtil.hpp

diff --git a/media-libs/libsfml/libsfml-3.0.1.ebuild 
b/media-libs/libsfml/libsfml-3.0.1.ebuild
new file mode 100644
index 000000000000..4e900c2cb00d
--- /dev/null
+++ b/media-libs/libsfml/libsfml-3.0.1.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake virtualx
+
+DESCRIPTION="Simple and Fast Multimedia Library (SFML)"
+HOMEPAGE="https://www.sfml-dev.org/ https://github.com/SFML/SFML";
+SRC_URI="https://github.com/SFML/SFML/archive/${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/SFML-${PV}"
+
+LICENSE="ZLIB"
+# Vendored header dependencies:
+# glad
+LICENSE+=" Apache-2.0 || ( WTFPL-2 CC0-1.0 )"
+# miniaudio
+LICENSE+=" || ( MIT-0 public-domain )"
+# minimp3
+LICENSE+=" CC0-1.0"
+# stb_image
+LICENSE+=" || ( MIT public-domain )"
+# vulkan
+LICENSE+=" Apache-2.0"
+
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="doc examples test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       media-libs/flac:=
+       media-libs/freetype:2
+       media-libs/libogg
+       media-libs/libvorbis
+       virtual/opengl
+       x11-libs/libX11
+       x11-libs/libXcursor
+       x11-libs/libXi
+       x11-libs/libXrandr
+       x11-libs/libxcb
+       x11-libs/xcb-util-image
+       kernel_linux? ( virtual/libudev:= )
+"
+DEPEND="
+       ${RDEPEND}
+       x11-base/xorg-proto
+"
+BDEPEND="
+       doc? ( app-text/doxygen )
+       test? ( >=dev-cpp/catch-3.7.0 )
+"
+
+DOCS=( changelog.md readme.md )
+
+PATCHES=(
+       "${FILESDIR}"/libsfml-3.0.0-catch-depend.patch
+)
+
+src_configure() {
+       local mycmakeargs=(
+               -DSFML_BUILD_DOC=$(usex doc)
+               -DSFML_USE_SYSTEM_DEPS=ON
+               -DSFML_INSTALL_PKGCONFIG_FILES=ON
+               
-DSFML_PKGCONFIG_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)/pkgconfig/"
+               -DSFML_BUILD_TEST_SUITE=$(usex test)
+       )
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake_src_compile
+       use doc && cmake_build doc
+}
+
+src_test() {
+       local CMAKE_SKIP_TESTS=(
+               # Requires a more capable graphical enviroment (opengl?)
+               "sf::Window"
+               # Requires a running pulseaudio daemon to query
+               "sf::Sound"
+               "sf::SoundStream"
+               # Network sandbox
+               "sf::IpAddress"
+       )
+       virtx cmake_src_test
+}
+
+src_install() {
+       cmake_src_install
+
+       if use examples ; then
+               docompress -x /usr/share/doc/${PF}/examples
+               dodoc -r examples
+       fi
+}

Reply via email to