From: Pascal Stumpf Subject: Re: UPDATE: multimedia/sfml To: Rafael Sadowski Cc: ports@openbsd.org Date: Fri, 29 Aug 2025 20:58:36 +0200 On Sun, 24 Aug 2025 21:14:13 +0200, Rafael Sadowski wrote: > Simple update multimedia/sfml to 3.0. This update fix the > build with libc++19. I'd rather update to 2.6.2 with a patch from FreeBSD. 3.0.0 is apparently a major API change that breaks all dependent ports. Index: Makefile =================================================================== RCS file: /home/cvs/ports/multimedia/sfml/Makefile,v diff -u -p -r1.18 Makefile --- Makefile 15 Nov 2023 19:17:33 -0000 1.18 +++ Makefile 29 Aug 2025 18:54:56 -0000 @@ -1,16 +1,15 @@ COMMENT = simple and fast multimedia library -V = 2.5.1 +V = 2.6.2 DISTNAME = SFML-${V}-sources PKGNAME = sfml-${V} -REVISION = 0 EXTRACT_SUFX = .zip -SHARED_LIBS += sfml-audio 2.0 # 2.1 -SHARED_LIBS += sfml-graphics 2.0 # 2.1 -SHARED_LIBS += sfml-network 2.0 # 2.1 -SHARED_LIBS += sfml-system 2.0 # 2.1 -SHARED_LIBS += sfml-window 2.0 # 2.1 +SHARED_LIBS += sfml-audio 3.0 # 2.1 +SHARED_LIBS += sfml-graphics 3.0 # 2.1 +SHARED_LIBS += sfml-network 3.0 # 2.1 +SHARED_LIBS += sfml-system 3.0 # 2.1 +SHARED_LIBS += sfml-window 3.0 # 2.1 CATEGORIES = multimedia Index: distinfo =================================================================== RCS file: /home/cvs/ports/multimedia/sfml/distinfo,v diff -u -p -r1.3 distinfo --- distinfo 30 Dec 2021 19:12:40 -0000 1.3 +++ distinfo 29 Aug 2025 18:44:54 -0000 @@ -1,2 +1,2 @@ -SHA256 (SFML-2.5.1-sources.zip) = vx4GQ6y5I2myRXK3A0c69gusgsr1r2HnfAY7d5Rxu38= -SIZE (SFML-2.5.1-sources.zip) = 23283095 +SHA256 (SFML-2.6.2-sources.zip) = Gdbb2ckBx0RB2YiME8sTmfYU/omT1ZBipyz7zrAP7QQ= +SIZE (SFML-2.6.2-sources.zip) = 29075976 Index: patches/patch-CMakeLists_txt =================================================================== RCS file: patches/patch-CMakeLists_txt diff -N patches/patch-CMakeLists_txt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-CMakeLists_txt 29 Aug 2025 18:53:39 -0000 @@ -0,0 +1,16 @@ +Index: CMakeLists.txt +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -292,7 +292,11 @@ if(SFML_INSTALL_PKGCONFIG_FILES) + # this could be e.g. macports on mac or msys2 on windows etc. + set(SFML_PKGCONFIG_DIR "/${SFML_RELATIVE_INSTALL_LIBDIR}/pkgconfig") + +- if(SFML_OS_FREEBSD OR SFML_OS_OPENBSD OR SFML_OS_NETBSD) ++ if(SFML_OS_OPENBSD) ++ set(SFML_PKGCONFIG_DIR "/lib/pkgconfig") ++ endif() ++ ++ if(SFML_OS_FREEBSD OR SFML_OS_NETBSD) + set(SFML_PKGCONFIG_DIR "/libdata/pkgconfig") + endif() + Index: patches/patch-cmake_Config_cmake =================================================================== RCS file: patches/patch-cmake_Config_cmake diff -N patches/patch-cmake_Config_cmake --- patches/patch-cmake_Config_cmake 11 Mar 2022 19:39:27 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -Index: cmake/Config.cmake ---- cmake/Config.cmake.orig -+++ cmake/Config.cmake -@@ -73,7 +73,7 @@ endif() - # this could be e.g. macports on mac or msys2 on windows etc. - set(SFML_PKGCONFIG_DIR "/lib${LIB_SUFFIX}/pkgconfig") - --if(SFML_OS_FREEBSD OR SFML_OS_OPENBSD) -+if(SFML_OS_FREEBSD) - set(SFML_PKGCONFIG_DIR "/libdata/pkgconfig") - endif() - Index: patches/patch-cmake_SFMLConfigDependencies_cmake_in =================================================================== RCS file: /home/cvs/ports/multimedia/sfml/patches/patch-cmake_SFMLConfigDependencies_cmake_in,v diff -u -p -r1.2 patch-cmake_SFMLConfigDependencies_cmake_in --- patches/patch-cmake_SFMLConfigDependencies_cmake_in 11 Mar 2022 19:39:27 -0000 1.2 +++ patches/patch-cmake_SFMLConfigDependencies_cmake_in 29 Aug 2025 18:48:51 -0000 @@ -1,21 +1,21 @@ Index: cmake/SFMLConfigDependencies.cmake.in --- cmake/SFMLConfigDependencies.cmake.in.orig +++ cmake/SFMLConfigDependencies.cmake.in -@@ -12,6 +12,8 @@ if(SFML_STATIC_LIBRARIES) - set(FIND_SFML_OS_LINUX 1) +@@ -16,6 +16,8 @@ if(SFML_STATIC_LIBRARIES) + endif() elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") set(FIND_SFML_OS_FREEBSD 1) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") + set(FIND_SFML_OS_OPENBSD 1) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "iOS") + set(FIND_SFML_OS_IOS 1) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - if (DEFINED IOS) - set(FIND_SFML_OS_IOS 1) -@@ -44,7 +46,7 @@ if(SFML_STATIC_LIBRARIES) - # sfml-window - list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT_INDEX) - if(FIND_SFML_WINDOW_COMPONENT_INDEX GREATER -1) -- if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD) -+ if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD OR FIND_SFML_OS_OPENBSD) +@@ -49,7 +51,7 @@ if(SFML_STATIC_LIBRARIES) + if(FIND_SFML_USE_DRM) + sfml_bind_dependency(TARGET DRM FRIENDLY_NAME "drm" SEARCH_NAMES "drm") + sfml_bind_dependency(TARGET GBM FRIENDLY_NAME "gbm" SEARCH_NAMES "gbm") +- elseif(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD) ++ elseif(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD OR FIND_SFML_OS_OPENBSD) sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "X11" SEARCH_NAMES "X11") sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xrandr" SEARCH_NAMES "Xrandr") - endif() + sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xcursor" SEARCH_NAMES "Xcursor") Index: patches/patch-include_SFML_System_String_hpp =================================================================== RCS file: patches/patch-include_SFML_System_String_hpp diff -N patches/patch-include_SFML_System_String_hpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-include_SFML_System_String_hpp 29 Aug 2025 18:58:10 -0000 @@ -0,0 +1,138 @@ +Fix with libc++ 19, from FreeBSD. + +https://github.com/FreeBSD/freebsd-ports/commit/fab3a2f25cc1f31d87aa0094f884dd4e8f37180f + +Index: include/SFML/System/String.hpp +--- include/SFML/System/String.hpp.orig ++++ include/SFML/System/String.hpp +@@ -34,6 +34,130 @@ + #include + #include + ++namespace std ++{ ++ ++namespace // anonymous ++{ ++ ++template ++struct char_traits_base ++{ ++ using char_type = CharType; ++ using int_type = IntType; ++ using off_type = streamoff; ++ using pos_type = fpos; ++ using state_type = mbstate_t; ++ ++ static inline constexpr void assign(char_type& c1, const char_type& c2) noexcept ++ { ++ c1 = c2; ++ } ++ ++ static inline constexpr bool eq(char_type c1, char_type c2) noexcept ++ { ++ return c1 == c2; ++ } ++ ++ static inline constexpr bool lt(char_type c1, char_type c2) noexcept ++ { ++ return c1 < c2; ++ } ++ ++ static constexpr int compare(const char_type* lhs, const char_type* rhs, size_t count) noexcept ++ { ++ for (; count; --count, ++lhs, ++rhs) ++ { ++ if (lt(*lhs, *rhs)) ++ return -1; ++ if (lt(*rhs, *lhs)) ++ return 1; ++ } ++ return 0; ++ } ++ ++ static inline size_t constexpr length(const char_type* s) noexcept ++ { ++ size_t i = 0; ++ for (; s[i] != '\0'; ++i) ++ { ++ } ++ return i; ++ } ++ ++ static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a) noexcept ++ { ++ for (; n; --n) ++ { ++ if (*s == a) ++ return s; ++ ++s; ++ } ++ return nullptr; ++ } ++ ++ static inline char_type* move(char_type* s1, const char_type* s2, size_t n) noexcept ++ { ++ return reinterpret_cast(__builtin_memmove(s1, s2, n * sizeof(char_type))); ++ } ++ ++ static inline char_type* copy(char_type* s1, const char_type* s2, size_t n) noexcept ++ { ++ __builtin_memmove(s1, s2, n * sizeof(char_type)); ++ return s1; ++ } ++ ++ static inline char_type* assign(char_type* s, size_t n, char_type a) noexcept ++ { ++ std::fill_n(s, n, a); ++ return s; ++ } ++ ++ static inline constexpr int_type not_eof(int_type c) noexcept ++ { ++ return eq_int_type(c, eof()) ? ~eof() : c; ++ } ++ ++ static inline constexpr char_type to_char_type(int_type c) noexcept ++ { ++ return char_type(c); ++ } ++ ++ static inline constexpr int_type to_int_type(char_type c) noexcept ++ { ++ return int_type(c); ++ } ++ ++ static inline constexpr bool eq_int_type(int_type c1, int_type c2) noexcept ++ { ++ return c1 == c2; ++ } ++ ++ static inline constexpr int_type eof() noexcept ++ { ++ return int_type(EOF); ++ } ++}; ++ ++} // namespace anonymous ++ ++template<> ++struct char_traits : char_traits_base(EOF)> ++{ ++}; ++ ++template<> ++struct char_traits : char_traits_base(0xFFFF)> ++{ ++}; ++ ++template<> ++struct char_traits : char_traits_base(0xFFFFFFFF)> ++{ ++}; ++ ++} // namespace std ++ + + namespace sf + { Index: patches/patch-src_SFML_Window_Unix_WindowImplX11_cpp =================================================================== RCS file: patches/patch-src_SFML_Window_Unix_WindowImplX11_cpp diff -N patches/patch-src_SFML_Window_Unix_WindowImplX11_cpp --- patches/patch-src_SFML_Window_Unix_WindowImplX11_cpp 11 Mar 2022 19:39:27 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -Index: src/SFML/Window/Unix/WindowImplX11.cpp ---- src/SFML/Window/Unix/WindowImplX11.cpp.orig -+++ src/SFML/Window/Unix/WindowImplX11.cpp -@@ -1556,7 +1556,7 @@ void WindowImplX11::initialize() - m_window, - XNInputStyle, - XIMPreeditNothing | XIMStatusNothing, -- reinterpret_cast(NULL)); -+ static_cast(NULL)); - } - else - { Index: pkg/PLIST =================================================================== RCS file: /home/cvs/ports/multimedia/sfml/pkg/PLIST,v diff -u -p -r1.4 PLIST --- pkg/PLIST 11 Mar 2022 19:39:27 -0000 1.4 +++ pkg/PLIST 29 Aug 2025 18:54:20 -0000 @@ -108,7 +108,9 @@ include/SFML/Window/Mouse.hpp include/SFML/Window/Sensor.hpp include/SFML/Window/Touch.hpp include/SFML/Window/VideoMode.hpp +include/SFML/Window/Vulkan.hpp include/SFML/Window/Window.hpp +include/SFML/Window/WindowBase.hpp include/SFML/Window/WindowHandle.hpp include/SFML/Window/WindowStyle.hpp lib/cmake/SFML/ @@ -128,6 +130,6 @@ lib/pkgconfig/sfml-graphics.pc lib/pkgconfig/sfml-network.pc lib/pkgconfig/sfml-system.pc lib/pkgconfig/sfml-window.pc -share/SFML/ -share/SFML/license.md -share/SFML/readme.md +share/doc/SFML/ +share/doc/SFML/license.md +share/doc/SFML/readme.md