From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Leo Prikler <leo.prikler@student.tugraz.at>
Cc: 41174-done@debbugs.gnu.org
Subject: bug#41174: [PATCH] gnu: webkitgtk: Add patch to share all fonts.
Date: Sun, 16 Aug 2020 16:19:53 -0400 [thread overview]
Message-ID: <87a6yuxs0m.fsf@gmail.com> (raw)
In-Reply-To: <20200526181345.32726-1-leo.prikler@student.tugraz.at> (Leo Prikler's message of "Tue, 26 May 2020 20:13:46 +0200")
[-- Attachment #1: Type: text/plain, Size: 4740 bytes --]
Hi Leo,
Leo Prikler <leo.prikler@student.tugraz.at> writes:
> * gnu/packages/patches/webkitgtk-bind-all-fonts.patch: New file.
> * gnu/packages/webkit.scm (webkitgtk)[source]<patches>: Use it here.
> * gnu/local.mk: Add it here.
I've expounded a bit the commit message,
> ---
> gnu/local.mk | 1 +
> .../patches/webkitgtk-bind-all-fonts.patch | 37 +++++++++++++++++++
> gnu/packages/webkit.scm | 3 +-
> 3 files changed, 40 insertions(+), 1 deletion(-)
> create mode 100644 gnu/packages/patches/webkitgtk-bind-all-fonts.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index d34e7e6ae5..7a694e551a 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1580,6 +1580,7 @@ dist_patch_DATA = \
> %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch \
> %D%/packages/patches/weasyprint-library-paths.patch \
> %D%/packages/patches/webkitgtk-share-store.patch \
> + %D%/packages/patches/webkitgtk-bind-all-fonts.patch \
> %D%/packages/patches/websocketpp-fix-for-boost-1.70.patch \
> %D%/packages/patches/wicd-bitrate-none-fix.patch \
> %D%/packages/patches/wicd-get-selected-profile-fix.patch \
> diff --git a/gnu/packages/patches/webkitgtk-bind-all-fonts.patch b/gnu/packages/patches/webkitgtk-bind-all-fonts.patch
> new file mode 100644
> index 0000000000..fec0b812f1
> --- /dev/null
> +++ b/gnu/packages/patches/webkitgtk-bind-all-fonts.patch
> @@ -0,0 +1,37 @@
> +Add fonts from all XDG_DATA_DIRS, not just XDG_DATA_HOME.
> +
> +See <http://bugs.gnu.org/41174>.
> +Author: Leo Prikler <leo.prikler@student.tugraz.at>
> +Index: webkitgtk-2.28.2/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
> +===================================================================
> +--- webkitgtk-2.28.2.orig/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
> ++++ webkitgtk-2.28.2/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
> +@@ -385,8 +385,8 @@ static void bindFonts(Vector<CString>& a
> + {
> + const char* configDir = g_get_user_config_dir();
> + const char* homeDir = g_get_home_dir();
> +- const char* dataDir = g_get_user_data_dir();
> + const char* cacheDir = g_get_user_cache_dir();
> ++ const char* const * dataDirs = g_get_system_data_dirs();
> +
> + // Configs can include custom dirs but then we have to parse them...
> + GUniquePtr<char> fontConfig(g_build_filename(configDir, "fontconfig", nullptr));
> +@@ -394,15 +394,17 @@ static void bindFonts(Vector<CString>& a
> + GUniquePtr<char> fontCache(g_build_filename(cacheDir, "fontconfig", nullptr));
> + GUniquePtr<char> fontHomeConfig(g_build_filename(homeDir, ".fonts.conf", nullptr));
> + GUniquePtr<char> fontHomeConfigDir(g_build_filename(configDir, ".fonts.conf.d", nullptr));
> +- GUniquePtr<char> fontData(g_build_filename(dataDir, "fonts", nullptr));
> + GUniquePtr<char> fontHomeData(g_build_filename(homeDir, ".fonts", nullptr));
> + bindIfExists(args, fontConfig.get());
> + bindIfExists(args, fontConfigHome.get());
> + bindIfExists(args, fontCache.get(), BindFlags::ReadWrite);
> + bindIfExists(args, fontHomeConfig.get());
> + bindIfExists(args, fontHomeConfigDir.get());
> +- bindIfExists(args, fontData.get());
removed the above deleted lines from your patch, so as to continue
honoring XDG_DATA_HOME,
> + bindIfExists(args, fontHomeData.get());
> ++ for (auto dataDir = dataDirs; dataDir != nullptr && *dataDir != nullptr; dataDir++) {
> ++ GUniquePtr<char> fontDataDir(g_build_filename(*dataDir, "fonts", nullptr));
> ++ bindIfExists(args, fontDataDir.get());
> ++ }
> + bindIfExists(args, "/var/cache/fontconfig"); // Used by Debian.
> + }
> diff --git a/gnu/packages/webkit.scm b/gnu/packages/webkit.scm
> index 90be7d2625..a5c2b3fee2 100644
> --- a/gnu/packages/webkit.scm
> +++ b/gnu/packages/webkit.scm
> @@ -129,7 +129,8 @@ engine that uses Wayland for graphics output.")
> (sha256
> (base32
> "1g9hik3bprki5s9d7y5288q5irwckbzajr6rnlvjrlnqrwjkblmr"))
> - (patches (search-patches "webkitgtk-share-store.patch"))))
> + (patches (search-patches "webkitgtk-share-store.patch"
> + "webkitgtk-bind-all-fonts.patch"))))
> (build-system cmake-build-system)
> (outputs '("out" "doc"))
> (arguments
And validated it worked well with a './pre-inst-env guix system vm
epiphany-ratpoison.scm' generated VM (it exhibited the problem after
all, when used in a VM).
For completeness sake, the test VM operating system is attached. It's
not necessary to include bubblewrap to trigger the font problem.
[-- Attachment #2: epiphany-ratpoison.scm --]
[-- Type: text/plain, Size: 2567 bytes --]
;;; Try reproducing the font problem in Epiphany.
;;; Run VM with: /gnu/store/w0m677q3d94rpvyaas74qahdvs8zfrcq-run-vm.sh
(use-modules (gnu) (gnu system nss))
(use-service-modules desktop ssh)
(use-package-modules bootloaders certs ratpoison suckless wm xorg)
(define %extra-packages (map specification->package
'("font-adobe-source-han-sans"
"epiphany"
; "bubblewrap"
"strace"
"fontconfig"
"zile")))
(operating-system
(host-name "antelope")
(timezone "Europe/Paris")
(locale "en_US.utf8")
;; Use the UEFI variant of GRUB with the EFI System
;; Partition mounted on /boot/efi.
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(target "/boot/efi")))
;; Assume the target root file system is labelled "my-root",
;; and the EFI System Partition has UUID 1234-ABCD.
(file-systems (append
(list (file-system
(device (file-system-label "my-root"))
(mount-point "/")
(type "ext4"))
(file-system
(device (uuid "1234-ABCD" 'fat))
(mount-point "/boot/efi")
(type "vfat")))
%base-file-systems))
(users (cons (user-account
(name "alice")
(comment "Bob's sister")
(group "users")
(supplementary-groups '("wheel" "netdev"
"audio" "video")))
%base-user-accounts))
;; Add a bunch of window managers; we can choose one at
;; the log-in screen with F1.
(packages (append (list ratpoison
;; terminal emulator
xterm
;; for HTTPS access
nss-certs)
%extra-packages
%base-packages))
;; Use the "desktop" services, which include the X11
;; log-in service, networking with NetworkManager, and more.
(services (cons*
(service openssh-service-type
(openssh-configuration
(x11-forwarding? #t)
(permit-root-login 'without-password)))
%desktop-services))
;; Allow resolution of '.local' host names with mDNS.
(name-service-switch %mdns-host-lookup-nss))
[-- Attachment #3: Type: text/plain, Size: 123 bytes --]
The fix is now merged in master as of commit bc549a276c.
Thanks for investigating and fixing the issue!
Closing,
Maxim
prev parent reply other threads:[~2020-08-16 20:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-10 13:02 bug#41174: Epiphany can't find fonts Leo Prikler
[not found] ` <handler.41174.B.158911578424933.ack@debbugs.gnu.org>
2020-05-18 0:27 ` Leo Prikler
2020-05-26 18:13 ` bug#41174: [PATCH] gnu: webkitgtk: Add patch to share all fonts Leo Prikler
2020-05-26 19:47 ` Jack Hill
2020-05-26 21:56 ` Leo Prikler
2020-05-27 1:18 ` Jack Hill
2020-08-16 20:19 ` Maxim Cournoyer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6yuxs0m.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=41174-done@debbugs.gnu.org \
--cc=leo.prikler@student.tugraz.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).