Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- build() {
- cd qt-everywhere-opensource-src-$version
- # Fix parsing of tzfile(5) POSIX rule zone names with bracket quotes
- patch -p1 -d qtbase -i $SRC/qtbug-53071.patch
- patch -p1 -d qtbase -i $SRC/qtbug-53071b.patch
- # Fix UNSIGNED values in QMYSQL
- patch -p1 -d qtbase -i $SRC/qtbug-53237.patch
- # Respect system CXX
- [ "$CXX" ] || CXX=g++
- sed -i "/^QMAKE_CXX\s/s|=.*|= $CXX|" qtbase/mkspecs/common/g++-base.conf
- # Remove obsolete xorg path
- sed -i 's|X11R6/||g' qtbase/mkspecs/*/*.conf
- # Respect system CXXFLAGS
- sed -i "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${CXXFLAGS}|" qtbase/mkspecs/common/gcc-base.conf
- #sed -i "s|-O2|$CXXFLAGS|" qtbase/mkspecs/common/g++-unix.conf
- #sed -i "s|-O2|${CXXFLAGS}|" qtbase/mkspecs/common/{g++,gcc}-base.conf
- # Respect system LDFLAGS
- sed -i "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${LDFLAGS}|" qtbase/mkspecs/common/g++-unix.conf
- #sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS}|g" qtbase/mkspecs/common/gcc-base.conf
- # Fix quoting bug
- sed -i 's|"$COMPILER" -c|$COMPILER -c|' qtbase/config.tests/unix/fvisibility.test
- export QTDIR="$PWD"
- export LD_LIBRARY_PATH="$QTDIR/qtbase/lib:$QTDIR/qttools/lib:$LD_LIBRARY_PATH"
- export QT_PLUGIN_PATH="$QTDIR/qtbase/plugins"
- ./configure \
- -prefix /usr/share/qt5 \
- -bindir /usr/share/qt5/bin \
- -headerdir /usr/share/qt5/include \
- -libdir /usr/share/qt5/lib \
- -libexecdir /usr/share/qt5/lib \
- -plugindir /usr/share/qt5/plugins \
- -sysconfdir /usr/etc/xdg \
- -openssl-linked -dbus-linked \
- -no-cups -optimized-qmake \
- -nomake examples \
- # these are new
- -skip qtwebengine \# does anything actually need this?
- -qt-xkbcommon-x11 \ #should fix keyboard problems with some apps
- -opengl desktop \
- -no-egl \ # not sure about this one
- -no-separate-debug-info -no-strip -shared -no-rpath \
- -opensource -confirm-license -release -reduce-relocations
- make
- make INSTALL_ROOT=$PKG install
- # Fix paths
- find $PKG/usr/share/qt5/lib -type f -name '*.prl' \
- -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
- sed -e "s|$PWD/qtbase|/usr/share/qt5/lib|g" \
- -i $PKG/usr/share/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
- # Remove unnecessary files
- rm -rf $(find $PKG/usr/share/qt5/mkspecs/* | \
- egrep -v '(linux-g++|common|modules|pri|features)')
- rm -f $PKG/usr/share/qt5/mkspecs/linux-g++/linux-g++
- rm -rf $PKG/usr/share/qt5/mkspecs/features/{mac,win32}
- rm -rf $PKG/usr/share/qt5/mkspecs/common/mac*
- rm -rf $PKG/usr/share/qt5/{phrasebooks,translations}
- # Install linker config
- install -d $PKG/{etc/ld.so.conf.d,usr/{bin,lib,include}}
- echo "/usr/share/qt5/lib" > $PKG/etc/ld.so.conf.d/qt5.conf
- ln -s ../share/qt5/include $PKG/usr/include/qt5
- ln -s ../share/qt5/lib $PKG/usr/lib/qt5
- ln -s linux-g++ $PKG/usr/share/qt5/mkspecs/default
- # Install pkg config
- mv $PKG/usr/share/qt5/lib/pkgconfig $PKG/usr/lib
- # Fix paths
- sed \
- -e "s|-L$SRC/qt-everywhere-opensource-src-$version/lib ||g" \
- -e "s|$SRC/qt-everywhere-opensource-src-$version/bin|/usr/share/qt5/bin|g" \
- -i $PKG/usr/lib/pkgconfig/*.pc
- # Install useful symlinks
- install -d $PKG/usr/bin
- for b in $PKG/usr/share/qt5/bin/*; do
- ln -s /usr/share/qt5/bin/$(basename $b) $PKG/usr/bin/$(basename $b)-qt5
- done
- # cmake
- install -d $PKG/usr/lib/cmake
- for b in $PKG/usr/share/qt5/lib/cmake/*; do
- ln -s /usr/share/qt5/lib/cmake/$(basename $b) $PKG/usr/lib/cmake/$(basename $b)
- done
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement