summaryrefslogtreecommitdiff
path: root/graphics/qcad/qcad.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/qcad/qcad.SlackBuild')
-rw-r--r--graphics/qcad/qcad.SlackBuild50
1 files changed, 35 insertions, 15 deletions
diff --git a/graphics/qcad/qcad.SlackBuild b/graphics/qcad/qcad.SlackBuild
index b4cdc5d3f6..0af254919b 100644
--- a/graphics/qcad/qcad.SlackBuild
+++ b/graphics/qcad/qcad.SlackBuild
@@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=qcad
-VERSION=${VERSION:-3.12.1.0}
+VERSION=${VERSION:-3.12.4.8}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -69,8 +69,17 @@ 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 {} \;
-qmake QMAKE_CFLAGS+="$SLKCFLAGS" QMAKE_CXXFLAGS+="$SLKCFLAGS" \
- CONFIG+=release -o Makefile $PRGNAM.pro
+
+# Build with Qt5/Qt4. Default is Qt4.
+if [ "${QT5:-no}" == "yes" ]; then
+ qmake-qt5 QMAKE_CFLAGS+="$SLKCFLAGS" QMAKE_CXXFLAGS+="$SLKCFLAGS" \
+ CONFIG+=release -o Makefile $PRGNAM.pro
+ QTDIRECTORY="qt5"
+else
+ qmake QMAKE_CFLAGS+="$SLKCFLAGS" QMAKE_CXXFLAGS+="$SLKCFLAGS" \
+ CONFIG+=release -o Makefile $PRGNAM.pro
+ QTDIRECTORY="qt"
+fi
make
@@ -80,23 +89,33 @@ cp -ar examples fonts libraries linetypes patterns plugins scripts ts $PKG/usr/s
cp release/* $PKG/usr/share/$PRGNAM
install -m 0755 $CWD/$PRGNAM.sh $PKG/usr/bin/$PRGNAM
-# Don't repackage libraries that already come with qt4.
-rm -f $PKG/usr/share/$PRGNAM/plugins/designer/libqwebview.so \
+# Don't repackage libraries that already come with Qt4/Qt5.
+rm -f $PKG/usr/share/$PRGNAM/plugins/designer/{libqwebview.so,readme.txt} \
$PKG/usr/share/$PRGNAM/plugins/sqldrivers/* \
- $PKG/usr/share/$PRGNAM/plugins/imageformats/* \
- $PKG/usr/share/$PRGNAM/plugins/codecs/*
+ $PKG/usr/share/$PRGNAM/plugins/imageformats/*
-ln -s /usr/lib${LIBDIRSUFFIX}/qt/plugins/designer/libqwebview.so \
+ln -s /usr/lib${LIBDIRSUFFIX}/${QTDIRECTORY}/plugins/designer/libqwebview.so \
$PKG/usr/share/$PRGNAM/plugins/designer/libqwebview.so
-for i in /usr/lib${LIBDIRSUFFIX}/qt/plugins/imageformats/*.so; do
+for i in /usr/lib${LIBDIRSUFFIX}/${QTDIRECTORY}/plugins/imageformats/*.so; do
ln -s $i $PKG/usr/share/$PRGNAM/plugins/imageformats/$(basename $i)
done
-for i in /usr/lib${LIBDIRSUFFIX}/qt/plugins/sqldrivers/*.so; do
+for i in /usr/lib${LIBDIRSUFFIX}/${QTDIRECTORY}/plugins/sqldrivers/*.so; do
ln -s $i $PKG/usr/share/$PRGNAM/plugins/sqldrivers/$(basename $i)
done
-for i in /usr/lib${LIBDIRSUFFIX}/qt/plugins/codecs/*; do
- ln -s $i $PKG/usr/share/$PRGNAM/plugins/codecs/$(basename $i)
-done
+
+if [ "$QT5" == "yes" ]; then
+ rm -rf $PKG/usr/share/$PRGNAM/plugins/codecs \
+ $PKG/usr/share/$PRGNAM/plugins/printsupport/readme.txt
+ for i in /usr/lib${LIBDIRSUFFIX}/${QTDIRECTORY}/plugins/printsupport/*; do
+ ln -s $i $PKG/usr/share/$PRGNAM/plugins/printsupport/$(basename $i)
+ done
+else
+ rm -rf $PKG/usr/share/$PRGNAM/plugins/codecs/* \
+ $PKG/usr/share/$PRGNAM/plugins/printsupport
+ for i in /usr/lib${LIBDIRSUFFIX}/${QTDIRECTORY}/plugins/codecs/*; do
+ ln -s $i $PKG/usr/share/$PRGNAM/plugins/codecs/$(basename $i)
+ done
+fi
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -106,12 +125,13 @@ install -m 0644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications
for i in 16 32 48 64 96 128; do
convert scripts/${PRGNAM}_icon.png -resize ${i}x${i}! $PRGNAM-$i.png
- install -D -m 0644 $PRGNAM-$i.png $PKG/usr/share/icons/hicolor/${i}x${i}/$PRGNAM.png
+ install -D -m 0644 $PRGNAM-$i.png $PKG/usr/share/icons/hicolor/${i}x${i}/apps/$PRGNAM.png
done
# A little clean up.
find $PKG \( -name "*\.pro" -o -name "*\.pri" -o -name "*\.a" \
- -o -name "*\.ts" \) -exec rm -f '{}' \;
+ -o -name "*\.ts" -o -name "\.gitignore" \) -exec rm -f '{}' \;
+find $PKG -type d -empty -delete
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a *.txt README.md $PKG/usr/doc/$PRGNAM-$VERSION