[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#402007: qt4-x11: FTBFS on GNU/kFreeBSD



Package: qt4-x11
Severity: important
Version: 4.2.1-2
Tags: patch

Hi,

the current version fails to build on GNU/kFreeBSD,
see http://experimental.ftbfs.de/build.php?&pkg=qt4-x11&arch=kfreebsd-i386

Please find attached patch to fix that.
It updates debian/patches/14_kfreebsd_build_fix.dpatch.
This dpatch also makes obsolete debian/patches/21_hurd_detection.dpatch.

As "-platform linux-g++" does not longer work on non-linux
due to src/corelib/io/io.pri, there is also change to debian/rules
and corresponding debian/patches/90_kfreebsd_mkspecs.dpatch.


It would also be nice if you can ask upstream
to include similar change.

Thanks in advance

                        Petr
diff -u qt4-x11-4.2.1/debian/patches/14_kfreebsd_build_fix.dpatch qt4-x11-4.2.1/debian/patches/14_kfreebsd_build_fix.dpatch
--- qt4-x11-4.2.1/debian/patches/14_kfreebsd_build_fix.dpatch
+++ qt4-x11-4.2.1/debian/patches/14_kfreebsd_build_fix.dpatch
@@ -2,19 +2,78 @@
-## 14_kfreebsd_build_fix.dpatch by Brian Nelson <pyro@debian.org> by way
-## of Petr Salinger <Petr.Salinger@t-systems.cz>
+## 14_kfreebsd_build_fix.dpatch by Petr Salinger <Petr.Salinger@seznam.cz> 
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fixes FTBFS on GNU/kFreeBSD
+## DP: Fixes FTBFS on GNU/kFreeBSD by creating new Q_OS_GLIBC
 
 @DPATCH@
-diff -urNad qt4-x11-4.0.1~/src/corelib/global/qglobal.h qt4-x11-4.0.1/src/corelib/global/qglobal.h
---- qt4-x11-4.0.1~/src/corelib/global/qglobal.h	2005-08-16 11:41:07.000000000 +0300
-+++ qt4-x11-4.0.1/src/corelib/global/qglobal.h	2005-12-13 18:19:47.000000000 +0200
-@@ -100,7 +100,7 @@
- #  define Q_OS_ULTRIX
- #elif defined(sinix)
+diff -ur qt4-x11-4.2.1/src/corelib/global/qglobal.h qt4-x11-4.2.1/src/corelib/global/qglobal.h
+--- qt4-x11-4.2.1/src/corelib/global/qglobal.h	2006-10-20 17:35:14.000000000 +0200
++++ qt4-x11-4.2.1/src/corelib/global/qglobal.h	2006-12-06 23:06:11.000000000 +0100
+@@ -101,6 +102,12 @@
  #  define Q_OS_RELIANT
--#elif defined(__linux__) || defined(__linux)
-+#elif defined(__linux__) || defined(__linux) || defined(__GLIBC__)
+ #elif defined(__linux__) || defined(__linux)
  #  define Q_OS_LINUX
++#  define Q_OS_GLIBC
++#elif defined(__GNU_HURD__) || defined(__GNU__)
++#  define Q_OS_HURD
++#  define Q_OS_GLIBC
++#elif defined(__GLIBC__)
++#  define Q_OS_GLIBC
  #elif defined(__FreeBSD__) || defined(__DragonFly__)
  #  define Q_OS_FREEBSD
+ #  define Q_OS_BSD4
+@@ -121,8 +128,6 @@
+ #  define Q_OS_AIX
+ #elif defined(__Lynx__)
+ #  define Q_OS_LYNX
+-#elif defined(__GNU_HURD__)
+-#  define Q_OS_HURD
+ #elif defined(__DGUX__)
+ #  define Q_OS_DGUX
+ #elif defined(__QNXNTO__)
+diff -ur qt4-x11-4.2.1/src/corelib/plugin/qlibrary.cpp qt4-x11-4.2.1/src/corelib/plugin/qlibrary.cpp
+--- qt4-x11-4.2.1/src/corelib/plugin/qlibrary.cpp	2006-10-20 17:35:15.000000000 +0200
++++ qt4-x11-4.2.1/src/corelib/plugin/qlibrary.cpp	2006-12-07 09:01:45.000000000 +0100
+@@ -248,11 +248,11 @@
+ 
+ #if defined(Q_OS_UNIX)
+ 
+-#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX)
++#if defined(Q_OS_FREEBSD) || defined(Q_OS_GLIBC)
+ #  define USE_MMAP
+ #  include <sys/types.h>
+ #  include <sys/mman.h>
+-#endif // Q_OS_FREEBSD || Q_OS_LINUX
++#endif // Q_OS_FREEBSD || Q_OS_GLIBC
+ 
+ static long qt_find_pattern(const char *s, ulong s_len,
+                              const char *pattern, ulong p_len)
+diff -ur qt4-x11-4.2.1/src/corelib/tools/qlocale.cpp qt4-x11-4.2.1/src/corelib/tools/qlocale.cpp
+--- qt4-x11-4.2.1/src/corelib/tools/qlocale.cpp	2006-10-20 17:35:15.000000000 +0200
++++ qt4-x11-4.2.1/src/corelib/tools/qlocale.cpp	2006-12-07 09:01:22.000000000 +0100
+@@ -47,7 +47,7 @@
+ #include <stdlib.h>
+ #include <qdebug.h>
+ 
+-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
++#if defined(Q_OS_GLIBC) && !defined(__UCLIBC__)
+ #    include <fenv.h>
+ #endif
+ 
+@@ -5639,7 +5639,7 @@
+     _control87(MCW_EM, MCW_EM);
+ #endif
+ 
+-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
++#if defined(Q_OS_GLIBC) && !defined(__UCLIBC__)
+     fenv_t envp;
+     feholdexcept(&envp);
+ #endif
+@@ -5655,7 +5655,7 @@
+ #endif //_M_X64
+ #endif //Q_OS_WIN
+ 
+-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
++#if defined(Q_OS_GLIBC) && !defined(__UCLIBC__)
+     fesetenv(&envp);
+ #endif
+ 
diff -u qt4-x11-4.2.1/debian/patches/00list qt4-x11-4.2.1/debian/patches/00list
--- qt4-x11-4.2.1/debian/patches/00list
+++ qt4-x11-4.2.1/debian/patches/00list
@@ -11 +11 @@
-21_hurd_detection
+90_kfreebsd_mkspecs
reverted:
--- qt4-x11-4.2.1/debian/patches/21_hurd_detection.dpatch
+++ qt4-x11-4.2.1.orig/debian/patches/21_hurd_detection.dpatch
@@ -1,27 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 20_hurd_detection.dpatch by Cyril Brulebois <cyril.brulebois@enst-bretagne.fr>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Enable GNU/Hurd detection
-
-@DPATCH@
-diff -Nur qt4-x11-4.1.3~/src/corelib/global/qglobal.h qt4-x11-4.1.3~/src/corelib/global/qglobal.h
---- qt4-x11-4.1.3~/src/corelib/global/qglobal.h	2006-07-21 11:51:19.000000000 +0000
-+++ qt4-x11-4.1.3/src/corelib/global/qglobal.h	2006-07-21 11:58:25.000000000 +0000
-@@ -69,6 +69,7 @@
-      LYNX     - LynxOS
-      BSD4     - Any BSD 4.4 system
-      UNIX     - Any UNIX BSD/SYSV system
-+     HURD     - Hurd
- */
- 
- #if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
-@@ -136,6 +137,8 @@
- #  define Q_OS_UNIXWARE
- #elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */
- #  define Q_OS_UNIXWARE
-+#elif defined(__GNU__) /* To avoid confusion, like for mkspecs files */
-+#  define Q_OS_HURD
- #elif defined(__MAKEDEPEND__)
- #else
- #  error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
diff -u qt4-x11-4.2.1/debian/rules qt4-x11-4.2.1/debian/rules
--- qt4-x11-4.2.1/debian/rules
+++ qt4-x11-4.2.1/debian/rules
@@ -26,6 +26,13 @@
 	EXTRA_CONFIGURE_OPTS += -DQT_QLOCALE_USES_FCVT
 endif
 
+ifeq ($(DEB_HOST_ARCH_OS),linux)
+        PLATFORM_ARG = linux-g++
+else
+        PLATFORM_ARG = glibc-g++
+endif
+
+
 common-configure-arch::
 	./configure -confirm-license \
 	            -prefix "/usr" \
@@ -35,7 +42,7 @@
 	            -plugindir "/usr/lib/qt4/plugins" \
 	            -translationdir "/usr/share/qt4/translations" \
 	            -sysconfdir "/etc/qt4" \
-	            -platform linux-g++ \
+	            -platform $(PLATFORM_ARG) \
 		    -debug-and-release \
 	            -fast \
 	            -no-rpath \
only in patch2:
unchanged:
--- qt4-x11-4.2.1.orig/debian/patches/90_kfreebsd_mkspecs.dpatch
+++ qt4-x11-4.2.1/debian/patches/90_kfreebsd_mkspecs.dpatch
@@ -0,0 +1,25 @@
+#! /bin/sh -e
+## 90_kfreebsd_mkspecs.dpatch by Petr Salinger <Petr.Salinger@seznam.cz>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Create mkspecs/glibc-g++ from mkspecs/linux-g++, needed by GNU/kFreeBSD
+## DP: we cannot use directly linux-g++ due to src/corelib/io/io.pri
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch) 
+    	rm -rvf mkspecs/glibc-g++
+    	cp -av mkspecs/linux-g++ mkspecs/glibc-g++
+    ;;
+    -unpatch) 
+    	rm -rvf mkspecs/glibc-g++
+    ;;	
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1;;
+esac
+
+exit 0

Reply to: