summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorNigko Yerden <nigko.yerden@gmail.com>2026-06-03 12:02:39 +0500
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2026-07-15 09:44:28 +0200
commit5f744e5414aa2753e42ffc295013bf5e4eded739 (patch)
tree3113a8b2768b0ee359a7e38ef1c172e3bc1cda88 /gnu
parent30b98bb2bbb4c910597d7df881d20a009b336c55 (diff)
gnu: texmacs: Fix wrong initialization of plugins that use python.
Fix upstream bug https://savannah.gnu.org/bugs/?68269 (see also https://codeberg.org/guix/guix/pulls/7368#issuecomment-13563062) by undoing https://github.com/texmacs/texmacs/commit/8b096c3a44d8bc74b4f80f8af36173ddc446e8c3 and adding checks on value returned by `python-command` to every plugin using this procedure. * gnu/packages/text-editotrs.scm (texmacs)[source]{origin}<patches>: New field bringing in new patch. * gnu/packages/patches/texmacs-fix-plugins-wrong-init.patch: New patch. * gnu/local.mk: New patch register record. Merges: #9050 Change-Id: Ieda1d9487b9992563aebf475e21835eaab284e53 Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/texmacs-fix-plugins-wrong-init.patch184
-rw-r--r--gnu/packages/text-editors.scm5
3 files changed, 189 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index a71dc5b68c1..94ae3d9608d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2555,6 +2555,7 @@ dist_patch_DATA = \
2555 %D%/packages/patches/tinyxml-CVE-2023-34194.patch \ 2555 %D%/packages/patches/tinyxml-CVE-2023-34194.patch \
2556 %D%/packages/patches/tinyxml-use-stl.patch \ 2556 %D%/packages/patches/tinyxml-use-stl.patch \
2557 %D%/packages/patches/tk-find-library.patch \ 2557 %D%/packages/patches/tk-find-library.patch \
2558 %D%/packages/patches/texmacs-fix-plugins-wrong-init.patch \
2558 %D%/packages/patches/tla2tools-build-xml.patch \ 2559 %D%/packages/patches/tla2tools-build-xml.patch \
2559 %D%/packages/patches/tlf-support-hamlib-4.2+.patch \ 2560 %D%/packages/patches/tlf-support-hamlib-4.2+.patch \
2560 %D%/packages/patches/tofi-32bit-compat.patch \ 2561 %D%/packages/patches/tofi-32bit-compat.patch \
diff --git a/gnu/packages/patches/texmacs-fix-plugins-wrong-init.patch b/gnu/packages/patches/texmacs-fix-plugins-wrong-init.patch
new file mode 100644
index 00000000000..408c92b3f87
--- /dev/null
+++ b/gnu/packages/patches/texmacs-fix-plugins-wrong-init.patch
@@ -0,0 +1,184 @@
1Index: TeXmacs/progs/kernel/library/base.scm
2===================================================================
3--- TeXmacs/progs/kernel/library/base.scm (revision 15487)
4+++ TeXmacs/progs/kernel/library/base.scm (working copy)
5@@ -325,7 +325,7 @@
6 (url->unix u))
7
8 (define-public (first-in-path . l)
9- (cond ((null? l) "")
10+ (cond ((null? l) #f)
11 ((url-exists-in-path? (car l)) (car l))
12 (else (apply first-in-path (cdr l)))))
13
14Index: plugins/asymptote/progs/init-asymptote.scm
15===================================================================
16--- plugins/asymptote/progs/init-asymptote.scm (revision 15487)
17+++ plugins/asymptote/progs/init-asymptote.scm (working copy)
18@@ -29,7 +29,7 @@
19 (:winpath "Asymptote" ".")
20 (:require (url-exists-in-path? "asy"))
21 (:require (python-command))
22- (:launch ,(asy-launcher))
23+ (:launch ,(and (python-command) (asy-launcher)))
24 (:serializer ,asy-serialize)
25 (:session "Asymptote")
26 (:scripts "Asymptote"))
27Index: plugins/dratex/progs/init-dratex.scm
28===================================================================
29--- plugins/dratex/progs/init-dratex.scm (revision 15487)
30+++ plugins/dratex/progs/init-dratex.scm (working copy)
31@@ -29,6 +29,6 @@
32 (plugin-configure dratex
33 (:require (python-command))
34 (:require (url-exists-in-path? "latex"))
35- (:launch ,(dratex-launcher))
36+ (:launch ,(and (python-command) (dratex-launcher)))
37 (:serializer ,dratex-serialize)
38 (:session "DraTex"))
39Index: plugins/eukleides/progs/init-eukleides.scm
40===================================================================
41--- plugins/eukleides/progs/init-eukleides.scm (revision 15487)
42+++ plugins/eukleides/progs/init-eukleides.scm (working copy)
43@@ -26,7 +26,7 @@
44
45 (plugin-configure eukleides
46 (:require (url-exists-in-path? "eukleides"))
47- ,@(eukleides-launcher)
48+ ,@(if (python-command) (eukleides-launcher) '())
49 (:serializer ,eukleides-serialize)
50 (:session "Eukleides")
51 (:scripts "Eukleides"))
52Index: plugins/gnuplot/progs/init-gnuplot.scm
53===================================================================
54--- plugins/gnuplot/progs/init-gnuplot.scm (revision 15487)
55+++ plugins/gnuplot/progs/init-gnuplot.scm (working copy)
56@@ -31,8 +31,8 @@
57 (:winpath "gnuplot" "bin") ;; the first winpath has the highest priority
58 (:winpath "GNU Octave/Octave*/mingw64" "bin")
59 (:require (url-exists-in-path? "gnuplot"))
60- (:require (url-exists-in-path? (python-command)))
61- ,@(gnuplot-launcher)
62+ (:require (and (python-command) (url-exists-in-path? (python-command))))
63+ ,@(if (python-command) (gnuplot-launcher) '())
64 (:serializer ,gnuplot-serialize)
65 (:session "Gnuplot")
66 (:scripts "Gnuplot"))
67Index: plugins/graph/progs/init-graph.scm
68===================================================================
69--- plugins/graph/progs/init-graph.scm (revision 15487)
70+++ plugins/graph/progs/init-graph.scm (working copy)
71@@ -26,6 +26,6 @@
72
73 (plugin-configure graph
74 (:require (python-command))
75- (:launch ,(graph-launcher))
76+ (:launch ,(and (python-command) (graph-launcher)))
77 (:serializer ,graph-serialize)
78 (:session "Graph"))
79Index: plugins/graphviz/progs/init-graphviz.scm
80===================================================================
81--- plugins/graphviz/progs/init-graphviz.scm (revision 15487)
82+++ plugins/graphviz/progs/init-graphviz.scm (working copy)
83@@ -31,6 +31,6 @@
84 (:winpath "Graphviz" "bin")
85 (:require (url-exists-in-path? "dot"))
86 (:require (python-command))
87- (:launch ,(graphviz-launcher))
88+ (:launch ,(and (python-command) (graphviz-launcher)))
89 (:serializer ,graphviz-serialize)
90 (:session "Graphviz"))
91Index: plugins/jupyter/progs/init-jupyter.scm
92===================================================================
93--- plugins/jupyter/progs/init-jupyter.scm (revision 15487)
94+++ plugins/jupyter/progs/init-jupyter.scm (working copy)
95@@ -18,8 +18,9 @@
96 ;; Communication with Jupyter
97 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
98
99+
100 (tm-define (check-jupyter?)
101- (and (url-exists-in-path? (python-command))
102+ (and (python-command) (url-exists-in-path? (python-command))
103 (with cmd (string-append (python-command)
104 " -m pip show jupyter_client 2> /dev/null")
105 (> (string-length (var-eval-system cmd)) 10))))
106@@ -27,6 +28,8 @@
107 (plugin-configure jupyter ;; defines supports-jupyter?
108 (:require (check-jupyter?)))
109
110+(when (python-command)
111+
112 (define (jupyter-find-kernels)
113 (let* ((u "$TEXMACS_PATH/plugins/jupyter/tm_jupyter/kernels.py")
114 (cmd (string-append (python-command) " " (system-url->string u)))
115@@ -129,3 +132,5 @@
116
117 (when (supports-jupyter?)
118 (import-from (jupyter-kernels)))
119+
120+)
121Index: plugins/plantuml/progs/init-plantuml.scm
122===================================================================
123--- plugins/plantuml/progs/init-plantuml.scm (revision 15487)
124+++ plugins/plantuml/progs/init-plantuml.scm (working copy)
125@@ -30,7 +30,7 @@
126 (plugin-configure plantuml
127 (:require (url-exists-in-path? "plantuml"))
128 (:require (python-command))
129- (:launch ,(plantuml-launcher))
130+ (:launch ,(and (python-command) (plantuml-launcher)))
131 (:serializer ,plantuml-serialize)
132 (:session "PlantUML"))
133
134Index: plugins/python/progs/init-python.scm
135===================================================================
136--- plugins/python/progs/init-python.scm (revision 15487)
137+++ plugins/python/progs/init-python.scm (working copy)
138@@ -54,7 +54,7 @@
139 (:winpath "Python*" ".")
140 (:winpath "Python/Python*" ".")
141 (:require (python-command))
142- (:launch ,(python-launcher))
143+ (:launch ,(and (python-command) (python-launcher)))
144 (:preferences (supports-jupyter?))
145 (:tab-completion #t)
146 (:serializer ,python-serialize)
147Index: plugins/sympy/progs/init-sympy.scm
148===================================================================
149--- plugins/sympy/progs/init-sympy.scm (revision 15487)
150+++ plugins/sympy/progs/init-sympy.scm (working copy)
151@@ -27,7 +27,7 @@
152
153 (plugin-configure sympy
154 (:require (python-command))
155- (:launch ,(sympy-launcher))
156+ (:launch ,(and (python-command) (sympy-launcher)))
157 (:serializer ,sympy-serialize)
158 (:tab-completion #t)
159 (:session "SymPy"))
160Index: plugins/tikz/progs/init-tikz.scm
161===================================================================
162--- plugins/tikz/progs/init-tikz.scm (revision 15487)
163+++ plugins/tikz/progs/init-tikz.scm (working copy)
164@@ -28,7 +28,7 @@
165 (plugin-configure tikz
166 (:require (python-command))
167 (:require (url-exists-in-path? "latex"))
168- (:launch ,(tikz-launcher))
169+ (:launch ,(and (python-command) (tikz-launcher)))
170 (:serializer ,tikz-serialize)
171 (:session "TikZ"))
172
173Index: plugins/xypic/progs/init-xypic.scm
174===================================================================
175--- plugins/xypic/progs/init-xypic.scm (revision 15487)
176+++ plugins/xypic/progs/init-xypic.scm (working copy)
177@@ -34,6 +34,6 @@
178 (plugin-configure xypic
179 (:require (python-command))
180 (:require (xypic-exists?))
181- (:launch ,(xypic-launcher))
182+ (:launch ,(and (python-command) (xypic-launcher)))
183 (:serializer ,xypic-serialize)
184 (:session "XYpic"))
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index b0dec741860..5d3059d767b 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -1388,7 +1388,10 @@ interface with CI pipeline UIs.")
1388 (uri (string-append "https://www.texmacs.org/Download/ftp/tmftp/" 1388 (uri (string-append "https://www.texmacs.org/Download/ftp/tmftp/"
1389 "source/TeXmacs-" version "-src.tar.gz")) 1389 "source/TeXmacs-" version "-src.tar.gz"))
1390 (sha256 1390 (sha256
1391 (base32 "0q3k0asf31mm2jl7fi7244sk6c9lprf434cj4c5h2ycfpayjg8dk")))) 1391 (base32 "0q3k0asf31mm2jl7fi7244sk6c9lprf434cj4c5h2ycfpayjg8dk"))
1392 (patches
1393 (search-patches "texmacs-fix-plugins-wrong-init.patch"))
1394 (patch-flags '("-p0"))))
1392 (build-system qt-build-system) 1395 (build-system qt-build-system)
1393 (native-inputs 1396 (native-inputs
1394 (list pkg-config xdg-utils)) ;for xdg-icon-resource 1397 (list pkg-config xdg-utils)) ;for xdg-icon-resource