graphics/LDView: Fixed to build against gcc-4.7

Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
This commit is contained in:
Niels Horn 2012-09-13 16:22:49 -03:00 committed by Niels Horn
parent 4032bd1ac5
commit f11d880637
2 changed files with 53 additions and 5 deletions

View File

@ -3,19 +3,37 @@
# Slackware build script for LDView:
# a program to visualize LDraw files
# Written by Niels Horn - niels.horn@gmail.com
# revision date 2010/06/05
# Copyright 2009-2010, 2012 Niels Horn, Rio de Janeiro, Brazil
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# revision date 2012/09/13
PRGNAM=LDView
VERSION=4.1
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
@ -56,10 +74,17 @@ chmod -R u+w,go+r-w,a-s .
# Patch for a bug in QT, solves problems on NVIDIA cards
patch -p1 < $CWD/opengl.patch
# Patch for gcc-4.7
patch -p1 < $CWD/LDView_gcc47.patch
# the 'makeall' script is in the QT directory
cd QT
# Fix LDView.pro for gcc-4.7
sed -e 's/-ljpeg/-ljpeg -lpng14 -lz -lGLU/' -i LDView.pro
export LDVDEV64
QTDIR=$QT4DIR TESTING=$SLKCFLAGS ./makeall
QTDIR=$QT4DIR TESTING="$SLKCFLAGS" ./makeall
# Install manually
mkdir -p $PKG/usr/bin

View File

@ -0,0 +1,23 @@
--- LDView-4.1/TCFoundation/TCArray.h 2008-05-18 18:16:21.000000000 -0300
+++ LDView-4.1_patched/TCFoundation/TCArray.h 2012-09-13 14:32:40.000000000 -0300
@@ -2,6 +2,7 @@
#define __TCARRAY_H__
#include <TCFoundation/TCObject.h>
+#include <TCFoundation/mystring.h>
typedef int (*TCArraySortFunction)(const void*, const void*);
--- LDView-4.1/TCFoundation/mystring.h 2009-11-17 00:45:34.000000000 -0200
+++ LDView-4.1_patched/TCFoundation/mystring.h 2012-09-13 14:33:51.000000000 -0300
@@ -13,6 +13,10 @@
#include <Qt/qstring.h>
#endif // _QT
+#ifndef WIN32
+#include <unistd.h>
+#endif
+
#ifdef _OSMESA
#include <stdarg.h>
#endif // _OSMESA