dmg packages

Joshua Root jmr at
Fri Jun 1 06:49:59 PDT 2012

On 2012-6-1 23:38 , Craig Treleaven wrote:
> Hi:
> I'm a bit confused about MacPorts packaging targets:  mpkg, dmg, etc. I
> don't have a spare system to test these things out.  I've looked at the
> documentation
> ( and the man
> page for port without enlightenment.
> So, if I create a dmg of my port and a user installs it on another
> machine, I presume all the bits and bobs end up in the same file system
> locations as when I do 'sudo port install myport' on a machine with
> MacPorts.  IOW, virtually everything under ${prefix}.  Although
> ${prefix} _must_ be /opt/local for a dmg install, no?

The prefix for the pkg in the dmg will be the same as the MacPorts
installation that built it.

> What happens if the destination machine has MacPorts installed before
> doing a dmg install?  Is "myport" now shown as an installed port? Can
> myport be deactivated by MacPorts?

No and no. If you're going to distribute pkgs to users who might have
MacPorts installed, please use a different prefix like /opt/packagename.

> If MacPorts is installed before doing an install with a dmg, what
> happens to dependencies that may already be present on the destination
> machine?  Ie the destination machine might have older, newer or the same
> version of one or more dependencies, possibily with different variants. 
> Does the dmg overwrite them?  Will the dmg warn about this?

They will be clobbered. doesn't warn about this AFAIK.

> What happens if MacPorts is installed _after_ the dmg install of
> myport?  Again, will Macports identify that myport and all its
> dependencies are installed?  Will 'sudo port upgrade' work?

No, the files will not be registered to any port and will cause
conflicts if a port then tries to install those files.

> What if the user wants to install an additional port that depends on
> myport (call it "myportplus").  If myport was installed via dmg and the
> user wants to install myportplus via MacPorts, will it be recognised
> that the myport dependency is already satisfied or will it be downloaded
> and installed fresh?  (Which many take multiple hours in my case as I
> depend on a non-default variant of Qt4-mac.)

No, again, the pkg just installs the files, it doesn't register them
with the MacPorts registry.

- Josh

More information about the macports-dev mailing list