Advice on distributing a project

Langer, Stephen A. (Fed) stephen.langer at
Thu Jun 14 17:58:42 UTC 2018

On 6/13/18, 8:37 PM, "Craig Treleaven" <ctreleaven at> wrote:

    > On Jun 13, 2018, at 6:35 PM, Rainer Müller <raimue at> wrote:
    > On 2018-06-13 21:37, Langer, Stephen A. (Fed) wrote:
    >> (2) Package all of the compiled libraries and dependencies into a Mac-like app and distribute binaries, but not a portfile.  Will "port pkg"  do this if I write a portfile for the project?  Can I tell it to include the vtk libraries that have been built outside of MacPorts?
    > You could use 'sudo port mpkg', which creates a single .pkg installer
    > that includes the files for the port and all of its dependencies. This
    > assumes that you have a port that provides the required vtk libraries.
    > It is not possible to include extra files that are not provided by a port.
    > If you are going to distribute this installer, please use a prefix other
    > than /opt/local for it, to avoid a collision for users that also use
    > MacPorts.
    If you anticipate that some or all the users will have MacPorts installed, creating an installer with MacPorts _may_ lead to problems even though you use a non-default prefix when creating your installer.  That non-default prefix is where your packaged software ends up on the user’s system.  If your packaged software looks for utilities (or libraries) at run-time, the user’s PATH could lead to version conflicts.  Hopefully this would not affect you but it could lead to ‘wild-goose-chasing’ bugs.  Something to give thought to before going down this path.
    Re vtk, or any other dependency, you can create/modify any of the ports for the deps so as to get the version you want.  See the guide section:
    In addition to the guide section that Rainer linked, you might want to review the following wiki page.  I’ve written up some tips and tricks…mostly to aid my own memory.  Contributions encouraged!
    If you get into the process and have questions or issues, don’t hesitate to post to this mailing list.  I and others would be happy to try to help.

Thanks for the advice.  If I make a new non-standardly located macports directory on my system, build my program and all of its dependencies in that directory (including dependencies that aren't packaged with macports), and then package it with "port mpkg", is that guaranteed to avoid conflicts on users' systems?  I'd be using both a non-default installation prefix in my portfile, and also a non-default version of macports to build it.

 -- Steve

More information about the macports-users mailing list