general advice about making a portfile and a binary package?

Rainer Müller raimue at macports.org
Sat Mar 14 09:38:09 PDT 2009


On 14.03.2009 17:06 Uhr, Allen McBride wrote:
> Great, I would love to do this.  I just have a few questions to get my  
> Portfile written correctly, even though it already works for me:
> 
> 1) Among the dependencies the author lists for Solfege are MIDI, GCC,  
> and GNU Make.  Any Mac has MIDI, and anyone who has installed MacPorts  
> will have the other two, right?  Do I need to include them as non-port  
> dependencies, or can I ignore them?

Yes, gcc and make is assumed to be available.

> 2) X11 isn't listed as a dependency, but building Solfege for Aqua  
> sounds like a whole other project.  But again, any MacPorts user  
> should have X11.  Do I need to list X11 as a dependency?  If so, how?   
> "depends_lib  lib:libX11:xorg-libX11"?

It looks like Solfege uses GTK. In this case, simply add a dependency on
port:gtk2 which itself depends on X11 if necessary, so you don't have to
care about that.

It is recommended to run trace mode to find all dependencies.
  sudo port -t destroot
It will report access to files which do not belong to any port in the
dependency chain. Note that a build using trace mode may fail due to the
inaccessibility of files.

> 3) Certain versions of dependencies are required (but not cutting-edge  
> or anything).  I don't see anything in the MacPorts Guide about  
> specifying dependency versions.  Am I supposed to do this?

No, version information is not tracked.

> 4) Python is a run dependency, and the python header files are a build  
> dependency.  From http://trac.macports.org/ticket/18055, it looks like  
> there is no port of just the headers.  Can I just list python as a run  
> dependency and assume the headers will therefore be there for the build?

If a port is required at build and runtime, list it in depends_lib.

>> No, you would have to install MacPorts to a different prefix and  
>> create
>> the package from there. Download the MacPorts source and use
>> './configure --prefix=/opt/whatever' followed by the usual make &&  
>> make
>> install. Then create the dmg from this port installation (use
>> /opt/whatever/bin/port). You would also have to create binary packages
>> of all dependencies being used.
> 
> Thanks, this is helpful too.  I'll first get my Portfile in order and  
> then see about making binaries I can distribute.  In searching the web  
> and the list archives, I see references to a "port mdmg" command that  
> can create just one file with all dependencies.  But there's nothing  
> in the MacPorts Guide about it.  Where can I find more information  
> about port mdmg?

Hm, probably nowhere. I am not aware of any more documentation for
packaging.

Rainer


More information about the macports-users mailing list