
jiho wrote:
Sorry I did not answer earlier.
No problem at all :)
jiho wrote:
I completely agree: we should read the PATH of the user and use that. However, as you, I was not able to find a solution. First, on Mac OS X, the "PATH" used by double clickable, bundled applications is the one defined in ~/.macosx/environment.plist. See the comment in packaging/macosx/resources/bin/inkscape
Instead of proceeding this way however, we could (should?) read the PATH variable set in the shell of the user and use that. The problems are:
- we could probe for the existence of .bashrc, .cshrc or similar files
depending on the $SHELL variable of the user and use what's in that. but the modifications could also be in .profile or .bash_profile or... So we need a clean solution to get the environment a regular shell script would get, and I don't know how to do that
- Inkscape would behave differently from other graphical, bundled
applications.
- and another reason that I forgot...
There is, IMHO, a fundamental design flaw in the system, which makes scripts and regular applications use different PATHs (the things set in ~/.macosx/environment.plist, for applications are not available to shell scripts, and the PATH set in .bashrc for bash scripts for example, is not available for applciations). The only way to circumvent it is to set the same thing in ~/.macosx/environment.plist and in ~/.bash_profile (which is what I do), but I don't think Inkscape can do that for you. If you can find a way to concilate all these sources of PATH variables and detect/sort that in the launcher script, it would be very much welcome and will be included.
Ah ok than I got the workings of it right... it is a very complicated matter I am suprised just how complicated it is...
Oh believe me I tried.. in the end my script was already at 300 lines and I was getting nowhere...
I tried to punch together a vanilla environment.plist file with a copy of the PATH as set in known locations (like .bash_rc or .profile or .bash_profile) or if a environment.plist file already exists without a *proper* PATH entry then just add that line to the existing file after lettting the user confirm the change.
Problem was the systems I was able to take a look at it was not uncommon that they included more than one file (out of the ones listed earlier) without the owner even knowing it. So how do I know which ones got the right PATH to copy?
As a small improvement I think it is reasonable to think that if a Python user has multiple Python version installed within multiple environments then it is reasonable to assume that he/she knows a thing or two about PATH variables and Terminal commands. In that case wouldn't it make sense to expand the error message a little when one of the modules inkex.py requires is not found, like for example:
"The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml. If you know that you have this module installed already and you have multiple Python versions installed, chances are that Inkscape uses the wrong Python installation. Please open <Inkscape.app>/Contents/Resources/bin/inkscape with a text editor and check that the order of the PATH variable matches the one your default shell uses"
Or something along those lines... I mean we can't break something by expanding the error message a little...
jiho wrote:
I'm not sure what the modifications of osx-app.sh are intended for? Thanks for the other one. We need to decide whether it is better to include that (which would affect all X11 applications) or to sort it out for Inkscape only by using keys.xml in the appropriate way.
The only modification I wanted to do was to find a way to only copy the needed Python modules and not the whole module directory which is what I believe the current script does. I ended up writing my own wrapper script that checks out Inkscape runs configure, make, then make install, then overwrite-copies to <LatestInkscapeSVNTrunkRoot>/packaging/macosx a slightly modified version of osx-app.sh that allows me to tell it via a command line argument which python modules it should copy from my local MacPython 2.6's site-packages dir (like osx-app.sh -b -py /path/to/python/modules "lxml numpy"). Then it runs the modfied osx-app.sh therefore building Inkscape-<revision>.app. I just made it for convenience and because I wanted to write some bash stuff again :)
I'll try to include it (it being the modified osx-app.sh, a .patch showing the few things that were changed and my wrapper osx-build2.sh script) via Nabble's file upload feature... maybe someone finds use for it I dunno.
I'm also thinking about putting a guide online that I wrote for a friend on compiling Inkscape for Mac OS X but with the updated wiki I don't think its needed anymore.
Btw, what's up with not being able to include a link to the CompilingMacOsX wiki article on the Inkscape wiki frontpage? That page is not editable. Can someone with proper rights change that? Else you basically have to know about the article in the first place to get to it or find it with Google by chance.
Or maybe I'm just blind :o) Nevertheless, if we can show more people how to compile for Mac OS X that can only be a good thing right?
Also for keys.xml I tried using that too... Even though I had a nice lookup table with all the key designations used by GTK I wasn't able to get the Alt key behaviour sorted out. Even tried using an old program called xkeycaps to figure out why exactly that could be but I couldn't get it to work the way I wanted to.
I added the xmodmap hack to the Inkscape FAQ in English and German, but not without warning that it is global to X11 and that the user cannot easily enter special diacriticals anymore especially on european keyboard layouts.
Btw, to whom do I need to speak to get the right to upload nightly builds ? I won't be able to upload every day but every once in a while I could contribute a build for Intel Macs.
http://www.nabble.com/file/p21063930/inkscape-support.zip inkscape-support.zip
Anyhow, Inkscape rules...
Cheers,
André