aboutsummaryrefslogtreecommitdiff
path: root/libraries/qt4/qt4.SlackBuild
blob: 555319903386dec8eb42c6b00d987efa12376759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/sh

# Slackware build script for Qt 4
# Written by Aleksandar Samardzic <asamardzic@gmail.com>
# Modified by Robby Workman <rworkman@slackbuilds.org>
# Modified by Heinz Wiesinger <pprkut@liwjatan.at>

PRGNAM=qt4
VERSION=${VERSION:-4.5.1}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
fi

if [ "${RASTER:-no}" = "no" ]; then
  GRAPHICS=""
else
  GRAPHICS="-graphicssystem raster"
fi

if [ "${PHONON:-yes}" = "yes" ]; then
  MEDIA="-phonon"
else
  MEDIA="-no-phonon"
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf qt-x11-opensource-src-$VERSION
tar xvf $CWD/qt-x11-opensource-src-$VERSION.tar.bz2
cd qt-x11-opensource-src-$VERSION
chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

if ! [ "${QTCOPY:-no}" = "no" ]; then
  patch -p0 -i $CWD/patches/0180-window-role.diff
  patch -p0 -i $CWD/patches/0195-compositing-properties.diff
  patch -p0 -i $CWD/patches/0225-invalidate-tabbar-geometry-on-refresh.patch
  patch -p0 -i $CWD/patches/0234-fix-mysql-threaded.diff
  patch -p0 -i $CWD/patches/0255-qtreeview-selection-columns-hidden.diff
  patch -p0 -i $CWD/patches/0274-shm-native-image-fix.diff
  patch -p0 -i $CWD/patches/0279-svg-rendering-regression.diff
  patch -p0 -i $CWD/patches/0280-deserialization-custom-dbus-properties.diff
fi

# The following two patches are taken from the qt.SlackBuild in -current
if [ $ARCH = "i486" ]; then
  patch -p1 -i $CWD/patches/qt.x86.cflags.diff
fi

# Fix path to mysql header
patch -p1 -i $CWD/patches/qt.mysql.h.diff

export CFLAGS="$SLKCFLAGS"
export CXXFLAGS="$SLKCFLAGS"
export OPENSOURCE_CXXFLAGS="$SLKCFLAGS"
echo $'o\nyes' | ./configure \
  -prefix /usr/lib/qt4 \
  -no-separate-debug-info \
  -nomake examples \
  -nomake demos \
  -qt-gif \
  -fast \
  -system-libpng \
  -system-libjpeg \
  -system-zlib \
  -dbus \
  -I/usr/include/mysql -L/usr/lib/mysql -R/usr/lib/mysql -plugin-sql-mysql \
  -webkit \
  -silent \
  $GRAPHICS \
  $MEDIA

make
make install INSTALL_ROOT=$PKG

( cd $PKG/usr/lib ; ln -sf qt4 qt-$VERSION )

# Qt4 uses different library names than Qt3 so this should be safe
# Link the shared libraries into /usr/lib:
( cd $PKG/usr/lib
  for file in qt4/lib/*.so* ; do
    ln -sf $file .
  done
)

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/bin
( cd $PKG/usr/bin
  for file in assistant assistant_adp designer lconvert linguist lrelease \
    lupdate moc pixeltool qcollectiongenerator qdbus qdbuscpp2xml qdbusviewer \
    qdbusxml2cpp qhelpconverter qhelpgenerator qmake qt3to4 qtconfig rcc uic \
    uic3 xmlpatterns;
  do
    ln -sf /usr/lib/qt4/bin/$file ${file}-qt4 ;
  done
)

mkdir -p $PKG/usr/lib/pkgconfig
( cd $PKG/usr/lib/pkgconfig
  for file in phonon.pc Qt3Support.pc QtAssistantClient.pc QtCLucene.pc \
    QtCore.pc QtDBus.pc QtDesigner.pc QtDesignerComponents QtGui.pc \
    QtHelp.pc QtNetwork.pc QtOpenGL.pc QtScript.pc QtScriptTools.pc QtSql.pc \
    QtSvg.pc QtTest.pc QtUiTools.pc QtWebKit.pc QtXml.pc QtXmlPatterns.pc ;
  do
    ln -sf /usr/lib/qt4/lib/pkgconfig/$file . ;
  done
)

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LGPL_EXCEPTION.txt INSTALL LICENSE.GPL* KNOWN.ISSUES \
  README changes-$VERSION \
  $PKG/usr/doc/$PRGNAM-$VERSION
( cd $PKG/usr/doc/$PRGNAM-$VERSION ; ln -sf /usr/lib/qt4/doc/html . )

cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz