[qt3] search for FreeType using pkg-config, fixes FTBFS with freetype >= 2.5.1
Kevin Kofler
kkofler at fedoraproject.org
Sun Feb 23 18:24:24 UTC 2014
commit 9f8dafbe3fc8cf70073469b8cc07b568632ceade
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date: Sun Feb 23 19:25:08 2014 +0100
search for FreeType using pkg-config, fixes FTBFS with freetype >= 2.5.1
Drop the patch by Hrvoje Senjan that does not work under Fedora.
...ee-3.3.8b-extend-freetype-includes-search.patch | 16 -------
qt-x11-free-3.3.8b-freetype251.patch | 45 ++++++++++++++++++++
qt3.spec | 9 ++--
3 files changed, 49 insertions(+), 21 deletions(-)
---
diff --git a/qt-x11-free-3.3.8b-freetype251.patch b/qt-x11-free-3.3.8b-freetype251.patch
new file mode 100644
index 0000000..f9f27d4
--- /dev/null
+++ b/qt-x11-free-3.3.8b-freetype251.patch
@@ -0,0 +1,45 @@
+diff -ur qt-x11-free-3.3.8b/config.tests/x11/xfreetype.test qt-x11-free-3.3.8b-freetype251/config.tests/x11/xfreetype.test
+--- qt-x11-free-3.3.8b/config.tests/x11/xfreetype.test 2008-01-15 20:09:15.000000000 +0100
++++ qt-x11-free-3.3.8b-freetype251/config.tests/x11/xfreetype.test 2014-02-23 19:22:02.000000000 +0100
+@@ -116,33 +116,14 @@
+ # check for freetype2 headers
+ FREETYPE2_INCDIR=
+ if [ "$XFT" = "yes" ]; then
+- INC="freetype2/freetype/freetype.h"
+- XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
+- LDIRS=`sed -n -e '/^QMAKE_INCDIR[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
+- INCDIRS="$IN_INCDIRS $XDIRS $LDIRS /usr/include /include"
+- F=
+- for INCDIR in $INCDIRS; do
+- if [ -f $INCDIR/$INC ]; then
+- # detect major version of freetype2
+- FREETYPE_MAJOR=`grep "#define FREETYPE_MAJOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`
+- FREETYPE_MINOR=`grep "#define FREETYPE_MINOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`
+- FREETYPE_PATCH=`grep "#define FREETYPE_PATCH" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`
+- test -z "$FREETYPE_PATCH" && FREETYPE_PATCH="0"
+- [ "$VERBOSE" = "yes" ] && \
+- echo " Found Freetype version $FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH"
+- if [ "$FREETYPE_MAJOR" -eq "2" ] \
+- && [ "$FREETYPE_MINOR" -ge "0" -a "$FREETYPE_PATCH" -ge "9" ] \
+- || [ "$FREETYPE_MINOR" -ge "1" ]; then
+- F=yes
+- FREETYPE2_INCDIR=$INCDIR/freetype2
+- [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR"
+- break
+- fi
+- fi
+- done
+- if [ -z "$F" ]; then
+- XFT=no
+- [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS"
++ # minimum is freetype 2.0.9, which had libtool version 6.3.0
++ if pkg-config --atleast-version=6.3.0 freetype2; then
++ [ "$VERBOSE" = "yes" ] && echo " Found Freetype >= 2.0.9 using pkg-config"
++ FREETYPE2_INCDIR=`pkg-config --cflags-only-I freetype2 | sed -e 's/^-I//g' -e 's/ -I/ /g'`
++ [ "$VERBOSE" = "yes" ] && echo " Freetype headers in $FREETYPE2_INCDIR"
++ else
++ XFT=no
++ [ "$VERBOSE" = "yes" ] && echo " Could not find Freetype >= 2.0.9 using pkg-config"
+ fi
+ fi
+
diff --git a/qt3.spec b/qt3.spec
index 5f81e0d..f0cc69c 100644
--- a/qt3.spec
+++ b/qt3.spec
@@ -63,9 +63,8 @@ Patch45: qt-x11-free-3.3.8b-system-zlib-header.patch
Patch46: qt-3.3.8-libpng15.patch
# work around -Werror=format-security false positives (#1037297)
Patch47: qt-x11-free-3.3.8b-#1037297.patch
-# add new freetype 2.5.1 include paths to the search path (in addition to the
-# old paths), fixes FTBFS (patch by Hrvoje Senjan from OBS KDE:KDE3)
-Patch48: qt-x11-free-3.3.8b-extend-freetype-includes-search.patch
+# search for FreeType using pkg-config, fixes FTBFS with freetype >= 2.5.1
+Patch48: qt-x11-free-3.3.8b-freetype251.patch
# immodule patches
Patch50: qt-x11-immodule-unified-qt3.3.8-20071116.diff.bz2
@@ -315,7 +314,7 @@ sed -i.KDE3_PLUGIN_PATH \
%patch46 -p0 -b .libpng15
%endif
%patch47 -p1 -b .#1037297
-%patch48 -p1 -b .freetype-includes
+%patch48 -p1 -b .freetype251
# immodule patches
%if %{immodule}
@@ -640,7 +639,7 @@ rm -rf %{buildroot}
* Sun Feb 23 2014 Kevin Kofler <Kevin at tigcc.ticalc.org> - 3.3.8b-57
- add ppc64le support to qt.sh and qt.csh (#1068898)
- fix ppc64 support in qt.csh
-- add new freetype 2.5.1 include paths, fixes FTBFS (patch by Hrvoje Senjan)
+- search for FreeType using pkg-config, fixes FTBFS with freetype >= 2.5.1
* Tue Jan 14 2014 Kevin Kofler <Kevin at tigcc.ticalc.org> - 3.3.8b-56
- work around -Werror=format-security false positives (#1037297)
More information about the scm-commits
mailing list