2011-03-25 03:54:54 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-03-24 23:20:08 +01:00
|
|
|
# Formerly maintained by:
|
|
|
|
# Ryan P.C. McQuen | Everett, WA | <email removed>
|
|
|
|
|
|
|
|
# Now maintained by B. Watson <yalhcru@gmail.com>
|
2015-02-07 00:19:54 +01:00
|
|
|
|
2011-03-25 03:54:54 +01:00
|
|
|
# Copyright 2006, 2007, 2008 Patrick J. Volkerding, Sebeka, MN, USA
|
|
|
|
# All rights reserved.
|
2012-09-13 16:04:37 +02:00
|
|
|
# Copyright 2010-2012 Niels Horn, Rio de Janeiro, RJ, Brazil
|
2011-03-25 03:54:54 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
# This is based on the original SlackBuild from /extra/kde-compat in
|
|
|
|
# Slackware 13.1
|
|
|
|
|
2018-02-09 08:59:44 +01:00
|
|
|
# Adapted for SlackBuilds.org by Niels Horn <email removed>
|
2011-03-25 03:54:54 +01:00
|
|
|
# - moved building from /opt to $TMP
|
|
|
|
# - included patch for new libpng (based on work by Stuart Winter)
|
2012-09-13 16:04:37 +02:00
|
|
|
# Revision date 2012/08/09
|
2011-03-25 03:54:54 +01:00
|
|
|
|
2018-02-09 08:59:44 +01:00
|
|
|
# 20180209 bkw: fix download link, pkgs.fedoraproject.org is now toast.
|
|
|
|
|
2017-03-24 23:20:08 +01:00
|
|
|
# 20170324 bkw:
|
|
|
|
# - take over maintenance.
|
|
|
|
# - i486=>i586.
|
|
|
|
# - use + rather than ; with find/chmod, speeds things up slightly.
|
|
|
|
# - minor fix: stripping -jN from MAKEFLAGS failed, if N>9 (or if
|
|
|
|
# less than 9, with leading zero(es): -j05 for example).
|
|
|
|
|
|
|
|
# TODO: fix these:
|
|
|
|
#sbrun: WARNING: files altered outside the sandbox:
|
|
|
|
#u /root/.qt/.qt_plugins_3.3rc.lock
|
|
|
|
#t /root/.qt/qt_plugins_3.3rc.tmp
|
|
|
|
#u /root/.qt/qt_plugins_3.3rc
|
|
|
|
|
2011-03-25 03:54:54 +01:00
|
|
|
PRGNAM=qt3
|
|
|
|
VERSION=${VERSION:-3.3.8b}
|
2016-07-22 22:35:25 +02:00
|
|
|
BUILD=${BUILD:-5}
|
2011-03-25 03:54:54 +01:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
SRCNAM=qt-x11-free
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2017-03-24 23:20:08 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2011-03-25 03:54:54 +01:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-03-24 23:20:08 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2011-03-25 03:54:54 +01:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
|
|
|
|
# Don't build a devel package (but put a devel SYSTEM on this machine...)
|
|
|
|
NODEVEL=true
|
|
|
|
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $SRCNAM-$VERSION
|
|
|
|
tar xvf $CWD/qt-x11-free-$VERSION.tar.gz
|
|
|
|
cd $SRCNAM-$VERSION
|
|
|
|
|
|
|
|
# Force CFLAGS in qmake.conf
|
|
|
|
sed -i "/QMAKE_CFLAGS_RELEASE/s|-O2|$SLKCFLAGS|" mkspecs/linux-g++/qmake.conf
|
|
|
|
|
|
|
|
# Use built-in gif reader
|
|
|
|
sed -i "/#define QT_BUILTIN_GIF_READER/s|0|1|" src/kernel/qgif.h
|
|
|
|
|
|
|
|
# Fix location of mysql.h
|
|
|
|
sed -i "s|mysql\.h|mysql/mysql\.h|" src/sql/drivers/mysql/qsql_mysql.h
|
|
|
|
|
2015-08-05 00:55:04 +02:00
|
|
|
# Build with libpng 1.5+ (patch from Arch Linux)
|
|
|
|
patch -lp0 < $CWD/qt3-png15.patch
|
2011-03-25 03:54:54 +01:00
|
|
|
|
2015-02-07 00:19:54 +01:00
|
|
|
# Patch for gcc-4.7+ (based on info from LFS)
|
2012-09-13 16:04:37 +02:00
|
|
|
patch -p1 < $CWD/qt3_gcc47.patch
|
|
|
|
|
2011-03-25 03:54:54 +01:00
|
|
|
# Make sure ownerships and permissions are sane:
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2017-03-24 23:20:08 +01:00
|
|
|
-exec chmod 755 {} \+ -o \
|
2011-03-25 03:54:54 +01:00
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
2017-03-24 23:20:08 +01:00
|
|
|
-exec chmod 644 {} \+
|
2011-03-25 03:54:54 +01:00
|
|
|
|
|
|
|
# And here's what we are currently using. The "yes" agrees to the GPL, so don't run this script if you
|
|
|
|
# don't agree. :-)
|
|
|
|
echo "yes" | \
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
-prefix /opt/kde3/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION \
|
|
|
|
-release \
|
|
|
|
-system-zlib \
|
|
|
|
-system-libpng \
|
|
|
|
-qt-imgfmt-png \
|
|
|
|
-system-libmng \
|
|
|
|
-qt-imgfmt-mng \
|
|
|
|
-system-libjpeg \
|
|
|
|
-qt-imgfmt-jpeg \
|
|
|
|
-qt-gif \
|
|
|
|
-thread \
|
|
|
|
-stl \
|
|
|
|
-no-g++-exceptions \
|
|
|
|
-xft \
|
|
|
|
-plugin-sql-mysql \
|
|
|
|
-plugin-style-cde \
|
|
|
|
-plugin-style-compact \
|
|
|
|
-qt-style-motif \
|
|
|
|
-plugin-style-motifplus \
|
|
|
|
-plugin-style-platinum \
|
|
|
|
-plugin-style-sgi \
|
|
|
|
-plugin-style-windows \
|
|
|
|
-enable-opengl
|
|
|
|
|
2016-07-22 22:35:25 +02:00
|
|
|
# Set QTDIR...
|
|
|
|
QTDIR=$PKG/opt/kde3/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION
|
|
|
|
|
|
|
|
# Point LD_LIBRARY_PATH to the new libs
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib:$TMP/$SRCNAM-$VERSION/lib
|
|
|
|
|
2013-11-19 20:43:55 +01:00
|
|
|
# Strip jobs number from the MAKEFLAGS (needed)
|
2017-03-24 23:20:08 +01:00
|
|
|
MAKEFLAGS=$(echo "$MAKEFLAGS" | sed "s/-j[0-9]*//g")
|
2011-03-25 03:54:54 +01:00
|
|
|
# We're using '-i' to work around a bug where the build tries to strip html files.
|
|
|
|
# Build the important stuff:
|
2013-11-13 02:13:28 +01:00
|
|
|
make -i -j1
|
2011-03-25 03:54:54 +01:00
|
|
|
|
2016-07-22 22:35:25 +02:00
|
|
|
# "make + install" the rest...
|
|
|
|
make install INSTALL_ROOT=$PKG
|
2011-03-25 03:54:54 +01:00
|
|
|
make -i symlinks sub-src sub-tools
|
|
|
|
make install INSTALL_ROOT=$PKG
|
|
|
|
|
|
|
|
# Link the shared libraries into /opt/kde3/lib
|
|
|
|
cd $PKG/opt/kde3/lib${LIBDIRSUFFIX}
|
|
|
|
for file in $PRGNAM-$VERSION/lib/*.so* ; do
|
|
|
|
ln -sf $file .
|
|
|
|
done
|
|
|
|
cd -
|
|
|
|
|
|
|
|
# Leave these out so as not to interfere with Qt4:
|
|
|
|
if [ -z "$NODEVEL" ]; then
|
|
|
|
# Add man pages:
|
|
|
|
mkdir -p $PKG/usr/man
|
|
|
|
cp -a doc/man/* $PKG/usr/man
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 "{}" \;
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Put profile.d scripts in package w/ correct lib-path
|
|
|
|
mkdir -p $PKG/etc/profile.d
|
|
|
|
cat $CWD/profile.d/qt.sh | sed -e "s#/lib#/lib${LIBDIRSUFFIX}#" \
|
|
|
|
> $PKG/etc/profile.d/qt.sh
|
|
|
|
cat $CWD/profile.d/qt.csh | sed -e "s#/lib#/lib${LIBDIRSUFFIX}#" \
|
|
|
|
> $PKG/etc/profile.d/qt.csh
|
|
|
|
chmod 755 $PKG/etc/profile.d/*
|
|
|
|
|
|
|
|
# Strip binaries:
|
2015-02-07 00:19:54 +01:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
2011-03-25 03:54:54 +01:00
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
|
|
|
|
# Make links to the qt3 binaries
|
|
|
|
mkdir -p $PKG/opt/kde3/bin
|
|
|
|
cd $PKG/opt/kde3/bin
|
|
|
|
for file in assistant designer linguist lrelease lupdate moc qm2ts qmake qtconfig uic ; do
|
|
|
|
ln -sf ../lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/bin/$file .
|
|
|
|
done
|
|
|
|
cd -
|
|
|
|
|
|
|
|
# Make a link to qt-mt.pc
|
|
|
|
mkdir -p $PKG/opt/kde3/lib${LIBDIRSUFFIX}/pkgconfig
|
|
|
|
cd $PKG/opt/kde3/lib${LIBDIRSUFFIX}/pkgconfig
|
|
|
|
ln -sf ../$PRGNAM-$VERSION/lib/pkgconfig/qt-mt.pc .
|
|
|
|
cd -
|
|
|
|
|
|
|
|
# Add a documentation directory:
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
|
|
|
FAQ INSTALL LICENSE.GPL* LICENSE.QPL MANIFEST PLATFORMS README* changes* \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
|
|
|
|
# Make a link to "qt3" w/o version number
|
|
|
|
cd $PKG/opt/kde3/lib${LIBDIRSUFFIX}
|
|
|
|
ln -sf qt3-${VERSION} qt3
|
|
|
|
cd -
|
|
|
|
|
|
|
|
# This much documentation isn't needed for the compat qt3 package -- look in the
|
|
|
|
# source if you need it.
|
|
|
|
rm -rf $PKG/opt/kde3/lib${LIBDIRSUFFIX}/qt3/doc
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/doinst.sh | sed -e "s|/lib|/lib${LIBDIRSUFFIX}|" \
|
|
|
|
> $PKG/install/doinst.sh
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2011-12-11 23:42:08 +01:00
|
|
|
/sbin/makepkg -p -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|