Creating $prefix/bin/foo and Foo.app at the same time

Mojca Miklavec mojca at macports.org
Tue Jul 16 10:49:03 PDT 2013


Hi,

(This question is related to Gate, but this is not relevant and could
be asked about any port.)

I would like to create a package providing both the command-line
executable as well as a real Mac application ($prefix/bin/Gate and
/Applications/MacPorts/Gate.app).

By default the installation creates $prefix/bin/Gate (even though I'm
sure that I can change the configuration options to put it somewhere
else), but I need to replace it with a shell script that sets a bunch
of environmental variables first and then calls the real executable.

But I would also like to create Gate.app inside
/Applications/MacPorts. My questions are as follows:

1.) I guess that there is no need to make the app standalone in terms
of links to libraries? (It's probably ok if the app links to
$prefix/lib/libwhatever.dylib instead of having to use
@rpath/../some/local/path/to/libwhatever.dylib)

2.) What should I do with the binary? Where should I put the real
binary? Do I need to copy it inside the app? Can I simply use a shell
script inside the app that launches the binary from
$prefix/libexec/gate/Gate? Or should I simply put the binary to app
only and then make $prefix/bin/Gate a shell script launching the
binary from inside the app?

3.) I need a few extra files like icns & those weird xml files. Should
they go to the same folder where patch files are?

4.) Let's say that I already have a working binary in
$prefix/libexec/gate/Gate. What is the optimal way of testing creation
of the app (copying files around and creating some files on the fly)
without having to compile gate after every trivial change of the
Portfile? Related question: let's say that "port" fails during
destroot. Is there any way to keep changing the Portfile without the
need to recompile everything (sometimes compilation can take 30
minutes and I make trivial mistakes in post-destroot)?

Thank you very much (and sorry for some confusing questions - please
ask if you can't figure out what I was trying to ask),
    Mojca


More information about the macports-dev mailing list