]> git.friedersdorff.com Git - max/slackbuilds.git/blob - libraries/python3-PyQt5/python3-PyQt5.SlackBuild
Add packages for qutebrowser and it's dependencies
[max/slackbuilds.git] / libraries / python3-PyQt5 / python3-PyQt5.SlackBuild
1 #!/bin/sh
2
3 # Slackware build script for "python3-PyQt5".
4
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>
8 # All rights reserved.
9 #
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted provided that the following conditions are
12 # met:
13 #
14 # * Redistributions of source code must retain the above copyright
15 # notice, this list of conditions and the following disclaimer.
16 #
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.
28
29 # Modified by Robby Workman <rworkman@slackware.com>
30 # Modified by Eric Hameleers <alien@slackware.com>
31 # Adapted by Marcel Saegebarth <marc@mos6581.de>
32
33 PRGNAM=python3-PyQt5
34 SRCNAM=PyQt5
35 VERSION=${VERSION:-5.9.2}
36 BUILD=${BUILD:-1}
37 TAG=${TAG:-_SBo}
38
39 if [ -z "$ARCH" ]; then
40   case "$( uname -m )" in
41     i?86) ARCH=i486 ;;
42     arm*) ARCH=arm ;;
43        *) ARCH=$( uname -m ) ;;
44   esac
45 fi
46
47 CWD=$(pwd)
48 TMP=${TMP:-/tmp/SBo}
49 PKG=$TMP/package-$PRGNAM
50 OUTPUT=${OUTPUT:-/tmp}
51
52 if [ "$ARCH" = "i486" ]; then
53   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
54   LIBDIRSUFFIX=""
55 elif [ "$ARCH" = "i686" ]; then
56   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
57   LIBDIRSUFFIX=""
58 elif [ "$ARCH" = "x86_64" ]; then
59   SLKCFLAGS="-O2 -fPIC"
60   LIBDIRSUFFIX="64"
61 else
62   SLKCFLAGS="-O2"
63   LIBDIRSUFFIX=""
64 fi
65
66 PYTHONVER=$(python3 -V 2>&1 | cut -f 2 -d' ' | cut -f 1-2 -d.)
67
68 set -e
69
70 rm -rf $PKG
71 mkdir -p $TMP $PKG $OUTPUT
72 cd $TMP
73 rm -rf ${SRCNAM}_gpl-$VERSION
74 tar xvf $CWD/${SRCNAM}_gpl-$VERSION.tar.gz
75 cd ${SRCNAM}_gpl-$VERSION
76 chown -R root:root .
77 find -L . \
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 {} \;
82
83 # This is needed or an include from dbus is missed (thanks, Archlinux)
84 sed -i '/target_config.dbus_inc_dirs = \[\]/d' configure.py
85
86 export QTDIR=/usr/lib${LIBDIRSUFFIX}/qt5
87 export QT5DIR=/usr/lib${LIBDIRSUFFIX}/qt5
88
89 export CFLAGS="$SLKCFLAGS"
90 export CXXFLAGS="$SLKCFLAGS"
91
92 python3 configure.py \
93   --confirm-license \
94   --verbose \
95   -q /usr/bin/qmake-qt5 \
96   --sip=/usr/bin/python3-sip \
97   --sip-incdir=/usr/include/python$PYTHONVER
98
99 make
100 make install DESTDIR=$PKG INSTALL_ROOT=$PKG
101
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
104
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
108
109 mkdir -p $PKG/install
110 cat $CWD/slack-desc > $PKG/install/slack-desc
111
112 cd $PKG
113 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}