[packages/fltk2] - updated to the last commit, fixed build

qboosh qboosh at pld-linux.org
Mon May 11 21:41:47 CEST 2026


commit 683a36ea9a51b1cbca712569e91a1cc1c98a1f11
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon May 11 21:41:17 2026 +0200

    - updated to the last commit, fixed build

 fltk2-c++.patch    | 11 ++++++++
 fltk2-gcc43.patch  | 18 ++++++++++---
 fltk2-libpng.patch | 12 ---------
 fltk2-link.patch   | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 fltk2-rpath.patch  | 10 +++----
 fltk2-soname.patch | 13 ---------
 fltk2-types.patch  | 19 ++++++++++++++
 fltk2.spec         | 72 +++++++++++++++++++++++++-------------------------
 8 files changed, 162 insertions(+), 70 deletions(-)
---
diff --git a/fltk2.spec b/fltk2.spec
index 34a9b79..978b83c 100644
--- a/fltk2.spec
+++ b/fltk2.spec
@@ -1,40 +1,42 @@
-# TODO:
-#	- tons of "Unresolved symbols found in: ..."
 #
 # Conditional build:
 %bcond_with	cairo	# cairo support
 
-%define		_name		fltk
-%define		_snap		r6970
-%define		_version	2.0
 Summary:	Fast Light Tool Kit 2.x
 Summary(pl.UTF-8):	FLTK - "lekki" X11 toolkit wersja 2.x
 Summary(pt_BR.UTF-8):	Interface gráfica em C++ para X, OpenGL e Windows
 Name:		fltk2
 Version:	2.0
-Release:	0.%{_snap}.2
+%define	gitref	c2171d83a31ae533e37bdbb7458c29041c4d62c0
+%define	snap	s20120323
+%define	rel	1
+Release:	0.%{snap}.%{rel}
 License:	LGPL with amendments (see COPYING)
 Group:		X11/Libraries
-Source0:	http://ftp.easysw.com/pub/fltk/snapshots/%{_name}-%{_version}.x-%{_snap}.tar.bz2
-# Source0-md5:	f78976d0ba1a5c845e14f4df96d580a0
+Source0:	https://github.com/fltk/fltk-legacy/archive/%{gitref}/fltk-legacy-%{gitref}.tar.gz
+# Source0-md5:	683cb7e43bafa9853d7265afa05a54e8
 Patch0:		%{name}-rpath.patch
-Patch1:		%{name}-soname.patch
-Patch2:		%{name}-gcc43.patch
-Patch3:		%{name}-libpng.patch
+Patch1:		%{name}-gcc43.patch
+Patch2:		%{name}-types.patch
+Patch3:		%{name}-c++.patch
+Patch4:		%{name}-link.patch
 URL:		https://github.com/fltk/fltk-legacy
-BuildRequires:	Mesa-libGLU-devel
+BuildRequires:	OpenGL-GLU-devel
+BuildRequires:	OpenGL-devel
 BuildRequires:	autoconf
-# don't build with cairo support if you're planning to use fltk2 with
-# dillo 2.x
 %{?with_cairo:BuildRequires:	cairo-devel}
+BuildRequires:	fontconfig-devel
 BuildRequires:	libjpeg-devel
 BuildRequires:	libpng-devel
 BuildRequires:	libstdc++-devel
 BuildRequires:	rpmbuild(macros) >= 1.315
 BuildRequires:	xorg-lib-libX11-devel
+BuildRequires:	xorg-lib-libXcursor-devel
 BuildRequires:	xorg-lib-libXext-devel
+BuildRequires:	xorg-lib-libXft-devel
 BuildRequires:	xorg-lib-libXi-devel
 BuildRequires:	xorg-lib-libXinerama-devel
+BuildRequires:	xorg-lib-libXrender-devel
 BuildRequires:	zlib-devel
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -94,24 +96,22 @@ Biblioteka FLTK2 konsolidowana statycznie.
 Bibliotecas estáticas para o FLTK2.
 
 %prep
