File: upstream-fix-plugins-asymptote-path_prefix.patch

package info (click to toggle)
texmacs 1%3A2.1.4%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 145,080 kB
  • sloc: cpp: 227,393; lisp: 197,386; ansic: 5,395; python: 1,939; makefile: 1,065; sh: 781; perl: 339; xml: 100; awk: 36
file content (36 lines) | stat: -rw-r--r-- 1,408 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Description: fix: plugins: asymptote: path prefix
 Pass to `asy` the outname option `-o` (or `--outname`)
 with as argument the prefix of the EPS file instead of
 its name. It appears that `asy` adds the extension `.eps`
 to the `-o` argument to obtain the file name of the EPS
 output. This change is consistent with the manpage of `asy`
 (on GNU/Linux at least) which specifies the argument as being
 an _[a]lternatice output directory/file prefix_.
Origin: vendor, Debian
Forwarded: https://github.com/texmacs/texmacs/pull/103
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2024-08-23

--- a/plugins/tmpy/graph/asymptote.py
+++ b/plugins/tmpy/graph/asymptote.py
@@ -37,7 +37,7 @@
         with open(code_path, 'w') as code_file:
             code_file.write(code)
 
-        cmd = [self.name, "-quiet", "-feps", "-o", self.get_eps_path(), code_path]
+        cmd = [self.name, "-quiet", "-feps", "-o", self.get_eps_path_prefix(), code_path]
         p = Popen(cmd, stderr=PIPE)
         out, err = p.communicate()
         if (p.returncode == 0):
--- a/plugins/tmpy/graph/graph.py
+++ b/plugins/tmpy/graph/graph.py
@@ -126,6 +126,9 @@
     def get_png_path(self):
         return self.get_tmp_dir() + self.name + ".png"
 
+    def get_eps_path_prefix(self):
+        return self.get_tmp_dir() + self.name
+
     def get_eps_path(self):
         return self.get_tmp_dir() + self.name + ".eps"