I built the latest update in a current chroot ($ makechrootpkg -c -r $CHROOT
).
https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot
Note:
-
(actually, I think I may have needed to to add
glib2-devel
in themakedepends()
originally formakechrootpkg
, but below steps are from after the initialmakechrootpkg
) -
I found out I actually need
webkitgtk2
, so I guess I'm going to do that one now.
I received the same error as @semcore (from parser.rb
) and saw:
https://github.com/WebKit/WebKit/commit/c7d19a492d97f9282a546831beb918e03315f6ef
I applied the changes.
Next error:
/usr/include/unicode/localpointer.h:561:26: error: parameter declared 'auto'
561 | template <typename Type, auto closeFunction>
| ^~~~
They talk about this here (not for the same file/line, but the same issue):
https://bugs.webkit.org/show_bug.cgi?id=171010
and they link to a patch for that file/line, this was only meant to be a temporary workaround though.
They intended to switch from c++11
to c++14
and use auto
.
I figured it would be easier to use c++14
rather than find and patch all of the affected auto
s.
An -std
in the WTF make flags would be overshadowed by global flags, so I went ahead and set std=c++14
for the entire build.
Next error: (call of overloaded ... is ambiguous)
The WTF team was providing implementations for functions provided by c++14
in preparation for the std change, so I commented out the function.
In their stdlibextras.h
, I needed to comment out 2 other functions.
Next error: (auto
is not permitted in this context)
It looks like this is supported in c++17
, so I changed -std
to c++17
.
Also to reduce prints: -Wno
for implicit fallthrough, a c++20
warning, and deprecated warnings.
I removed the D_FORTIFY_SOURCE
, as this is added to FLAGS
during configure
by default and was causing "already set" message spam.
Next error: DerivedSources/webkit/webkitmarshal.cpp
.
This file has extern "C" {
on the first line, and includes a header which a series of other includes led to:
/usr/include/c++/14.2.1/type_traits:69:3: error: template with C linkage
69 | template<typename _Tp>
webkitmarshal.cpp
is created in ./webkitgtk-2.4.11/Source/WebKit/gtk/GNUmakefile.am
.
I removed the echo which puts extern "C" {
at the top, and added an inplace sed to put extern "C" {
on the 3rd line below the include statement.
Next error is what @bartus posted, xml pointers changed const
-ness:
https://bugs.webkit.org/show_bug.cgi?id=265128
I added const
to the type.
Next error:
DerivedSources/WebCore/CSSGrammar.cpp:160:10: fatal error: CSSGrammar.hpp: No such file or directory
160 | #include "CSSGrammar.hpp"
I found this commit which addressed an issue relating to Bison 3.7+: https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31 I applied the changes.
Patches:
-
rubyasm.patch, fix
=~
token error http://0x0.st/XJtj.patch -
wtfstd17.patch, commented functions now conflicting with
std=c++17
http://0x0.st/XJte.patch -
compilerflags.patch, change to
std=c++17
, remove extraFORTIFY_SOURCE
, add several-Wno
flags http://0x0.st/XJt2.patch -
webkitextern.patch, fix placement of
extern "C" {
below#include
http://0x0.st/XJt_.patch -
xmlconst.patch, make
xmlError
pointersconst
for libxml2:2.12+ http://0x0.st/XJtL.patch -
bison3.7.patch, change header usage in
DerivedSources
for Bison3.7+ http://0x0.st/XJt9.7.patch
PKGBUILD diff: http://0x0.st/XJtp.diff
Pinned Comments
frealgagu commented on 2019-04-14 18:13 (UTC) (edited on 2020-12-06 03:31 (UTC) by frealgagu)
FAQ
Q: What's the difference between this package and extra/webkit2gtk?
A: webkitgtk/webkitgtk2 provides WebKit1 API/ABI, which is not compatible with WebKit2 API/ABI provided by extra/webkit2gtk. WebKitGTK+ 2.4.x is the latest branch that provides WebKit1 API. Later branches provides WebKit2 API only.
Please don't flag it as out-of-date.
Q: Are there binaries for this package somewhere?
A: I maintain the latest built package at https://github.com/frealgagu/archlinux.webkitgtk/releases
Q: "error while loading shared libraries: libicui18n.so.62: cannot open shared object file: No such file or directory"
A: You'll need to rebuild against the latest version of ICU.
Q: "error: ‘WTF::StringImpl::StaticASCIILiteraicASCIILiteral’ has not been declared" or any enchant errors.
A: If you are building in parallel, try disabling parallel using -j1 in /etc/makepkg.conf
Q: Why building takes too long time?
A: WebKit is inherently big and complex. You can modify /etc/makepkg.conf or PKGBUILD directly to build it in parallel.
Change "make all stamp-po" by "make -j x all stamp-po" in PKGBUILD replacing x by cores your machine has. (Thanks to @MadMe)
Change /etc/makepkg.conf in that way: https://wiki.archlinux.org/index.php/makepkg#Parallel_compilation under
# ARCHITECTURE, COMPILE FLAGS
useMAKEFLAGS="-j9"
# It should be one more than your virtual CPUs. (Thanks to @tuxsavvy).However be pending if errors occur as mentioned in previous question.
Q: How much I want to wait to a successful compilation?
A: It varies of your PC's processor and RAM, the times shared in the comments are as follow:
3.5 hours to build on core i5 laptop with 8G of RAM, makeflags j4. (@cabbage)
13.5 hours to build on AMD Athlon X2, makeflags j1 (@Bonnietwin).
5-6 hours on Core2Duo E8400 with 8GB RAM, makeflags j2 (tuxsavvy).
50 minutes on 6c/12t 3.3GHz (@kubrick).