Only use full path for inkscape file arguments on Mac.

(cherry picked from commit 22125fa6de)
This commit is contained in:
Juergen Spitzmueller 2017-10-29 08:52:15 +01:00 committed by Scott Kostyshak
parent b516eecbce
commit bf77b61162

View File

@ -1010,16 +1010,18 @@ def checkConverterEntries():
\converter tgif png "tgif -print -color -png -o $$d $$i" ""
\converter tgif pdf6 "tgif -print -color -pdf -stdout $$i > $$o" ""'''])
#
checkProg('a WMF -> EPS converter', ['metafile2eps $$i $$o', 'wmf2eps -o $$o $$i', inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui --export-eps=$$p$$o'],
checkProg('a WMF -> EPS converter', ['metafile2eps $$i $$o', 'wmf2eps -o $$o $$i', inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui --export-eps=%s$$o'
% (inkscape_fileprefix, inkscape_fileprefix)],
rc_entry = [ r'\converter wmf eps "%%" ""'])
#
checkProg('an EMF -> EPS converter', ['metafile2eps $$i $$o', 'wmf2eps -o $$o $$i', inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui --export-eps=$$p$$o'],
checkProg('an EMF -> EPS converter', ['metafile2eps $$i $$o', 'wmf2eps -o $$o $$i', inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui --export-eps=%s$$o'
% (inkscape_fileprefix, inkscape_fileprefix)],
rc_entry = [ r'\converter emf eps "%%" ""'])
#
checkProg('a WMF -> PDF converter', [inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui --export-pdf=$$p$$o'],
checkProg('a WMF -> PDF converter', [inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui --export-pdf=%s$$o' % (inkscape_fileprefix, inkscape_fileprefix)],
rc_entry = [ r'\converter wmf pdf6 "%%" ""'])
#
checkProg('an EMF -> PDF converter', [inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui --export-pdf=$$p$$o'],
checkProg('an EMF -> PDF converter', [inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui --export-pdf=%s$$o' % (inkscape_fileprefix, inkscape_fileprefix)],
rc_entry = [ r'\converter emf pdf6 "%%" ""'])
# Only define a converter to pdf6 for graphics
checkProg('an EPS -> PDF converter', ['epstopdf'],
@ -1065,17 +1067,20 @@ def checkConverterEntries():
rc_entry = [ r'\converter svg svgz "%%" ""'])
# Only define a converter to pdf6 for graphics
# Prefer rsvg-convert over inkscape since it is faster (see http://www.lyx.org/trac/ticket/9891)
checkProg('a SVG -> PDF converter', ['rsvg-convert -f pdf -o $$o $$i', inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui --export-pdf=$$p$$o'],
checkProg('a SVG -> PDF converter', ['rsvg-convert -f pdf -o $$o $$i', inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui --export-pdf=%s$$o'
% (inkscape_fileprefix, inkscape_fileprefix)],
rc_entry = [ r'''\converter svg pdf6 "%%" ""
\converter svgz pdf6 "%%" ""'''],
path = ['', inkscape_path])
#
checkProg('a SVG -> EPS converter', ['rsvg-convert -f ps -o $$o $$i', inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui --export-eps=$$p$$o'],
checkProg('a SVG -> EPS converter', ['rsvg-convert -f ps -o $$o $$i', inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui --export-eps=%s$$o'
% (inkscape_fileprefix, inkscape_fileprefix)],
rc_entry = [ r'''\converter svg eps "%%" ""
\converter svgz eps "%%" ""'''],
path = ['', inkscape_path])
#
checkProg('a SVG -> PNG converter', ['rsvg-convert -f png -o $$o $$i', inkscape_name + ' --without-gui --file=$$i --export-png=$$o'],
checkProg('a SVG -> PNG converter', ['rsvg-convert -f png -o $$o $$i', inkscape_name + ' --without-gui --file=%s$$i --export-png=%s$$o'
% (inkscape_fileprefix, inkscape_fileprefix)],
rc_entry = [ r'''\converter svg png "%%" "",
\converter svgz png "%%" ""'''],
path = ['', inkscape_path])
@ -1846,6 +1851,11 @@ Format %i
java = checkProg('a java interpreter', ['java'])[1]
perl = checkProg('a perl interpreter', ['perl'])[1]
(inkscape_path, inkscape_name) = os.path.split(checkInkscape())
# On MacOSX, Inkscape requires full path file arguments. This
# is not needed on Linux and Win and even breaks the latter.
inkscape_fileprefix = ""
if sys.platform == 'darwin':
inkscape_fileprefix = "$$p"
checkFormatEntries(dtl_tools)
checkConverterEntries()
(chk_docbook, bool_docbook, docbook_cmd) = checkDocBook()