daily pastebin goal
10%
SHARE
TWEET

qt5 pkgfile

a guest Jul 23rd, 2016 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. build() {
  2.     cd qt-everywhere-opensource-src-$version
  3.  
  4.     # Fix parsing of tzfile(5) POSIX rule zone names with bracket quotes
  5.     patch -p1 -d qtbase -i $SRC/qtbug-53071.patch
  6.     patch -p1 -d qtbase -i $SRC/qtbug-53071b.patch
  7.  
  8.     # Fix UNSIGNED values in QMYSQL
  9.     patch -p1 -d qtbase -i $SRC/qtbug-53237.patch
  10.  
  11.     # Respect system CXX
  12.     [ "$CXX" ] || CXX=g++
  13.     sed -i "/^QMAKE_CXX\s/s|=.*|= $CXX|"  qtbase/mkspecs/common/g++-base.conf
  14.  
  15.     # Remove obsolete xorg path
  16.     sed -i 's|X11R6/||g' qtbase/mkspecs/*/*.conf
  17.  
  18.     # Respect system CXXFLAGS
  19.     sed -i "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${CXXFLAGS}|" qtbase/mkspecs/common/gcc-base.conf
  20.     #sed -i "s|-O2|$CXXFLAGS|" qtbase/mkspecs/common/g++-unix.conf
  21.     #sed -i "s|-O2|${CXXFLAGS}|" qtbase/mkspecs/common/{g++,gcc}-base.conf
  22.  
  23.     # Respect system LDFLAGS
  24.     sed -i "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${LDFLAGS}|" qtbase/mkspecs/common/g++-unix.conf
  25.     #sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS}|g" qtbase/mkspecs/common/gcc-base.conf
  26.  
  27.     # Fix quoting bug
  28.     sed -i 's|"$COMPILER" -c|$COMPILER -c|' qtbase/config.tests/unix/fvisibility.test
  29.  
  30.     export QTDIR="$PWD"
  31.     export LD_LIBRARY_PATH="$QTDIR/qtbase/lib:$QTDIR/qttools/lib:$LD_LIBRARY_PATH"
  32.     export QT_PLUGIN_PATH="$QTDIR/qtbase/plugins"
  33.  
  34.     ./configure \
  35.         -prefix /usr/share/qt5 \
  36.                 -bindir /usr/share/qt5/bin \
  37.                 -headerdir /usr/share/qt5/include \
  38.                 -libdir /usr/share/qt5/lib \
  39.                 -libexecdir /usr/share/qt5/lib \
  40.                 -plugindir /usr/share/qt5/plugins \
  41.                 -sysconfdir /usr/etc/xdg \
  42.                 -openssl-linked -dbus-linked \
  43.                 -no-cups -optimized-qmake \
  44.                 -nomake examples \
  45.  
  46.                 # these are new
  47.                 -skip qtwebengine \# does anything actually need this?
  48.                 -qt-xkbcommon-x11 \ #should fix keyboard problems with some apps
  49.                 -opengl desktop \
  50.                 -no-egl \ # not sure about this one
  51.  
  52.                 -no-separate-debug-info -no-strip -shared -no-rpath \
  53.                 -opensource -confirm-license -release -reduce-relocations
  54.     make
  55.     make INSTALL_ROOT=$PKG install
  56.  
  57.     # Fix paths
  58.     find $PKG/usr/share/qt5/lib  -type f -name '*.prl' \
  59.         -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
  60.  
  61.     sed -e "s|$PWD/qtbase|/usr/share/qt5/lib|g" \
  62.         -i $PKG/usr/share/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
  63.  
  64.     # Remove unnecessary files
  65.     rm -rf $(find $PKG/usr/share/qt5/mkspecs/* | \
  66.         egrep -v '(linux-g++|common|modules|pri|features)')
  67.  
  68.     rm -f $PKG/usr/share/qt5/mkspecs/linux-g++/linux-g++
  69.     rm -rf $PKG/usr/share/qt5/mkspecs/features/{mac,win32}
  70.     rm -rf $PKG/usr/share/qt5/mkspecs/common/mac*
  71.     rm -rf $PKG/usr/share/qt5/{phrasebooks,translations}
  72.  
  73.     # Install linker config
  74.     install -d $PKG/{etc/ld.so.conf.d,usr/{bin,lib,include}}
  75.     echo "/usr/share/qt5/lib" > $PKG/etc/ld.so.conf.d/qt5.conf
  76.  
  77.     ln -s ../share/qt5/include     $PKG/usr/include/qt5
  78.     ln -s ../share/qt5/lib         $PKG/usr/lib/qt5
  79.     ln -s linux-g++                $PKG/usr/share/qt5/mkspecs/default
  80.  
  81.     # Install pkg config
  82.     mv $PKG/usr/share/qt5/lib/pkgconfig $PKG/usr/lib
  83.  
  84.     # Fix paths
  85.     sed \
  86.         -e "s|-L$SRC/qt-everywhere-opensource-src-$version/lib ||g" \
  87.         -e "s|$SRC/qt-everywhere-opensource-src-$version/bin|/usr/share/qt5/bin|g" \
  88.         -i $PKG/usr/lib/pkgconfig/*.pc
  89.  
  90.     # Install useful symlinks
  91.     install -d $PKG/usr/bin
  92.     for b in $PKG/usr/share/qt5/bin/*; do
  93.         ln -s /usr/share/qt5/bin/$(basename $b) $PKG/usr/bin/$(basename $b)-qt5
  94.     done
  95.  
  96.     # cmake
  97.     install -d $PKG/usr/lib/cmake
  98.         for b in $PKG/usr/share/qt5/lib/cmake/*; do
  99.                 ln -s /usr/share/qt5/lib/cmake/$(basename $b) $PKG/usr/lib/cmake/$(basename $b)
  100.         done
  101.  
  102. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top