package: libqglviewer version: 2.6.3+dfsg1-1 x-debbugs-cc: woo...@debian.org
libqglviewer FTBFS on armel and armhf, the qt4 and qt5 builds both fail for different reasons. wookey asked me to take a look at it.
The qt4 build is suffering from qreal vs double issues. These were fairly easy to patch.
The qt5 build is suffering from the fact that Debian builds qt5 on armel/armhf against opengl es. libqglviewer includes regular opengl headers leading to conflicting declarations. I tried patching it to include opengl es headers instead but I then ran into a load of stuff that only exists in desktop opengl. This needs the attention of an opengl expert if it's fixable at all.
It would probably be possible to modify the source package to only build the qt4 version on armel/armhf but given that qt4 is on it's way out that doesn't seem like the best idea to me.
debdiff of what i've done is attatched.
diff -Nru libqglviewer-2.6.3+dfsg1/debian/changelog libqglviewer-2.6.3+dfsg1/debian/changelog --- libqglviewer-2.6.3+dfsg1/debian/changelog 2015-06-26 17:01:38.000000000 +0000 +++ libqglviewer-2.6.3+dfsg1/debian/changelog 2015-11-05 16:09:03.000000000 +0000 @@ -1,3 +1,10 @@ +libqglviewer (2.6.3+dfsg1-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Attempt to fix build on arm* + + -- root <root@debian> Thu, 05 Nov 2015 16:08:55 +0000 + libqglviewer (2.6.3+dfsg1-1) unstable; urgency=medium * [7ad92fc] Add -qt4 packages. diff -Nru libqglviewer-2.6.3+dfsg1/debian/patches/arm-fixes libqglviewer-2.6.3+dfsg1/debian/patches/arm-fixes --- libqglviewer-2.6.3+dfsg1/debian/patches/arm-fixes 1970-01-01 00:00:00.000000000 +0000 +++ libqglviewer-2.6.3+dfsg1/debian/patches/arm-fixes 2015-11-06 09:43:11.000000000 +0000 @@ -0,0 +1,122 @@ +Description: <short summary of the patch> + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + libqglviewer (2.6.3+dfsg1-1.1) UNRELEASED; urgency=medium + . + * Non-maintainer upload. + * Attempt to fix build on arm* +Author: root <root@debian> + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: <vendor|upstream|other>, <url of original patch> +Bug: <url in upstream bugtracker> +Bug-Debian: https://bugs.debian.org/<bugnumber> +Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> +Forwarded: <no|not-needed|url proving that it has been forwarded> +Reviewed-By: <name and email of someone who approved the patch> +Last-Update: <YYYY-MM-DD> + +Index: libqglviewer-2.6.3+dfsg1/QGLViewer/vec.h +=================================================================== +--- libqglviewer-2.6.3+dfsg1.orig/QGLViewer/vec.h ++++ libqglviewer-2.6.3+dfsg1/QGLViewer/vec.h +@@ -157,7 +157,7 @@ public: + + #ifndef DOXYGEN + /*! This method is deprecated since version 2.0. Use operator const double* instead. */ +- const double* address() const { qWarning("Vec::address() is deprecated, use operator const double* instead."); return operator const double*(); } ++ const qreal* address() const { qWarning("Vec::address() is deprecated, use operator const double* instead."); return operator const qreal*(); } + #endif + + /*! Conversion operator returning the memory address of the vector. +@@ -168,7 +168,7 @@ public: + glNormal3dv(normal); + glVertex3dv(pos); + \endcode */ +- operator const double*() const { ++ operator const qreal*() const { + #ifdef QGLVIEWER_UNION_NOT_SUPPORTED + return &x; + #else +@@ -179,7 +179,7 @@ public: + /*! Non const conversion operator returning the memory address of the vector. + + Useful to pass a Vec to a method that requires and fills a \c double*, as provided by certain libraries. */ +- operator double*() { ++ operator qreal*() { + #ifdef QGLVIEWER_UNION_NOT_SUPPORTED + return &x; + #else +Index: libqglviewer-2.6.3+dfsg1/QGLViewer/quaternion.cpp +=================================================================== +--- libqglviewer-2.6.3+dfsg1.orig/QGLViewer/quaternion.cpp ++++ libqglviewer-2.6.3+dfsg1/QGLViewer/quaternion.cpp +@@ -101,7 +101,7 @@ Vec Quaternion::rotate(const Vec& v) con + + setFromRotatedBasis() sets a Quaternion from the three axis of a rotated frame. It actually fills + the three columns of a matrix with these rotated basis vectors and calls this method. */ +-void Quaternion::setFromRotationMatrix(const qreal m[3][3]) ++void Quaternion::setFromRotationMatrix(const double m[3][3]) + { + // Compute one plus the trace of the matrix + const qreal onePlusTrace = 1.0 + m[0][0] + m[1][1] + m[2][2]; +@@ -152,10 +152,10 @@ void Quaternion::setFromRotationMatrix(c + { + qWarning("setFromRotationMatrix now expects a double[3][3] parameter"); + +- qreal mat[3][3]; ++ double mat[3][3]; + for (int i=0; i<3; ++i) + for (int j=0; j<3; ++j) +- mat[i][j] = qreal(m[i][j]); ++ mat[i][j] = double(m[i][j]); + + setFromRotationMatrix(mat); + } +Index: libqglviewer-2.6.3+dfsg1/QGLViewer/quaternion.h +=================================================================== +--- libqglviewer-2.6.3+dfsg1.orig/QGLViewer/quaternion.h ++++ libqglviewer-2.6.3+dfsg1/QGLViewer/quaternion.h +@@ -129,7 +129,7 @@ public: + void setFromRotationMatrix(const float m[3][3]); + void setFromRotatedBase(const Vec& X, const Vec& Y, const Vec& Z); + #endif +- void setFromRotationMatrix(const qreal m[3][3]); ++ void setFromRotationMatrix(const double m[3][3]); + void setFromRotatedBasis(const Vec& X, const Vec& Y, const Vec& Z); + //@} + +Index: libqglviewer-2.6.3+dfsg1/QGLViewer/camera.cpp +=================================================================== +--- libqglviewer-2.6.3+dfsg1.orig/QGLViewer/camera.cpp ++++ libqglviewer-2.6.3+dfsg1/QGLViewer/camera.cpp +@@ -1044,7 +1044,7 @@ void Camera::fitSphere(const Vec& center + void Camera::fitBoundingBox(const Vec& min, const Vec& max) + { + qreal diameter = qMax(fabs(max[1]-min[1]), fabs(max[0]-min[0])); +- diameter = qMax(fabs(max[2]-min[2]), diameter); ++ diameter = qMax(qreal(fabs(max[2]-min[2])), diameter); + fitSphere(0.5*(min+max), 0.5*diameter); + } + +Index: libqglviewer-2.6.3+dfsg1/QGLViewer/saveSnapshot.cpp +=================================================================== +--- libqglviewer-2.6.3+dfsg1.orig/QGLViewer/saveSnapshot.cpp ++++ libqglviewer-2.6.3+dfsg1/QGLViewer/saveSnapshot.cpp +@@ -343,7 +343,7 @@ bool QGLViewer::saveImageSnapshot(const + qreal zNear = camera()->zNear(); + qreal zFar = camera()->zFar(); + +- qreal xMin, yMin; ++ GLdouble xMin, yMin; + bool expand = imageInterface->expandFrustum->isChecked(); + if (camera()->type() == qglviewer::Camera::PERSPECTIVE) + if ((expand && (newAspectRatio>aspectRatio)) || (!expand && (newAspectRatio<aspectRatio))) diff -Nru libqglviewer-2.6.3+dfsg1/debian/patches/series libqglviewer-2.6.3+dfsg1/debian/patches/series --- libqglviewer-2.6.3+dfsg1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ libqglviewer-2.6.3+dfsg1/debian/patches/series 2015-11-05 16:09:19.000000000 +0000 @@ -0,0 +1 @@ +arm-fixes diff -Nru libqglviewer-2.6.3+dfsg1/debian/rules libqglviewer-2.6.3+dfsg1/debian/rules --- libqglviewer-2.6.3+dfsg1/debian/rules 2015-06-26 17:00:41.000000000 +0000 +++ libqglviewer-2.6.3+dfsg1/debian/rules 2015-11-05 16:44:22.000000000 +0000 @@ -4,12 +4,14 @@ dh $@ --parallel --sourcedirectory=$(CURDIR)/QGLViewer override_dh_auto_configure: + sed -i s_GLES3/gl3.h_GL/glu.h_ QGLViewer/config.h mkdir -p $(CURDIR)/debian/qt4/ sed -i -- 's/TARGET = QGLViewer/TARGET = QGLViewer-qt4/g' QGLViewer/QGLViewer.pro QT_SELECT=qt4 dh_auto_configure cd QGLViewer ; $(MAKE) ; mv libQGLViewer-qt4* ../debian/qt4/ ; rm -rf .obj .moc *.prl Makefile ui_ImageInterface.h ui_VRenderInterface.h rm debian/*.log sed -i -- 's/TARGET = QGLViewer-qt4/TARGET = QGLViewer/g' QGLViewer/QGLViewer.pro + sed -i s_GL/glu.h_GLES3/gl3.h_ QGLViewer/config.h QT_SELECT=qt5 dh_auto_configure -- LIB_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) override_dh_auto_install: @@ -22,5 +24,6 @@ mv debian/qt4/* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ override_dh_auto_clean: + sed -i s_GLES3/gl3.h_GL/glu.h_ QGLViewer/config.h dh_auto_clean rm -rf $(CURDIR)/debian/qt4
-- debian-science-maintainers mailing list debian-science-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-science-maintainers