opt/qtwebengine/Pkgfile

74 lines
2.8 KiB
Plaintext

# Description: Provides support for web applications using the Chromium browser project.
# URL: https://www.qt.io/
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: ffmpeg libvpx libwebp nodejs nss opus python qt5 xorg-libxscrnsaver xorg-libxtst
name=qtwebengine
version=5.15.9
release=1
source=(https://anduin.linuxfromscratch.org/BLFS/qtwebengine/$name-$version.tar.xz
https://www.linuxfromscratch.org/patches/blfs/svn/qtwebengine-$version-build_fixes-1.patch
qtwebengine-5.15.2-disable-fatal-warnings.patch
qtwebengine-5.15.2-extra_gn.patch
qtwebengine-5.15.2_p20210224-chromium-87-v8-icu68.patch
qtwebengine-5.15.2_p20210521-clang-libc++.patch
qtwebengine-5.15.2_p20211015-pdfium-system-lcms2.patch
qtwebengine-5.15.3_p20220406-ffmpeg5.patch
qt5-webengine-pipewire-0.3.patch
gcc12.patch)
build() {
cd qtwebengine-$version
# https://www.linuxfromscratch.org/blfs/view/svn/x/qtwebengine.html
patch -p1 -i $SRC/qtwebengine-$version-build_fixes-1.patch
patch -p1 -i $SRC/qtwebengine-5.15.2-disable-fatal-warnings.patch
patch -p1 -i $SRC/qtwebengine-5.15.2-extra_gn.patch
patch -p1 -i $SRC/qtwebengine-5.15.2_p20210224-chromium-87-v8-icu68.patch
patch -p1 -i $SRC/qtwebengine-5.15.2_p20210521-clang-libc++.patch
patch -p1 -i $SRC/qtwebengine-5.15.2_p20211015-pdfium-system-lcms2.patch
patch -p1 -i $SRC/qtwebengine-5.15.3_p20220406-ffmpeg5.patch
patch -p1 -d src/3rdparty -i $SRC/qt5-webengine-pipewire-0.3.patch
patch -p0 -d src/3rdparty/chromium/third_party/skia/src/utils/ -i $SRC/gcc12.patch
mkdir -pv .git src/3rdparty/chromium/.git
sed -e '/^MODULE_VERSION/s/5.*/5.15.2/' -i .qmake.conf
find -type f -name "*.pr[io]" | \
xargs sed -i -e 's|INCLUDEPATH += |&$$QTWEBENGINE_ROOT/include |'
prt-get isinst pulseaudio && sed -e '/link_pulseaudio/s/false/true/' \
-i src/3rdparty/chromium/media/media_options.gni
# Ninja, by default, sets the number of jobs to the number of availalble threads
test -n "$JOBS" && export NINJAFLAGS+=" -j ${JOBS-1}"
prt-get isinst ccache && export \
QMAKE_CC='ccache gcc' \
QMAKE_LINK_C='ccache gcc' \
QMAKE_LINK_C_SHLIB='ccache gcc' \
QMAKE_CXX='ccache g++' \
QMAKE_LINK='ccache g++' \
QMAKE_LINK_SHLIB='ccache g++' \
PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
install -d build
cd build
prt-get isinst pulseaudio && PKGMK_QTWEBENGINE+=' -pulseaudio' || PKGMK_QTWEBENGINE+=' -no-pulseaudio'
prt-get isinst pipewire && PKGMK_QTWEBENGINE+=' -webengine-webrtc-pipewire'
prt-get isinst icu && PKGMK_QTWEBENGINE+=' -webengine-icu' || PKGMK_QTWEBENGINE+=' -no-webengine-icu'
qmake-qt5 .. -- \
$PKGMK_QTWEBENGINE \
-proprietary-codecs \
-system-ffmpeg \
-system-opus \
-system-webp
make
make INSTALL_ROOT=$PKG install
find "$PKG/usr/lib" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
}