summaryrefslogtreecommitdiff
path: root/graphics/LDView/LDView.SlackBuild
diff options
context:
space:
mode:
authorPhilip van der Hoeven <philip@vd-hoeven.nl>2016-08-07 01:02:44 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-08-07 18:55:32 +0700
commit5517cfcda7c936b371b5a571abcdf94dc1e5175f (patch)
treefbd0af7c10e397c8c22e416b8abc121a6e1a19ef /graphics/LDView/LDView.SlackBuild
parentb1d591b130c30c570d15c7e9d156b7f226402958 (diff)
downloadslackbuilds-5517cfcda7c936b371b5a571abcdf94dc1e5175f.tar.gz
graphics/LDView: Updated for version 4.2.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'graphics/LDView/LDView.SlackBuild')
-rw-r--r--graphics/LDView/LDView.SlackBuild92
1 files changed, 48 insertions, 44 deletions
diff --git a/graphics/LDView/LDView.SlackBuild b/graphics/LDView/LDView.SlackBuild
index a8cb4ea400..9f5739c85d 100644
--- a/graphics/LDView/LDView.SlackBuild
+++ b/graphics/LDView/LDView.SlackBuild
@@ -4,7 +4,7 @@
# a program to visualize LDraw files
# Copyright 2009-2010, 2012-2013 Niels Horn, Rio de Janeiro, Brazil
-# Copyright 2015 Philip van der Hoeven, Almere, The Netherlands
+# Copyright 2015-2016 Philip van der Hoeven, Almere, The Netherlands
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,13 +25,15 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=LDView
-VERSION=${VERSION:-4.2beta1}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-4.2}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+SRCVER=$(echo $VERSION|tr . _)
+SRCNAM=$(echo $PRGNAM|tr '[A-Z]' '[a-z]')
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -42,31 +44,28 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
- LDVDEV64=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
- LDVDEV64=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
- LDVDEV64=YES
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
- LDVDEV64=""
fi
set -e
-rm -rf $TMP/$PRGNAM $PKG
+rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $PRGNAM
+rm -rf $SRCNAM-$SRCVER
+tar xvf $CWD/$SRCNAM-$SRCVER.tar.gz || tar xvf $CWD/v$SRCVER.tar.gz
+cd $SRCNAM-$SRCVER
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -74,55 +73,60 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-# Patch for gcc-4.7
-patch -p1 < $CWD/LDView_gcc47.patch
-
-# Patch for boost-1.50
-# see https://svn.boost.org/trac/boost/ticket/6940
-patch -p1 < $CWD/LDView_boost15.patch
-
-# Patch for GL problems
-patch -p1 < $CWD/LDView_GL.patch
-
-# the 'makeall' script is in the QT directory
cd QT
-# Fix LDView.pro for gcc-4.7
-sed -e 's/-ljpeg/-ljpeg -lpng -lz -lboost_system -lGLU/' -i LDView.pro
+# Fix path to LDraw library
+sed -i 's@/usr/share/ldraw@/usr/share/LDRAW@' ModelViewerWidget.cpp
+
+if [ "$ARCH" = "x86_64" ]; then
+ PLATFORM=linux-g++-64
+else
+ PLATFORM=linux-g++-32
+fi
+qmake LIBS+=-lboost_system -spec $PLATFORM
+lrelease LDView.pro
+make "TESTING=-I ../gl2ps -I ../3rdParty/tinyxml"
-export LDVDEV64
-QTDIR=$QT4DIR TESTING="$SLKCFLAGS" ./makeall
# Install manually
mkdir -p $PKG/usr/bin
-cp -a $PRGNAM $PKG/usr/bin/${PRGNAM}_bin
-strip --strip-unneeded $PKG/usr/bin/${PRGNAM}_bin
-cat $CWD/$PRGNAM.sh > $PKG/usr/bin/$PRGNAM
+cp -a $PRGNAM $PKG/usr/bin/${PRGNAM}
+strip --strip-unneeded $PKG/usr/bin/${PRGNAM}
chmod 0755 $PKG/usr/bin/$PRGNAM
cd ..
# Sample files, font, translations
-mkdir -p $PKG/usr/share/$PRGNAM
+mkdir -p $PKG/usr/share/$SRCNAM
cp 8464.mpd m6459.ldr Textures/SansSerif.fnt \
- $PKG/usr/share/$PRGNAM/
+ $PKG/usr/share/$SRCNAM/
cp Translations/Czech/LDViewMessages.ini \
- $PKG/usr/share/$PRGNAM/LDViewMessages_cz.ini
+ $PKG/usr/share/$SRCNAM/LDViewMessages_cz.ini
cp Translations/EnglishUS/LDViewMessages.ini \
- $PKG/usr/share/$PRGNAM/LDViewMessages_en_US.ini
+ $PKG/usr/share/$SRCNAM/LDViewMessages_en_US.ini
cp Translations/German/LDViewMessages.ini \
- $PKG/usr/share/$PRGNAM/LDViewMessages_de.ini
+ $PKG/usr/share/$SRCNAM/LDViewMessages_de.ini
cp Translations/Hungarian/LDViewMessages.ini \
- $PKG/usr/share/$PRGNAM/LDViewMessages_hu.ini
+ $PKG/usr/share/$SRCNAM/LDViewMessages_hu.ini
cp Translations/Italian/LDViewMessages.ini \
- $PKG/usr/share/$PRGNAM/LDViewMessages_it.ini
+ $PKG/usr/share/$SRCNAM/LDViewMessages_it.ini
cat LDViewMessages.ini LDExporter/LDExportMessages.ini \
- > $PKG/usr/share/$PRGNAM/LDViewMessages.ini
-
-# Copy icon & desktop file to package
-mkdir -p $PKG/usr/share/{applications,mime/packages,pixmaps}
-cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
-convert Icons/LDViewIcon.gif $PKG/usr/share/pixmaps/$PRGNAM.png
+ > $PKG/usr/share/$SRCNAM/LDViewMessages.ini
+cp QT/ldview_en.qm $PKG/usr/share/$SRCNAM/ldview_en.qm
+cp QT/ldview_de.qm $PKG/usr/share/$SRCNAM/ldview_de.qm
+cp QT/ldview_it.qm $PKG/usr/share/$SRCNAM/ldview_it.qm
+cp QT/ldview_cz.qm $PKG/usr/share/$SRCNAM/ldview_cz.qm
+cp LDExporter/LGEO.xml $PKG/usr/share/$SRCNAM/LGEO.xml
+
+# Icon, desktop and mime stuff
+mkdir -p $PKG/usr/share/{applications,application-registry,mime/packages,mime-info}
+mkdir -p $PKG/usr/share/icons/gnome/32x32/mimetypes
+cat QT/desktop/ldview.desktop > $PKG/usr/share/applications/ldview.desktop
cat QT/desktop/ldraw.xml > $PKG/usr/share/mime/packages/ldraw.xml
+cp QT/desktop/ldraw.keys $PKG/usr/share/mime-info/ldraw.keys
+cp QT/desktop/ldraw.mime $PKG/usr/share/mime-info/ldraw.mime
+cp QT/desktop/ldview.applications $PKG/usr/share/application-registry/ldview.applications
+cp QT/images/LDViewIcon.png $PKG/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-ldraw.png
+cp QT/images/LDViewIcon.png $PKG/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-multipart-ldraw.png
# Documentation
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html