aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@friendly-machines.com>2024-12-11 18:36:17 +0100
committerDanny Milosavljevic <dannym@friendly-machines.com>2024-12-11 18:39:08 +0100
commitab110cae121c1d8e10625690da856e8e6a9f3e65 (patch)
treec8abce0cbf9bc0b138a4d95d5adde0fdeb3aaefb
parent96f0c5449ac72e484c2911a210751f028024e656 (diff)
downloadguix-ab110cae121c1d8e10625690da856e8e6a9f3e65.tar.gz
guix-ab110cae121c1d8e10625690da856e8e6a9f3e65.zip
gnu: texmacs: Support HiDPI displays on Wayland.
* gnu/packages/patches/texmacs-wayland-hidpi.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/text-editors.scm (texmacs)[source]: Use it. (texmacs-guile3)[source]: Use it. (mogan)[source]: Use it. Change-Id: Ida737433957cb26695bf43538cff4d5d1c8a83c3
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/texmacs-wayland-hidpi.patch22
-rw-r--r--gnu/packages/text-editors.scm12
3 files changed, 32 insertions, 3 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index e149b0e9c4..39b142af5a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2249,6 +2249,7 @@ dist_patch_DATA = \
%D%/packages/patches/teuchos-remove-duplicate-using.patch \
%D%/packages/patches/texi2html-document-encoding.patch \
%D%/packages/patches/texi2html-i18n.patch \
+ %D%/packages/patches/texmacs-wayland-hidpi.patch \
%D%/packages/patches/thefuck-test-environ.patch \
%D%/packages/patches/tidy-CVE-2015-5522+5523.patch \
%D%/packages/patches/timewarrior-time-sensitive-tests.patch \
diff --git a/gnu/packages/patches/texmacs-wayland-hidpi.patch b/gnu/packages/patches/texmacs-wayland-hidpi.patch
new file mode 100644
index 0000000000..decf500125
--- /dev/null
+++ b/gnu/packages/patches/texmacs-wayland-hidpi.patch
@@ -0,0 +1,22 @@
+Author: Danny Milosavljevic <dannym@friendly-machines.com>
+Date: 2024-12-11 18:30:00 CET 2024
+License: gpl3+
+
+diff -ru orig/qsbrdssq407hsajf74z60vp3rhgafjsl-mogan-1.1.1-checkout/src/Texmacs/Texmacs/texmacs.cpp qsbrdssq407hsajf74z60vp3rhgafjsl-mogan-1.1.1-checkout/src/Texmacs/Texmacs/texmacs.cpp
+--- orig/qsbrdssq407hsajf74z60vp3rhgafjsl-mogan-1.1.1-checkout/src/Texmacs/Texmacs/texmacs.cpp 2024-05-10 01:51:55.312256939 +0200
++++ qsbrdssq407hsajf74z60vp3rhgafjsl-mogan-1.1.1-checkout/src/Texmacs/Texmacs/texmacs.cpp 2024-05-10 01:52:43.659909394 +0200
+@@ -685,8 +685,12 @@
+ #ifndef OS_MINGW
+ set_env ("LC_NUMERIC", "POSIX");
+ #ifndef OS_MACOS
+- set_env ("QT_QPA_PLATFORM", "xcb");
+- set_env ("XDG_SESSION_TYPE", "x11");
++ if (get_env ("XDG_SESSION_TYPE") == "wayland") {
++ set_env ("QT_QPA_PLATFORM", "wayland"); QGuiApplication::setAttribute(Qt::AA_DisableHighDpiScaling); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
++ } else {
++ set_env ("QT_QPA_PLATFORM", "xcb");
++ set_env ("XDG_SESSION_TYPE", "x11");
++ }
+ #endif
+ #endif
+ #ifdef MACOSX_EXTENSIONS
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 78c4b825d9..683a588495 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -1083,7 +1083,9 @@ editors.")
(uri (string-append "https://www.texmacs.org/Download/ftp/tmftp/"
"source/TeXmacs-" version "-src.tar.gz"))
(sha256
- (base32 "11l1q5lmsj9g7yil1dn7n1cgsr8iikx59kg9riahpb6xw0p959l7"))))
+ (base32 "11l1q5lmsj9g7yil1dn7n1cgsr8iikx59kg9riahpb6xw0p959l7"))
+ (patches
+ (search-patches "texmacs-wayland-hidpi.patch"))))
(build-system cmake-build-system)
(native-inputs
(list pkg-config xdg-utils)) ;for xdg-icon-resource
@@ -1133,7 +1135,9 @@ Octave. TeXmacs is completely extensible via Guile.")
(url "https://github.com/texmacs/texmacs.git")
(commit "guile3_branch_2.1")))
(sha256
- (base32 "0f7l1sfbii25gawqsg27m31myvixb3xdxnsg5njlrnmp8xh1rs3v"))))
+ (base32 "0f7l1sfbii25gawqsg27m31myvixb3xdxnsg5njlrnmp8xh1rs3v"))
+ (patches
+ (search-patches "texmacs-wayland-hidpi.patch"))))
(inputs
(list freetype
guile-3.0
@@ -1159,7 +1163,9 @@ Octave. TeXmacs is completely extensible via Guile.")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "04wz6xmimjv2l6baxgzm8vyq5grg102m3l4wq8i6bglv529yp4ff"))))
+ (base32 "04wz6xmimjv2l6baxgzm8vyq5grg102m3l4wq8i6bglv529yp4ff"))
+ (patches
+ (search-patches "texmacs-wayland-hidpi.patch"))))
(build-system qt-build-system)
(inputs
(modify-inputs (package-inputs texmacs)