opt/qtwebengine/Pkgfile

96 lines
3.9 KiB
Plaintext
Raw Normal View History

2017-08-06 14:35:32 +02:00
# Description: Provides support for web applications using the Chromium browser project.
2020-06-21 02:37:29 +02:00
# URL: https://www.qt.io/
2016-10-05 14:24:35 +02:00
# Maintainer: Danny Rawlins, crux at romster dot me
2022-06-28 18:30:27 +02:00
# Depends on: ffmpeg libvpx libwebp nodejs nss qt5 xorg-libxscrnsaver xorg-libxtst
# Optional: jsoncpp krb5 libevent libsrtp pipewire pulseaudio snappy
2016-10-05 14:24:35 +02:00
name=qtwebengine
2023-05-17 23:29:35 +02:00
version=5.15.14
release=3
2021-11-14 14:48:37 +01:00
source=(https://anduin.linuxfromscratch.org/BLFS/qtwebengine/$name-$version.tar.xz
2022-05-14 10:30:16 +02:00
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_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
2023-05-08 22:42:42 +02:00
qtwebengine-5.15.13-icu_73-1.patch
qt5-webengine-pipewire-0.3.patch
qtwebengine-5.15.15-c++17.patch
qtwebengine-system-absl-compat.patch
qtwebengine-re2-2023.07.01.patch)
2016-10-05 14:24:35 +02:00
build() {
2021-11-14 14:48:37 +01:00
cd qtwebengine-$version
# https://www.linuxfromscratch.org/blfs/view/svn/x/qtwebengine.html
2022-05-14 10:30:16 +02:00
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_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
2023-05-08 22:42:42 +02:00
patch -p1 -i $SRC/qtwebengine-5.15.13-icu_73-1.patch
2022-05-14 10:30:16 +02:00
patch -p1 -d src/3rdparty -i $SRC/qt5-webengine-pipewire-0.3.patch
2021-11-14 14:48:37 +01:00
if prt-get isinst re2; then
patch -p1 -i $SRC/qtwebengine-re2-2023.07.01.patch
patch -p1 -i $SRC/qtwebengine-system-absl-compat.patch
cp -f /usr/include/absl/base/options.h \
src/3rdparty/chromium/third_party/abseil-cpp/absl/base/options.h
sed -i -e 's,#define ABSL_OPTION_USE_STD_OPTIONAL 1,#define ABSL_OPTION_USE_STD_OPTIONAL 0,' src/3rdparty/chromium/third_party/abseil-cpp/absl/base/options.h
patch -p1 -i $SRC/qtwebengine-5.15.15-c++17.patch
export CXXFLAGS+=' -std=gnu++17'
find . -name "*.pro" -o -name "*.pri" |while read r; do
echo 'QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++17' >>$r
done
fi
2021-11-14 14:48:37 +01:00
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
2016-10-05 14:24:35 +02:00
2017-08-06 14:35:32 +02:00
# Ninja, by default, sets the number of jobs to the number of availalble threads
2022-05-14 10:30:16 +02:00
test -n "$JOBS" && export NINJAFLAGS+=" -j ${JOBS-1}"
2017-08-06 14:35:32 +02:00
prt-get isinst clang && export CC=clang CXX=clang++ QMAKE_XSPEC=linux-clang
2022-09-25 20:05:55 +02:00
prt-get isinst lld && export AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib LDFLAGS+=' -fuse-ld=lld'
2019-07-14 16:26:39 +02:00
prt-get isinst ccache && export \
2022-06-28 18:30:27 +02:00
QMAKE_CC="ccache ${CC:-gcc}" \
QMAKE_LINK_C="ccache ${CC:-gcc}" \
QMAKE_LINK_C_SHLIB="ccache ${CC:-gcc}" \
QMAKE_CXX="ccache ${CXX:-g++}" \
QMAKE_LINK="ccache ${CXX:-g++}" \
QMAKE_LINK_SHLIB="ccache ${CXX:-g++}" \
QMAKESPEC=/usr/lib/qt5/mkspecs/${QMAKE_XSPEC:-linux-g++}
2019-09-22 03:41:33 +02:00
PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
sed -i -e 's|"-Wno-unknown-attributes",|"-Wno-enum-constexpr-conversion",\n &|' \
src/3rdparty/chromium/build/config/compiler/BUILD.gn
2019-07-14 16:26:39 +02:00
2016-10-05 14:24:35 +02:00
install -d build
cd build
2021-11-14 14:48:37 +01:00
prt-get isinst pulseaudio && PKGMK_QTWEBENGINE+=' -pulseaudio' || PKGMK_QTWEBENGINE+=' -no-pulseaudio'
2022-05-14 10:30:16 +02:00
prt-get isinst pipewire && PKGMK_QTWEBENGINE+=' -webengine-webrtc-pipewire'
2022-06-28 18:30:27 +02:00
prt-get isinst icu && PKGMK_QTWEBENGINE+=' -webengine-icu' || PKGMK_QTWEBENGINE+=' -no-webengine-icu'
2021-11-14 14:48:37 +01:00
qmake-qt5 .. -- \
$PKGMK_QTWEBENGINE \
-proprietary-codecs \
2022-05-14 10:30:16 +02:00
-system-ffmpeg \
-system-opus \
-system-webp \
-no-feature-webengine-embedded-build
2016-10-05 14:24:35 +02:00
make
make INSTALL_ROOT=$PKG install
find "$PKG/usr/lib" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
}