-%setup -q -n %{_name}-%{_version}.x-%{_snap}
-%patch -P0 -p0
-%patch -P1 -p0
+%setup -q -n fltk-legacy-%{gitref}
+%patch -P0 -p1
+%patch -P1 -p1
 %patch -P2 -p1
 %patch -P3 -p1
+%patch -P4 -p1
 
 %build
 %{__autoconf}
 %configure \
 	--enable-cairo%{!?with_cairo:=no} \
 	--enable-shared \
-	--enable-threads \
-	--enable-xft \
-	--enable-xinerama \
-	--with-x \
+	--enable-xshm \
 	--with-optim="%{rpmcxxflags}"
 
-%{__make}
+%{__make} --debug=p
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -123,8 +123,8 @@ install -d $RPM_BUILD_ROOT%{_mandir}/man{1,3}
 
 # install man by hand
 %{__mv} documentation/fltk2-config.man $RPM_BUILD_ROOT%{_mandir}/man1/fltk2-config.1
-%{__mv} documentation/fluid.man $RPM_BUILD_ROOT%{_mandir}/man1/fluid.1
-%{__mv} documentation/fltk.man $RPM_BUILD_ROOT%{_mandir}/man3/fltk.3
+%{__mv} documentation/fluid.man $RPM_BUILD_ROOT%{_mandir}/man1/fluid2.1
+%{__mv} documentation/fltk.man $RPM_BUILD_ROOT%{_mandir}/man3/fltk2.3
 
 # broken so linking, the idea stolen from
 # https://bugzilla.redhat.com/show_bug.cgi?id=477683
@@ -142,29 +142,29 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc CHANGES COPYING CREDITS README
-%attr(755,root,root) %{_libdir}/libfltk2.so.*.*
-%attr(755,root,root) %{_libdir}/libfltk2_gl.so.*.*
-%attr(755,root,root) %{_libdir}/libfltk2_glut.so.*.*
-%attr(755,root,root) %{_libdir}/libfltk2_images.so.*.*
+%doc CHANGES COPYING CREDITS README README_fltk1_to_fltk2.txt TODO
+%{_libdir}/libfltk2.so.2.0
+%{_libdir}/libfltk2_gl.so.2.0
+%{_libdir}/libfltk2_glut.so.2.0
+%{_libdir}/libfltk2_images.so.2.0
 
 %files devel
 %defattr(644,root,root,755)
