3 # Slackware build script for "python3-PyQt5".
5 # Copyright 2008 Aleksandar Samardzic <asamardzic@gmail.com>
6 # Copyright 2008, 2009, 2010, 2011, 2015 Patrick J. Volkerding, Sebeka, MN, USA
7 # Copyright 2015 Marcel Saegebarth <marc@mos6581.de>
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted provided that the following conditions are
14 # * Redistributions of source code must retain the above copyright
15 # notice, this list of conditions and the following disclaimer.
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 # Modified by Robby Workman <rworkman@slackware.com>
30 # Modified by Eric Hameleers <alien@slackware.com>
31 # Adapted by Marcel Saegebarth <marc@mos6581.de>
35 VERSION=${VERSION:-5.9.2}
39 if [ -z "$ARCH" ]; then
40 case "$( uname -m )" in
43 *) ARCH=$( uname -m ) ;;
49 PKG=$TMP/package-$PRGNAM
50 OUTPUT=${OUTPUT:-/tmp}
52 if [ "$ARCH" = "i486" ]; then
53 SLKCFLAGS="-O2 -march=i486 -mtune=i686"
55 elif [ "$ARCH" = "i686" ]; then
56 SLKCFLAGS="-O2 -march=i686 -mtune=i686"
58 elif [ "$ARCH" = "x86_64" ]; then
66 PYTHONVER=$(python3 -V 2>&1 | cut -f 2 -d' ' | cut -f 1-2 -d.)
71 mkdir -p $TMP $PKG $OUTPUT
73 rm -rf ${SRCNAM}_gpl-$VERSION
74 tar xvf $CWD/${SRCNAM}_gpl-$VERSION.tar.gz
75 cd ${SRCNAM}_gpl-$VERSION
78 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
79 -o -perm 511 \) -exec chmod 755 {} \; -o \
80 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
81 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
83 # This is needed or an include from dbus is missed (thanks, Archlinux)
84 sed -i '/target_config.dbus_inc_dirs = \[\]/d' configure.py
86 export QTDIR=/usr/lib${LIBDIRSUFFIX}/qt5
87 export QT5DIR=/usr/lib${LIBDIRSUFFIX}/qt5
89 export CFLAGS="$SLKCFLAGS"
90 export CXXFLAGS="$SLKCFLAGS"
92 python3 configure.py \
95 -q /usr/bin/qmake-qt5 \
96 --sip=/usr/bin/python3-sip \
97 --sip-incdir=/usr/include/python$PYTHONVER
100 make install DESTDIR=$PKG INSTALL_ROOT=$PKG
102 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
103 | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
105 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
106 cp -a ChangeLog LICENSE NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
107 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
109 mkdir -p $PKG/install
110 cat $CWD/slack-desc > $PKG/install/slack-desc
113 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}