File project.diff of Package stb
--- stb.changes.orig
+++ stb.changes
@@ -1,4 +1,19 @@
-------------------------------------------------------------------
+Fri Jun 19 19:07:26 UTC 2020 - Martin Hauke <mardnh@gmx.de>
+
+- Add README.SUSE
+- Introduce subpackage for the shared library
+- Add patches (from debian):
+ * 0001-Makefile-refactor.patch
+ * 0002-stb.h-fix-pointer-detection.patch
+ * 0003-stb_c_lexer.h-exit-on-error.patch
+ * 0004-stb_divide.h-use-return-value-to-indicate-errors.patch
+ * 0005-stb_sprintf.h-fix-pointer-detection.patch
+ * 0006-tests-Makefile-refactor.patch
+ * 0007-tests-image_test.c-use-library.patch
+ * 0008-tests-image_write_test.c-use-library.patch
+
+-------------------------------------------------------------------
Thu Aug 15 08:11:52 UTC 2019 - Adrian Schröter <adrian@suse.de>
- update to version 2.35
--- stb.spec.orig
+++ stb.spec
@@ -1,7 +1,7 @@
#
# spec file for package stb
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,16 +16,26 @@
#
+%global sover 0
+%global libname lib%{name}%{sover}
Name: stb
Version: 2.35.1565568185.bcb2815
Release: 0
-Summary: Single-File Public Domain Libraries for C/C++
+Summary: Single-File Public Domain Libraries for C/C++
License: MIT OR Unlicense
Group: Development/Libraries/C and C++
-Url: https://github.com/nothings/stb
+URL: https://github.com/nothings/stb
Source0: stb-%{version}.tar.xz
+Source1: README.SUSE
+Patch0: 0001-Makefile-refactor.patch
+Patch1: 0002-stb.h-fix-pointer-detection.patch
+Patch2: 0003-stb_c_lexer.h-exit-on-error.patch
+Patch3: 0004-stb_divide.h-use-return-value-to-indicate-errors.patch
+Patch4: 0005-stb_sprintf.h-fix-pointer-detection.patch
+Patch5: 0006-tests-Makefile-refactor.patch
+Patch6: 0007-tests-image_test.c-use-library.patch
+Patch7: 0008-tests-image_write_test.c-use-library.patch
BuildRequires: c++_compiler
-BuildArch: noarch
%description
Useful functions provided via C header files:
@@ -51,9 +61,40 @@ stb_connected_components.h | misc
stb.h | misc | helper functions for C, mostly redundant in C++; basically author's personal stuff
stb_leakcheck.h | misc | quick-and-dirty malloc/free leak-checking
+%package -n %{libname}
+Summary: Single-File Public Domain Libraries for C/C++
+Group: Development/Libraries/C and C++
+
+%description -n %{libname}
+Useful functions provided via C header files:
+
+stb_vorbis.h | audio | decode ogg vorbis files from file/memory to float/16-bit signed output
+stb_image.h | graphics | image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC
+stb_truetype.h | graphics | parse, decode, and rasterize characters from truetype fonts
+stb_image_write.h | graphics | image writing to disk: PNG, TGA, BMP
+stb_image_resize.h | graphics | resize images larger/smaller with good quality
+stb_rect_pack.h | graphics | simple 2D rectangle packer with decent quality
+stb_sprintf.h | utility | fast sprintf, snprintf for C/C++
+stretchy_buffer.h | utility | typesafe dynamic array for C (i.e. approximation to vector<>), doesn't compile as C++
+stb_textedit.h | user interface | guts of a text editor for games etc implementing them from scratch
+stb_voxel_render.h | 3D graphics | Minecraft-esque voxel rendering "engine" with many more features
+stb_dxt.h | 3D graphics | Fabian "ryg" Giesen's real-time DXT compressor
+stb_perlin.h | 3D graphics | revised Perlin noise (3D input, 1D output)
+stb_easy_font.h | 3D graphics | quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etc
+stb_tilemap_editor.h | game dev | embeddable tilemap editor
+stb_herringbone_wang_tile.h | game dev | herringbone Wang tile map generator
+stb_c_lexer.h | parsing | simplify writing parsers for C-like languages
+stb_divide.h | math | more useful 32-bit modulus e.g. "euclidean divide"
+stb_connected_components.h | misc | incrementally compute reachability on grids
+stb.h | misc | helper functions for C, mostly redundant in C++; basically author's personal stuff
+stb_leakcheck.h | misc | quick-and-dirty malloc/free leak-checking
+
+This library contains shared code for libstb.
+
%package devel
-Summary: Single-File Public Domain Libraries for C/C++
+Summary: Single-File Public Domain Libraries for C/C++
Group: Development/Libraries/C and C++
+Requires: %{libname} = %{version}
%description devel
Useful functions provided via C header files:
@@ -79,25 +120,29 @@ stb_connected_components.h | misc
stb.h | misc | helper functions for C, mostly redundant in C++; basically author's personal stuff
stb_leakcheck.h | misc | quick-and-dirty malloc/free leak-checking
-
%prep
-%setup -q
+%autosetup -p1
+cp %{SOURCE1} .
%build
-# nothing to do
+%make_build
%install
-mkdir -p %buildroot%_includedir/stb
-install -m0644 *.h %buildroot%_includedir/stb
-# stb_vorbis.c is a header file..
-cp stb_vorbis.c %buildroot%_includedir/stb/stb_vorbis.h
+%make_install LIBDIR=%{buildroot}%{_libdir}
+rm %{buildroot}%{_libdir}/libstb.a
+
+%post -n %{libname} -p /sbin/ldconfig
+%postun -n %{libname} -p /sbin/ldconfig
%check
-cd tests
-make && ./a.out
+%make_build -C tests do_tests
+
+%files -n %{libname}
+%{_libdir}/libstb.so.%{sover}*
%files devel
-%doc README.md docs
-%_includedir/stb
+%doc README.md README.SUSE docs
+%{_libdir}/libstb.so
+%{_includedir}/stb
%changelog