Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-10-03 Thread Stephan Witt
Am 01.10.2017 um 09:38 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, den 24.09.2017, 11:55 +0200 schrieb Stephan Witt:
>> commit 350ef993e59b3ede7dd621a81f096ea78296c5c8
>> Author: Stephan Witt 
>> Date:   Sun Sep 24 11:54:55 2017 +0200
>> 
>>add inkscape wrapper script for Mac OS
>> 
>>The wrapper script is placed in the binary directory of the LyX
>> bundle.
>>It tries to find the real inkscape command line converter in the
>>Inkscape.app bundle and starts it or reports an error.
>>The configure.py is changed for Mac OS to check the presence of
>>the real inkscape binary in the Inkscape.app bundle.
> 
> This should also go to 2.3.x. Otherwise, the new inkscape external
> template will probably fail on Mac.

Thanks for the reminder. I’ve put in in now.

Stephan

Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Jürgen Spitzmüller
Am Sonntag, den 24.09.2017, 18:57 +0200 schrieb Stephan Witt:
> Isn’t this ok?

Works for me as well.

Jürgen

signature.asc
Description: This is a digitally signed message part


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Jürgen Spitzmüller
Am Sonntag, den 24.09.2017, 19:03 +0200 schrieb Jürgen Spitzmüller:
> You have to pass the inkscape command as first argument.

No, actually, you don't. That's optional (I forgot).

Jürgen

> 
> Jürgen

signature.asc
Description: This is a digitally signed message part


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Jürgen Spitzmüller
Am Sonntag, den 24.09.2017, 18:57 +0200 schrieb Stephan Witt:
> Sorry, I neither read the script nor the python docs until now.
> 
> I think it’s fine already. The subprocess.check_call gets the
> args passed as array of strings and executes the sub process
> with individual arguments. The spaces don’t need quotes.

That's what I thought as well, but in the case of the command, it
didn't work for Uwe unless I wrapped the command name in quotes.

> I’ve tried this:
> $ mkdir 'dir with spaces‘
> $ cp lyx/lib/images/file-open.svgz 'dir with spaces‘
> $ python lyx/lib/scripts/svg2pdftex.py $(pwd)/'dir with spaces'/file-
> open.svgz $(pwd)/file-open.pdf
> $ ls -l file-open.*
> -rw-r--r--@ 1 stephan  staff  45330 24 Sep 18:55 file-open.pdf
> -rw-r--r--  1 stephan  staff   1871 24 Sep 18:55 file-open.tex
> $
> 
> Isn’t this ok?

You have to pass the inkscape command as first argument.

Jürgen

signature.asc
Description: This is a digitally signed message part


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Stephan Witt

