void-packages/srcpkgs/qt-webkit/template

114 lines
3.9 KiB
Bash

# Template file for 'qt-webkit'
pkgname=qt-webkit
version=2.3.4
revision=7
_qtver=4.8.7
wrksrc="qtwebkit-${version}"
create_wrksrc=yes
hostmakedepends="automake libtool bison flex gperf python ruby pkg-config qt-qmake"
makedepends="MesaLib-devel libjpeg-turbo-devel qt-devel qt-designer-devel
glib-devel fontconfig-devel gst-plugins-base1-devel sqlite-devel libXrender-devel"
short_desc="Open source web browser engine (Qt4 port)"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="LGPL-2.1, GPL-3"
homepage="http://trac.webkit.org/wiki/QtWebKit"
distfiles="
http://download.kde.org/stable/qtwebkit-${version%.*}/${version}/src/qtwebkit-${version}.tar.gz
http://download.qt.io/official_releases/qt/${_qtver%.*}/${_qtver}/qt-everywhere-opensource-src-${_qtver}.tar.gz"
checksum="
c6cfa9d068f7eb024fee3f6c24f5b8b726997f669007587f35ed4a97d40097ca
e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0"
conflicts="qt<4.8.7_12"
if [ -n "$CROSS_BUILD" ]; then
hostmakedepends+=" qt-devel qt-designer-devel"
fi
# Use the same value for -std= as in qt
CXXFLAGS="-std=gnu++98 -Wno-deprecated -fno-delete-null-pointer-checks -fno-lifetime-dse"
post_extract() {
patch -p1 < ${FILESDIR}/fix-gcc6.patch
patch -p1 < ${FILESDIR}/fix-execinfo.patch
patch -p1 < ${FILESDIR}/fix-mallinfo.patch
patch -p0 < ${FILESDIR}/qwebview.patch
mv qt-everywhere-opensource-src-${_qtver} ..
}
do_configure() {
:
}
do_build() {
local opts="--qt --prefix=/usr --no-webkit2 --release"
case "$XBPS_TARGET_MACHINE" in
i686*) # Do not force SSE2 for i686
opts+=" --no-force-sse2"
;;
aarch64*)
# Disable JIT
opts+=" DEFINES+=ENABLE_JIT=0"
opts+=" DEFINES+=ENABLE_YARR_JIT=0"
;;
arm*|mips*|ppc*)
# Disable JIT and assembler
opts+=" DEFINES+=ENABLE_JIT=0"
opts+=" DEFINES+=ENABLE_YARR_JIT=0"
opts+=" DEFINES+=ENABLE_ASSEMBLER=0"
;;
esac
if [ -n "$CROSS_BUILD" ]; then
opts+=" --qmakearg=\"CONFIG+=production_build\""
opts+=" --qmakearg=\"QMAKE_CC=$CC\""
opts+=" --qmakearg=\"QMAKE_CXX=$CXX\""
opts+=" --qmakearg=\"QMAKE_LINK=$CXX\""
opts+=" --qmakearg=\"QMAKE_LINK_SHARED=$CXX\""
opts+=" --qmakearg=\"QMAKE_AR=$AR cru\""
opts+=" --qmakearg=\"QMAKE_OBJDUMP=$OBJDUMP\""
opts+=" --qmakearg=\"QMAKE_CFLAGS='$CFLAGS'\""
opts+=" --qmakearg=\"QMAKE_CFLAGS_RELEASE='$CFLAGS'\""
opts+=" --qmakearg=\"QMAKE_CXXFLAGS='$CXXFLAGS'\""
opts+=" --qmakearg=\"QMAKE_CXXFLAGS_RELEASE='$CXXFLAGS'\""
opts+=" --qmakearg=\"QMAKE_LFLAGS='$LDFLAGS'\""
opts+=" --qmakearg=\"QMAKE_LFLAGS_RELEASE='$LDFLAGS'\""
opts+=" --qmakearg=\"QMAKE_INCDIR=${XBPS_CROSS_BASE}/usr/include\""
opts+=" --qmakearg=\"QMAKE_INCDIR_QT=${XBPS_CROSS_BASE}/usr/include\""
fi
export QTDIR=/usr
export PATH="/usr/lib/qt/bin:$PATH"
find -name "Makefile*" -exec sed -i "{}" \
-e"s;^\(CC[ ]*=\).*;\1 $CC;" \
-e"s;^\(CXX[ ]*=\).*;\1 $CXX;" \
-e"s;^\(LINK[ ]*=\).*;\1 $CXX;" \
-e"s;^\(CFLAGS[ ]*=\)\(.*\);\1 \2 $CFLAGS;" \
-e"s;^\(CXXFLAGS[ ]*=\)\(.*\);\1 \2 $CXXFLAGS;" \
-e"s;^\(LFLAGS[ ]*=\)\(.*\);\1 \2 $LDFLAGS;" \
\;
Tools/Scripts/build-webkit --makeargs="${makejobs}" ${opts}
cd ../qt-everywhere-opensource-src-${_qtver}/tools/designer/src/plugins/qwebview
qmake QMAKE_CFLAGS="$CFLAGS" QMAKE_CXXFLAGS="$CXXFLAGS" QMAKE_LFLAGS="$LDFLAGS"
make ${makejobs} CC="$CC" CXX="$CXX" LINK="$CXX"
}
do_install() {
make INSTALL_ROOT="${DESTDIR}" -C WebKitBuild/Release install
cd ../qt-everywhere-opensource-src-${_qtver}/tools/designer/src/plugins/qwebview
make INSTALL_ROOT="${DESTDIR}" install
# Remove references to the build directory from .prl and .pc files
sed -i 's| -L.*/*/release||g' ${DESTDIR}/usr/lib/pkgconfig/QtWebKit.pc
sed -i '/^QMAKE_PRL_BUILD_DIR/d' ${DESTDIR}/usr/lib/libQtWebKit.prl
}
qt-webkit-devel_package() {
short_desc+=" - development files"
depends="qt-devel ${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove usr/lib/*.so
vmove usr/lib/*.prl
vmove usr/lib/pkgconfig
vmove usr/share/qt/mkspecs
}
}