-%doc documentation/*.{html,gif,jpg}
+%doc documentation/*.{html,css,gif,jpg}
 %attr(755,root,root) %{_bindir}/fltk2-config
 %attr(755,root,root) %{_bindir}/fluid2
-%attr(755,root,root) %{_libdir}/libfltk2.so
-%attr(755,root,root) %{_libdir}/libfltk2_gl.so
-%attr(755,root,root) %{_libdir}/libfltk2_glut.so
-%attr(755,root,root) %{_libdir}/libfltk2_images.so
+%{_libdir}/libfltk2.so
+%{_libdir}/libfltk2_gl.so
+%{_libdir}/libfltk2_glut.so
+%{_libdir}/libfltk2_images.so
 %dir %{_includedir}/fltk
 %dir %{_includedir}/fltk/compat
 %dir %{_includedir}/fltk/compat/FL
 %{_includedir}/fltk/*.[hr]
 %{_includedir}/fltk/compat/FL/*.[hH]
 %{_mandir}/man1/fltk2-config.1*
-%{_mandir}/man1/fluid.1*
-%{_mandir}/man3/fltk.3*
+%{_mandir}/man1/fluid2.1*
+%{_mandir}/man3/fltk2.3*
 
 %files static
 %defattr(644,root,root,755)
diff --git a/fltk2-c++.patch b/fltk2-c++.patch
new file mode 100644
index 0000000..da5bf7e
--- /dev/null
+++ b/fltk2-c++.patch
@@ -0,0 +1,11 @@
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/fluid/FluidType.h.orig	2026-05-10 19:41:43.988744438 +0200
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/fluid/FluidType.h	2026-05-10 19:42:09.208607810 +0200
+@@ -44,7 +44,7 @@
+ class FLUID_API FluidType {
+ 
+   friend class Widget_Browser;
+-  friend fltk::Widget *make_type_browser(int,int,int,int,const char *l=0);
++  friend fltk::Widget *make_type_browser(int,int,int,int,const char *l);
+   friend class WindowType;
+   virtual void setlabel(const char *); // virtual part of label(char*)
+ 
diff --git a/fltk2-gcc43.patch b/fltk2-gcc43.patch
index 1165828..47cbfff 100644
--- a/fltk2-gcc43.patch
+++ b/fltk2-gcc43.patch
@@ -1,7 +1,7 @@
---- fltk-2.0.x-r6671.orig/src/Image.cxx	2009-04-10 16:07:34.000000000 +0200
-+++ fltk-2.0.x-r6671/src/Image.cxx	2009-04-10 16:03:22.000000000 +0200
-@@ -20,6 +20,7 @@
- // Please report all bugs and problems to "fltk-bugs at fltk.org".
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/src/Image.cxx.orig	2012-03-23 06:49:17.000000000 +0100
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/src/Image.cxx	2026-05-10 19:12:29.121584703 +0200
+@@ -22,6 +22,7 @@
+ //    http://www.fltk.org/str.php
  
  #include <config.h>
 +#include <cstring>
@@ -18,3 +18,13 @@
  #if defined(_WIN32) && USE_STOCK_BRUSH && _WIN32_WINNT<0x0500
  # undef _WIN32_WINNT
  # define _WIN32_WINNT 0x0500
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/images/fl_png.cxx.orig	2026-05-10 19:37:46.613363744 +0200
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/images/fl_png.cxx	2026-05-10 19:38:16.086537407 +0200
+@@ -41,6 +41,7 @@ extern "C"
+ }
+ 
+ # include <stdlib.h>
++# include <cstring>
+ 
+ static png_bytep cur_datas;
+ 
diff --git a/fltk2-libpng.patch b/fltk2-libpng.patch
deleted file mode 100644
index 6de5ae8..0000000
--- a/fltk2-libpng.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -burNp fltk-2.0.x-r6970/images/fl_png.cxx fltk-2.0.x-r6970-dud/images/fl_png.cxx
---- fltk-2.0.x-r6970/images/fl_png.cxx	2007-04-16 16:48:06.000000000 +0200
-+++ fltk-2.0.x-r6970-dud/images/fl_png.cxx	2010-02-19 22:42:37.719369135 +0100
-@@ -62,7 +62,7 @@ bool pngImage::test(const uchar* datas,
- #if !HAVE_LIBPNG
-   return 0;
- #else
--  return png_check_sig((png_byte*)datas, (int)size)!=0;
-+  return png_sig_cmp((png_byte*)datas, 0, (int)size)!=0;
- #endif
- }
- 
diff --git a/fltk2-link.patch b/fltk2-link.patch
new file mode 100644
index 0000000..9ff64a6
--- /dev/null
+++ b/fltk2-link.patch
@@ -0,0 +1,77 @@
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/configure.in.orig	2026-05-11 20:08:06.095437786 +0200
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/configure.in	2026-05-11 20:11:13.161091031 +0200
+@@ -195,8 +195,7 @@ if test x$enable_shared = xyes; then
+             fi
+ 	    ;;
+ 	Linux* | *BSD*)
+-            DSOCOMMAND="\$(CXX) -Wl,-soname,\$(DSONAME) \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
+-#           DSOCOMMAND="\$(CXX) \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
++            DSOCOMMAND="\$(CXX) -Wl,-soname,\$(DSONAME) \$(LDFLAGS) -shared -fPIC $DEBUGFLAG -o"
+ 	    ;;
+ 	AIX*)
+ 	    DSOSUFFIX="_s.a"
+@@ -441,7 +441,7 @@ AC_SEARCH_LIBS(pow, m)
+ 
+ dnl Check for image libraries...
+ SAVELIBS="$LIBS"
+-IMAGELIBS="-lfltk2_images"
++IMAGELIBS=""
+ 
+ AC_ARG_ENABLE(jpeg, [  --enable-jpeg           turn on JPEG support: auto,no,local (default=auto)])
+ if test x$enable_jpeg != xno; then
+@@ -709,7 +708,7 @@ case $uname in
+ 	      X11/Xft/Xft.h,
+ 	      AC_CHECK_LIB(Xft, XftDrawCreate,
+ 	      AC_DEFINE(USE_XFT)
+-	      LIBS="-lXft $LIBS")
++	      LIBS="-lXft -lXrender -lfontconfig $LIBS")
+ 	    )
+ 	  fi
+ 	fi
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/makeinclude.in.orig	2026-05-11 20:11:43.917591076 +0200
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/makeinclude.in	2026-05-11 20:12:15.274087870 +0200
+@@ -79,8 +79,9 @@ LOCALIMAGES	= @LOCAL_IMAGETARGETS@
+ ZLIBINC		= @ZLIBINC@
+ 
+ # libraries to link with:
+-LDLIBS = @LDFLAGS@ @LIBS@
+-GLDLIBS = @LDFLAGS@ @GLLIB@ @LIBS@
++LDFLAGS = @LDFLAGS@
++LDLIBS = @LIBS@
++GLDLIBS = @GLLIB@ @LIBS@
+ LINKFLTK = -L../lib @LINKFLTK@
+ LINKFLTKGL = -L../lib @LINKFLTKGL@ @LINKFLTK@
+ LINKFLTKFORMS = -L../lib -lfltk2_forms @LINKFLTK@
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/images/Makefile.orig	2026-05-11 20:17:59.665555475 +0200
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/images/Makefile	2026-05-11 20:25:30.893110965 +0200
+@@ -111,7 +111,7 @@ include makedepend
+ 
+ ../lib/$(DSONAME): $(OBJECTS)
+ 	echo $(DSOCOMMAND) $@ ...
+-	$(DSOCOMMAND) $@ $(OBJECTS)
++	$(DSOCOMMAND) $@ $(OBJECTS) $(LINKFLTK) $(IMAGELIBS)
+ 	$(RM) ../lib/$(DSOLINK)
+ 	$(LN) $(DSONAME) ../lib/$(DSOLINK)
+ 
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/OpenGL/Makefile.orig	2026-05-11 21:01:48.994644509 +0200
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/OpenGL/Makefile	2026-05-11 21:02:09.637866009 +0200
+@@ -104,7 +104,7 @@ include makedepend
+ 
+ ../lib/$(DSONAME): $(OBJECTS)
+ 	echo $(DSOCOMMAND) $@ ...
+-	$(DSOCOMMAND) $@ $(OBJECTS)
++	$(DSOCOMMAND) $@ $(OBJECTS) $(LINKFLTK) $(GLDLIBS) -lfreetype
+ 	$(RM) ../lib/$(DSOLINK)
+ 	$(LN) $(DSONAME) ../lib/$(DSOLINK)
+ 
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/glut/Makefile.orig	2026-05-11 21:06:23.446491009 +0200
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/glut/Makefile	2026-05-11 21:06:55.972981465 +0200
+@@ -105,7 +105,7 @@ include makedepend
+ 
+ ../lib/$(DSONAME): $(OBJECTS)
+ 	echo $(DSOCOMMAND) $@ ...
+-	$(DSOCOMMAND) $@ $(OBJECTS)
++	$(DSOCOMMAND) $@ $(OBJECTS) $(LINKFLTKGL)
+ 	$(RM) ../lib/$(DSOLINK)
+ 	$(LN) $(DSONAME) ../lib/$(DSOLINK)
+ 
diff --git a/fltk2-rpath.patch b/fltk2-rpath.patch
index 9a9633a..8c096b4 100644
--- a/fltk2-rpath.patch
+++ b/fltk2-rpath.patch
@@ -1,9 +1,9 @@
---- configure.in	2008-08-05 00:53:30.000000000 +0200
-+++ configure.in.new	2008-12-22 12:09:24.030693986 +0100
-@@ -186,9 +186,6 @@ if test x$enable_shared = xyes; then
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/configure.in.orig	2012-03-23 06:49:17.000000000 +0100
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/configure.in	2026-05-10 18:35:06.560400366 +0200
+@@ -197,9 +197,6 @@ if test x$enable_shared = xyes; then
  	Linux* | *BSD*)
- #           DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
-             DSOCOMMAND="\$(CXX) \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
+             DSOCOMMAND="\$(CXX) -Wl,-soname,\$(DSONAME) \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
+ #           DSOCOMMAND="\$(CXX) \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
 -	    if test "$libdir" != "/usr/lib"; then
 -		    DSOLINK="-Wl,-rpath,$libdir"
 -            fi
diff --git a/fltk2-soname.patch b/fltk2-soname.patch
deleted file mode 100644
index 09d434c..0000000
--- a/fltk2-soname.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- configure.in.old	2009-03-16 23:50:33.487708434 +0100
-+++ configure.in	2009-03-16 23:50:57.663706829 +0100
-@@ -184,8 +184,8 @@ if test x$enable_shared = xyes; then
-             fi
- 	    ;;
- 	Linux* | *BSD*)
--#           DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
--            DSOCOMMAND="\$(CXX) \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
-+            DSOCOMMAND="\$(CXX) -Wl,-soname,\$(DSONAME) \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
-+#           DSOCOMMAND="\$(CXX) \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
- 	    ;;
- 	AIX*)
- 	    DSOSUFFIX="_s.a"
diff --git a/fltk2-types.patch b/fltk2-types.patch
new file mode 100644
index 0000000..a21a8a2
--- /dev/null
+++ b/fltk2-types.patch
@@ -0,0 +1,19 @@
+--- fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/src/UpBox.cxx.orig	2026-05-10 19:31:18.082135265 +0200
++++ fltk-legacy-c2171d83a31ae533e37bdbb7458c29041c4d62c0/src/UpBox.cxx	2026-05-10 19:36:12.350541076 +0200
+@@ -46,13 +46,13 @@ void drawFocusRect(const fltk::Rectangle
+ #if USE_X11
+   // X version uses stipple pattern because there seem to be too many
+   // servers with bugs when drawing dotted lines:
+-  static const char pattern[]
++  static const unsigned char pattern[]
+     = {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA};
+   static Pixmap evenstipple, oddstipple;
+   if (!evenstipple) {
+     XWindow root = RootWindow(xdisplay, xscreen);
+-    evenstipple = XCreateBitmapFromData(xdisplay, root, pattern, 8, 8);
+-    oddstipple = XCreateBitmapFromData(xdisplay, root, pattern+1, 8, 8);
++    evenstipple = XCreateBitmapFromData(xdisplay, root, (const char *)pattern, 8, 8);
++    oddstipple = XCreateBitmapFromData(xdisplay, root, (const char *)(pattern+1), 8, 8);
+   }
+   XSetStipple(xdisplay, gc, (r.x()+r.y()-r1.x()-r1.y())&1 ? oddstipple : evenstipple);
+   XSetFillStyle(xdisplay, gc, FillStippled);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/fltk2.git/commitdiff/683a36ea9a51b1cbca712569e91a1cc1c98a1f11



More information about the pld-cvs-commit mailing list