summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJames Cowgill <jcowgill@debian.org>2023-11-28 21:08:41 +0000
committerJames Cowgill <jcowgill@debian.org>2023-11-28 21:08:41 +0000
commit855e59896da90dd9ce62189f9b6d1af61388d15f (patch)
treee460d6e7eb0c14ec8bd3b16ebba2edbe28e0a3b5 /debian
parentf7c229633ca21ae7c1b261a2ce72fe04bd0632af (diff)
d/control,patches: Add patch to unbundle stb
Closes: #949709
Diffstat (limited to 'debian')
-rw-r--r--debian/control2
-rw-r--r--debian/patches/04_unbundle_stb.patch35
-rw-r--r--debian/patches/series1
3 files changed, 38 insertions, 0 deletions
diff --git a/debian/control b/debian/control
index bd7fb5f..311a906 100644
--- a/debian/control
+++ b/debian/control
@@ -12,12 +12,14 @@ Build-Depends: debhelper-compat (= 11),
libfreetype6-dev,
libgl1-mesa-dev,
libopenal-dev,
+ libstb-dev,
libudev-dev [linux-any],
libusbhid-dev [kfreebsd-any],
libvorbis-dev,
libvulkan-dev,
libx11-dev,
libxrandr-dev,
+ pkg-config,
Rules-Requires-Root: no
Standards-Version: 4.2.1
Homepage: https://www.sfml-dev.org/
diff --git a/debian/patches/04_unbundle_stb.patch b/debian/patches/04_unbundle_stb.patch
new file mode 100644
index 0000000..bff2832
--- /dev/null
+++ b/debian/patches/04_unbundle_stb.patch
@@ -0,0 +1,35 @@
+Description: Unbundle libstb
+ Use headers from libstb-dev and link directly to the library instead
+ of using bundled copy removed from extlibs.
+Author: James Cowgill <jcowgill@debian.org>
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/SFML/Graphics/CMakeLists.txt
++++ b/src/SFML/Graphics/CMakeLists.txt
+@@ -93,7 +93,9 @@ sfml_add_library(sfml-graphics
+ target_link_libraries(sfml-graphics PUBLIC sfml-window)
+
+ # stb_image sources
+-target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image")
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(stb REQUIRED IMPORTED_TARGET stb)
++target_link_libraries(sfml-graphics PRIVATE PkgConfig::stb)
+
+ # glad sources
+ target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/glad/include")
+--- a/src/SFML/Graphics/ImageLoader.cpp
++++ b/src/SFML/Graphics/ImageLoader.cpp
+@@ -28,12 +28,11 @@
+ #include <SFML/Graphics/ImageLoader.hpp>
+ #include <SFML/System/InputStream.hpp>
+ #include <SFML/System/Err.hpp>
+-#define STB_IMAGE_IMPLEMENTATION
+ #include <stb_image.h>
+-#define STB_IMAGE_WRITE_IMPLEMENTATION
+ #include <stb_image_write.h>
+ #include <cctype>
+ #include <iterator>
++#include <cstring>
+
+
+ namespace
diff --git a/debian/patches/series b/debian/patches/series
index 682ba4c..7fdfc08 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
01_remove-googleapi-css.patch
02_build-doc-once.patch
03_unbundle_vulkan.patch
+04_unbundle_stb.patch
06_pkgconfig-libs-private.patch