dmg packages

Jeremy Lavergne jeremy at
Fri Jun 1 06:51:16 PDT 2012

> 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?

dmg will only contain the specific port you've requested, while mdmg will contain all dependencies as well.

They will install to the same ${prefix} used to create them, however they are not required to be /opt/local. In fact, it's usually suggested that they NOT be /opt/local so that if MacPorts does get installed the user doesn't have to deal with "file x is already installed but not registered--use -f to force activation" messages.

> 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?

When installing from dmg over top of MacPorts, the dmg will clobber MacPorts' files. It does not inform MacPorts of the installation.

> 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?

The dmg will overwrite without warning; if a dmg has older software than what MacPorts has installed, you'll silently be downgraded which might break many, many ports that link to a downgraded library.

> 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?

If the user installs the same ports that the dmg installed, each one will error out until the user forcibly activates the port (that is, the conflicting files are renamed with a common suffix pattern: *.mp_TIMESTAMP).

> 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.)

MacPorts won't know you installed something into its area, and will attempt to do build/download an archive on its own; this will error out for the same reasons above.

> Thanks for any light you can shed!

Enjoy :-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 8796 bytes
Desc: not available
URL: <>

More information about the macports-dev mailing list