> Am 24.09.2017 um 18:57 schrieb Stephan Witt :
> 
> Am 24.09.2017 um 18:32 schrieb Jürgen Spitzmüller :
>> 
>> Am Sonntag, den 24.09.2017, 17:30 +0200 schrieb Stephan Witt:
 OK, but we might need to re-add quotes in the script (like we had
 to do
 for the first argument (inkscape command), for windows.
>>> 
>>> Yes, that should be done to be safe anyway.
>>> Every shell script needs to be written likewise to be correct.
>> 
>> Hm, but I fail to do that. --file= (and also -f) do not seem to accept
>> double nor single quotes.
> 
> Sorry, I neither read the script nor the python docs until now.
> 
> I think it’s fine already. The subprocess.check_call gets the
> args passed as array of strings and executes the sub process
> with individual arguments. The spaces don’t need quotes.
> 
> I’ve tried this:

$ mkdir 'dir with spaces‘
$ cp lyx/lib/images/file-open.svgz 'dir with spaces‘
$ python lyx/lib/scripts/svg2pdftex.py $(pwd)/'dir with spaces'/file-open.svgz 
$(pwd)/file-open.tex
$ ls -l file-open.*
-rw-r--r--@ 1 stephan  staff  45330 24 Sep 18:55 file-open.pdf
-rw-r--r--  1 stephan  staff   1871 24 Sep 18:55 file-open.tex
$

> Isn’t this ok?
> 
> Stephan



Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Stephan Witt
Am 24.09.2017 um 18:32 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, den 24.09.2017, 17:30 +0200 schrieb Stephan Witt:
>>> OK, but we might need to re-add quotes in the script (like we had
>>> to do
>>> for the first argument (inkscape command), for windows.
>> 
>> Yes, that should be done to be safe anyway.
>> Every shell script needs to be written likewise to be correct.
> 
> Hm, but I fail to do that. --file= (and also -f) do not seem to accept
> double nor single quotes.

Sorry, I neither read the script nor the python docs until now.

I think it’s fine already. The subprocess.check_call gets the
args passed as array of strings and executes the sub process
with individual arguments. The spaces don’t need quotes.

I’ve tried this:
$ mkdir 'dir with spaces‘
$ cp lyx/lib/images/file-open.svgz 'dir with spaces‘
$ python lyx/lib/scripts/svg2pdftex.py $(pwd)/'dir with spaces'/file-open.svgz 
$(pwd)/file-open.pdf
$ ls -l file-open.*
-rw-r--r--@ 1 stephan  staff  45330 24 Sep 18:55 file-open.pdf
-rw-r--r--  1 stephan  staff   1871 24 Sep 18:55 file-open.tex
$

Isn’t this ok?

Stephan

Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Kornel Benko
Am Sonntag, 24. September 2017 um 18:41:47, schrieb Stephan Witt 

> Am 24.09.2017 um 16:55 schrieb Kornel Benko :
> > 
> > Am Sonntag, 24. September 2017 um 16:18:08, schrieb Kornel Benko 
> > 
> >> Am Sonntag, 24. September 2017 um 14:50:19, schrieb Stephan Witt 
> >> 
> >>> Am 24.09.2017 um 12:30 schrieb Kornel Benko :
>  
>  Am Sonntag, 24. September 2017 um 11:55:38, schrieb Stephan Witt 
>  
> > commit 350ef993e59b3ede7dd621a81f096ea78296c5c8
> > Author: Stephan Witt 
> > Date:   Sun Sep 24 11:54:55 2017 +0200
> > 
> >   add inkscape wrapper script for Mac OS
> > 
>  
>  Probably it doesn't matter, (because nobody cares for cmake on MacOSX?)
>  Would be fine, if someone could check.
>  
>   Kornel
> >>> 
> >>> It doesn’t work, IMO. What I did to check:
> >>> 
> >> 
> >> Could you please check, if the foreach() loop was entered?
> >>message(STATUS "installing ${_i}")
> >> 
> > 
> > I believe, I see the reason. Try to call cmake with '-DLYX_INSTALL=ON".
> > (See {TOP_LEVEL_LYX_SRC}/CMakeLists.txt:1098)
> 
> This works. Why is it needed?
> 
> Stephan

I don't know. Not my doing. We could always set it IMHO.
Since I use '-DLYX_CPACK=ON', which sets this variable too, I never saw 
problems.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Stephan Witt
Am 24.09.2017 um 16:55 schrieb Kornel Benko :
> 
> Am Sonntag, 24. September 2017 um 16:18:08, schrieb Kornel Benko 
> 
>> Am Sonntag, 24. September 2017 um 14:50:19, schrieb Stephan Witt 
>> 
>>> Am 24.09.2017 um 12:30 schrieb Kornel Benko :
 
 Am Sonntag, 24. September 2017 um 11:55:38, schrieb Stephan Witt 
 
> commit 350ef993e59b3ede7dd621a81f096ea78296c5c8
> Author: Stephan Witt 
> Date:   Sun Sep 24 11:54:55 2017 +0200
> 
>   add inkscape wrapper script for Mac OS
> 
 
 Probably it doesn't matter, (because nobody cares for cmake on MacOSX?)
 Would be fine, if someone could check.
 
  Kornel
>>> 
>>> It doesn’t work, IMO. What I did to check:
>>> 
>> 
>> Could you please check, if the foreach() loop was entered?
>>  message(STATUS "installing ${_i}")
>> 
> 
> I believe, I see the reason. Try to call cmake with '-DLYX_INSTALL=ON".
> (See {TOP_LEVEL_LYX_SRC}/CMakeLists.txt:1098)

This works. Why is it needed?

Stephan

Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Jürgen Spitzmüller
Am Sonntag, den 24.09.2017, 17:30 +0200 schrieb Stephan Witt:
> > OK, but we might need to re-add quotes in the script (like we had
> > to do
> > for the first argument (inkscape command), for windows.
> 
> Yes, that should be done to be safe anyway.
> Every shell script needs to be written likewise to be correct.

Hm, but I fail to do that. --file= (and also -f) do not seem to accept
double nor single quotes.

Jürgen

> 
> Stephan

signature.asc
Description: This is a digitally signed message part


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Stephan Witt
Am 24.09.2017 um 16:25 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, den 24.09.2017, 13:57 +0200 schrieb Stephan Witt:
>> I’d say you see the path names in svg2pdftex unquoted because of the
>> shell is removing them.
> 
> Makes sense.
> 
>> Nevertheless you get the path names with spaces passed as one
>> argument.
> 
> OK, but we might need to re-add quotes in the script (like we had to do
> for the first argument (inkscape command), for windows.

Yes, that should be done to be safe anyway.
Every shell script needs to be written likewise to be correct.

Stephan

Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Kornel Benko
Am Sonntag, 24. September 2017 um 16:18:08, schrieb Kornel Benko 

> Am Sonntag, 24. September 2017 um 14:50:19, schrieb Stephan Witt 
> 
> > Am 24.09.2017 um 12:30 schrieb Kornel Benko :
> > > 
> > > Am Sonntag, 24. September 2017 um 11:55:38, schrieb Stephan Witt 
> > > 
> > >> commit 350ef993e59b3ede7dd621a81f096ea78296c5c8
> > >> Author: Stephan Witt 
> > >> Date:   Sun Sep 24 11:54:55 2017 +0200
> > >> 
> > >>add inkscape wrapper script for Mac OS
> > >> 
> > > 
> > > Probably it doesn't matter, (because nobody cares for cmake on MacOSX?)
> > > Would be fine, if someone could check.
> > > 
> > >   Kornel
> > 
> > It doesn’t work, IMO. What I did to check:
> > 
> 
> Could you please check, if the foreach() loop was entered?
>   message(STATUS "installing ${_i}")
> 

I believe, I see the reason. Try to call cmake with '-DLYX_INSTALL=ON".
(See {TOP_LEVEL_LYX_SRC}/CMakeLists.txt:1098)

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Jürgen Spitzmüller
Am Sonntag, den 24.09.2017, 13:57 +0200 schrieb Stephan Witt:
> I’d say you see the path names in svg2pdftex unquoted because of the
> shell is removing them.

Makes sense.

> Nevertheless you get the path names with spaces passed as one
> argument.

OK, but we might need to re-add quotes in the script (like we had to do
for the first argument (inkscape command), for windows.

Jürgen

> 
> Stephan

signature.asc
Description: This is a digitally signed message part


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Kornel Benko
Am Sonntag, 24. September 2017 um 14:50:19, schrieb Stephan Witt 

> Am 24.09.2017 um 12:30 schrieb Kornel Benko :
> > 
> > Am Sonntag, 24. September 2017 um 11:55:38, schrieb Stephan Witt 
> > 
> >> commit 350ef993e59b3ede7dd621a81f096ea78296c5c8
> >> Author: Stephan Witt 
> >> Date:   Sun Sep 24 11:54:55 2017 +0200
> >> 
> >>add inkscape wrapper script for Mac OS
> >> 
> > 
> > Probably it doesn't matter, (because nobody cares for cmake on MacOSX?)
> > Would be fine, if someone could check.
> > 
> >   Kornel
> 
> It doesn’t work, IMO. What I did to check:
> 

Could you please check, if the foreach() loop was entered?
message(STATUS "installing ${_i}")

Kornel



signature.asc
Description: This is a digitally signed message part.


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Stephan Witt
Am 24.09.2017 um 12:30 schrieb Kornel Benko :
> 
> Am Sonntag, 24. September 2017 um 11:55:38, schrieb Stephan Witt 
> 
>> commit 350ef993e59b3ede7dd621a81f096ea78296c5c8
>> Author: Stephan Witt 
>> Date:   Sun Sep 24 11:54:55 2017 +0200
>> 
>>add inkscape wrapper script for Mac OS
>> 
> 
> Probably it doesn't matter, (because nobody cares for cmake on MacOSX?)
> Would be fine, if someone could check.
> 
>   Kornel

It doesn’t work, IMO. What I did to check:

==
$ cd "${LyxBuildDir}" &&\
   cmake -G "Xcode" "${LyxSourceDir}" \
  -DCMAKE_SYSTEM_PREFIX_PATH="/usr;${XCODE_SDK_PATH}/usr" \
  -DLYX_LOCALVERSIONING=ON \
  -DLYX_NLS=OFF \
  -DLYX_DEBUG=ON -DLYX_RELEASE=OFF \
  -DLYX_DEBUG_GLIBC=OFF -DLYX_DEBUG_GLIBC_PEDANTIC=OFF \
  -DLYX_PACKAGE_SUFFIX=OFF -DLYX_PROGRAM_SUFFIX=OFF \
  -DLYX_ENABLE_EXPORT_TESTS=OFF \
  -DLYX_USE_QT=QT5 \
  -DASPELL_INCLUDE_DIR=${LyxUtilDir}/include \
  -DASPELL_LIBRARY_RELEASE=${LyxUtilDir}/lib/libaspell.dylib \
  -DHUNSPELL_INCLUDE_DIR=${LyxUtilDir}/include \
  -DHUNSPELL_LIBRARY=${LyxUtilDir}/lib/libhunspell.dylib \
  -DENCHANT_INCLUDE_DIR=${LyxUtilDir}/include \
  -DENCHANT_LIBRARY=${LyxUtilDir}/lib/libenchant.dylib \
  -D_MYTHESLIB_INCLUDE_DIR=${LyxUtilDir}/include \
  -D_MYTHESLIB_LIBRARY=${LyxUtilDir}/lib/libenchant.dylib \
  -DMagic_INCLUDE_DIR=${LyxUtilDir}/include \
  -DMagic_LIBRARY=${LyxUtilDir}/lib/libmagic.dylib \
  -DLYX_ASPELL=ON -DLYX_HUNSPELL=ON \
  -DCMAKE_INSTALL_PREFIX="${LyxBuildDir}“/../lyx-install
$ xcodebuild -project "${LyxBuildDir}"/LyX.xcodeproj -target install
snip terminal output...
=== BUILD AGGREGATE TARGET install OF PROJECT LyX WITH THE DEFAULT 
CONFIGURATION (Debug) ===

Check dependencies

Write auxiliary files
write-file 
/Users/stephan/git/lyx-build/cmake/2.4.0dev/LyX.build/Debug/install.build/Script-71EC931F283346709469E676.sh
chmod 0755 
/Users/stephan/git/lyx-build/cmake/2.4.0dev/LyX.build/Debug/install.build/Script-71EC931F283346709469E676.sh

PhaseScriptExecution CMake\ PostBuild\ Rules 
/Users/stephan/git/lyx-build/cmake/2.4.0dev/LyX.build/Debug/install.build/Script-71EC931F283346709469E676.sh
cd /Users/stephan/git/lyx
/bin/sh -c 
/Users/stephan/git/lyx-build/cmake/2.4.0dev/LyX.build/Debug/install.build/Script-71EC931F283346709469E676.sh
/opt/local/bin/cmake -DBUILD_TYPE=Debug -P cmake_install.cmake
-- Install configuration: "Debug"
-- Installing: /Users/stephan/git/lyx-build/cmake/lyx-install/bin/LyX
-- Installing: /Users/stephan/git/lyx-build/cmake/lyx-install/bin/tex2lyx
-- Installing: /Users/stephan/git/lyx-build/cmake/lyx-install/bin/lyxclient
-- Installing: 
/Users/stephan/git/lyx-build/cmake/lyx-install/share/LyX/lyx2lyx/lyx2lyx_version.py
-- Installing: 
/Users/stephan/git/lyx-build/cmake/lyx-install/share/LyX/lyx2lyx/lyx2lyx

** BUILD SUCCEEDED **

$ ls "${LyxBuildDir}“/../lyx-install/bin
LyX lyxclient   tex2lyx
==

I don’t see any lyxeditor, maxima or inkscape installed.

Stephan

Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Stephan Witt
Am 24.09.2017 um 13:08 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, den 24.09.2017, 12:18 +0200 schrieb Stephan Witt:
>> I think they’ll be quoted automatically.
> 
> At least in the svg2pdftex script, they end unquoted. I expect problems
> if the path to the tmp dir contains spaces.

See method Converters::convert() in Converter.cpp lines 607 and following.

The debugger stopped at line 616 says:

(lldb) print command
(std::__1::string) $123 = "inkscape 
--file=\"/var/folders/1x/zm63s22x7s591xrlgm4rl9v4gn/T/lyx_tmpdir.miGPzmn52606/lyx_tmpbuf0/\"\"1_Users_stephan_git_lyx_lib_images_buffer-reload.svgz\"
 --export-area-drawing --without-gui 
--export-pdf=\"/var/folders/1x/zm63s22x7s591xrlgm4rl9v4gn/T/lyx_tmpdir.miGPzmn52606/lyx_tmpbuf0/\"\"1_Users_stephan_git_lyx_lib_images_buffer-reload.pdf\“"

I’d say you see the path names in svg2pdftex unquoted because of the shell is 
removing them.
Nevertheless you get the path names with spaces passed as one argument.

Stephan

Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Jürgen Spitzmüller
Am Sonntag, den 24.09.2017, 12:18 +0200 schrieb Stephan Witt:
> I think they’ll be quoted automatically.

At least in the svg2pdftex script, they end unquoted. I expect problems
if the path to the tmp dir contains spaces.

Jürgen

signature.asc
Description: This is a digitally signed message part


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Kornel Benko
Am Sonntag, 24. September 2017 um 11:55:38, schrieb Stephan Witt 
> commit 350ef993e59b3ede7dd621a81f096ea78296c5c8
> Author: Stephan Witt 
> Date:   Sun Sep 24 11:54:55 2017 +0200
>
> add inkscape wrapper script for Mac OS
>

Probably it doesn't matter, (because nobody cares for cmake on MacOSX?)
Would be fine, if someone could check.

Kornel

signature.asc
Description: This is a digitally signed message part.
diff --git a/development/cmake/Install.cmake b/development/cmake/Install.cmake
index b2e312d..5989344 100755
--- a/development/cmake/Install.cmake
+++ b/development/cmake/Install.cmake
@@ -128,7 +128,9 @@ if(APPLE)
 install(FILES "${TOP_SRC_DIR}/development/MacOSX/PkgInfo" DESTINATION "${MACOSX_BUNDLE_STARTUP_COMMAND}/Contents")
   endif()
 
-  install(FILES "${TOP_SRC_DIR}/development/MacOSX/lyxeditor" DESTINATION "${LYX_UTILITIES_INSTALL_PATH}")
+  foreach(_i lyxeditor maxima inkscape)
+install(FILES "${TOP_SRC_DIR}/development/MacOSX/${_i}" DESTINATION "${LYX_UTILITIES_INSTALL_PATH}")
+  endforeach()
   install(FILES "${TOP_SRC_DIR}/development/MacOSX/LyX.icns" DESTINATION "${LYX_DATA_SUBDIR}")
   set(program_suffix ${PROGRAM_SUFFIX})
 elseif(UNIX)


Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Stephan Witt
Am 24.09.2017 um 12:03 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, den 24.09.2017, 11:55 +0200 schrieb Stephan Witt:
>> -checkProg('an EMF -> EPS converter', ['metafile2eps $$i $$o',
>> 'wmf2eps -o $$o $$i', inkscape_name + ' --file=$$i --export-area-
>> drawing --without-gui --export-eps=$$o'],
>> +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'],
>> rc_entry = [ r'\converter emfeps"%%" 
>> ""'])
> 
> I wonder whether these $$p$$i need to be quoted, as the paths probably
> can contain spaces.

I think they’ll be quoted automatically. If not then we have this problem
with many converters (Rscript etc).

Stephan

Re: [LyX/master] add inkscape wrapper script for Mac OS

2017-09-24 Thread Jürgen Spitzmüller
Am Sonntag, den 24.09.2017, 11:55 +0200 schrieb Stephan Witt:
> -checkProg('an EMF -> EPS converter', ['metafile2eps $$i $$o',
> 'wmf2eps -o $$o $$i', inkscape_name + ' --file=$$i --export-area-
> drawing --without-gui --export-eps=$$o'],
> +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'],
>  rc_entry = [ r'\converter emfeps"%%" 
> ""'])

I wonder whether these $$p$$i need to be quoted, as the paths probably
can contain spaces.

Jürgen

signature.asc
Description: This is a digitally signed message part