Mail archive
alpine-aports

[alpine-aports] [PATCH 1/2] main/fltk: enable opengl and fix Fl_XFont_On_Demand

From: Daniel Sabogal <dsabogalcc_at_gmail.com>
Date: Sat, 1 Oct 2016 20:38:35 -0400

---
 main/fltk/APKBUILD                 | 25 +++++++++----------------
 main/fltk/Fl_XFont_On_Demand.patch | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 16 deletions(-)
 create mode 100644 main/fltk/Fl_XFont_On_Demand.patch
diff --git a/main/fltk/APKBUILD b/main/fltk/APKBUILD
index 8a1dc45..66fffc1 100644
--- a/main/fltk/APKBUILD
+++ b/main/fltk/APKBUILD
_at_@ -2,32 +2,22 @@
 # Maintainer: ScrumpyJack <scrumpyjack_at_st.ilet.to>
 pkgname=fltk
 pkgver=1.3.3
-pkgrel=0
+pkgrel=1
 pkgdesc="A cross-platform C++ GUI toolkit"
 url="http://fltk.org"
 arch="all"
 license="GPL"
 depends=""
-depends_dev="libx11-dev libxext-dev libxft-dev"
+depends_dev="libx11-dev libxext-dev libxft-dev mesa-dev"
 makedepends="$depends_dev libpng-dev libjpeg-turbo-dev"
-install=""
 subpackages="$pkgname-doc $pkgname-dev $pkgname-fluid"
 source="http://fltk.org/pub/fltk/$pkgver/$pkgname-$pkgver-source.tar.gz
+	Fl_XFont_On_Demand.patch
 	ewmh-crash.patch"
-
-_builddir=$srcdir/${pkgname}-${pkgver}
-prepare() {
-	local i
-	cd "$_builddir"
-	for i in $source; do
-		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-		esac
-	done
-}
+builddir="$srcdir/$pkgname-$pkgver"
 
 build() {
-	cd "$_builddir"
+	cd "$builddir"
 	./configure \
 		--build=$CBUILD \
 		--host=$CHOST \
_at_@ -42,7 +32,7 @@ build() {
 
 
 package() {
-        cd "$_builddir"
+        cd "$builddir"
         make DESTDIR="$pkgdir" install || return 1
 	# remove static libs
 	rm "$pkgdir"/usr/lib/*.a || return 1
_at_@ -56,8 +46,11 @@ fluid() {
 }
 
 md5sums="9ccdb0d19dc104b87179bd9fd10822e3  fltk-1.3.3-source.tar.gz
+e33e95ed8aacf84048f7b175112f7837  Fl_XFont_On_Demand.patch
 0b1a9c825de9de368550d10728878019  ewmh-crash.patch"
 sha256sums="f8398d98d7221d40e77bc7b19e761adaf2f1ef8bb0c30eceb7beb4f2273d0d97  fltk-1.3.3-source.tar.gz
+afdd3dcbdf0b64bd813c28fb116663762dd81c19f535d8850a7c644b9005c788  Fl_XFont_On_Demand.patch
 15adf29c8d2885bc356943f05b3f22b2db42a5278a9a27d8b1bd3f342f3f4416  ewmh-crash.patch"
 sha512sums="277ba27e35c20e2d4fc5296bf418c5ab78c821870476e21d49f723765b99b3a559eed4ecd5215ac26d53a1091ada003e17f1553194cebaa97dd854809dd2885d  fltk-1.3.3-source.tar.gz
+0f094a3ac5e10f5736ffebb92abf12637b371b3b469f1aac4670114b788c9cd3c8cacf68ebe5d5d29db4d99094f14fdc19777aeacc784c90073659561055b574  Fl_XFont_On_Demand.patch
 7e7c43620c91f83da190227d829ebe652ccf1e02ad40e6b3d2631959716304612f447f2dffba0f19fc2c5191692e23581c438945f61669f4974845a1ac1e9929  ewmh-crash.patch"
diff --git a/main/fltk/Fl_XFont_On_Demand.patch b/main/fltk/Fl_XFont_On_Demand.patch
new file mode 100644
index 0000000..4b51089
--- /dev/null
+++ b/main/fltk/Fl_XFont_On_Demand.patch
_at_@ -0,0 +1,36 @@
+--- fltk-1.3.3/src/fl_font.cxx
++++ fltk-1.3.3/src/fl_font.cxx
+_at_@ -55,6 +55,12 @@
+ #  include "fl_font_x.cxx"
+ #endif // WIN32
+ 
++#if ! (defined(WIN32) || defined(__APPLE__))
++XFontStruct *fl_X_core_font()
++{
++  return fl_xfont.value();
++}
++#endif
+ 
+ double fl_width(const char* c) {
+   if (c) return fl_width(c, (int) strlen(c));
+--- fltk-1.3.3/src/gl_draw.cxx
++++ fltk-1.3.3/src/gl_draw.cxx
+_at_@ -81,7 +81,7 @@
+  * then sorting through them at draw time (for normal X rendering) to find which one can
+  * render the current glyph... But for now, just use the first font in the list for GL...
+  */
+-    XFontStruct *font = fl_xfont;
++    XFontStruct *font = fl_X_core_font();
+     int base = font->min_char_or_byte2;
+     int count = font->max_char_or_byte2-base+1;
+     fl_fontsize->listbase = glGenLists(256);
+--- fltk-1.3.3/FL/x.H
++++ fltk-1.3.3/FL/x.H
+_at_@ -132,6 +132,7 @@
+   XFontStruct *ptr;
+ };
+ extern FL_EXPORT Fl_XFont_On_Demand fl_xfont;
++extern FL_EXPORT XFontStruct* fl_X_core_font();
+ 
+ // this object contains all X-specific stuff about a window:
+ // Warning: this object is highly subject to change!  
-- 
2.10.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sat Oct 01 2016 - 20:38:35 GMT