Newbie Port Creator Questions

Weissmann Markus mww at
Sun Sep 2 15:03:15 PDT 2007

Hi Jonathan,

On 02.09.2007, at 22:35, Jonathan Strine wrote:

> All,
> I am working on creating ports for a few applications.  I have  
> created and submitted my first one just yesterday (libelf-0.8.9).   
> I am now working on my second (dynamips-0.2.7), but have a few  
> questions I'm hoping someone can answer (not all relating to just  
> dynamips-0.2.7).
> 1)  I have successfully created a variant of dynamips using pcap.   
> The process was rather simple.  However, I am debating the creation  
> of a third variant.  A third party developer has created a source  
> code patch that extends a certain function of dynamips in a useful  
> way.  Is it appropriate to include such a third party modification  
> as a variant to a port?

Absolutely. If you find it useful and no is bashing you for that  
(e.g. because it breaks ports that depend on it), go ahead!

> 2)  In the case above, the third party patch file is written to be  
> applied from the directory above the source code (I think this  
> would be called the work directory) and not from inside the  
> dynamips-0.2.7 directory created when the tarball is extracted.   
> The best I can figure is that the patching phase does apply the  
> patch while in this source directory (dynamips-0.2.7) and not from  
> the work directory.  It is possible to make it apply the patch from  
> the work directory so that I do not have to modify the third party  
> patch file for this variant?

you could either modify the patch-directory via 'patch.dir $ 
{worksrcpath}/foo/bar/' or just create a new patch via diffing the  
original and the patches sources from the base dir;

> 3)  The third party patch is licensed under the GPLv2 license.  Are  
> there any general concerns that I should worry about in either case  
> where I use the patch file as is or in the case where I modify it?

No problems for us. It'll only hit the people who link against the  
new product. We will happily distribute GPLed code (as long as port  
itself is not mixed with it).

> 4)  If I cannot patch from the work directory, is it considered OK  
> to modify the third party patch file to support patching from  
> inside the dynamips-0.2.7 directory?

yes, sure; GPLed code may be modified and distributed by us (see above).

> 5)  What is the best practice to make sure that during all the  
> steps I am only referencing libraries and dependencies from the  
> macports system and not accidentally compiling against pre- 
> installed system libraries?  I have run "port -d install foo" and  
> read through the output, but I want to double check that I am not  
> missing anything.

It currently may be broke, but we do have 'trace' mode which can be  
activated with the '-t' switch. It'll tell you about all ports that  
your port touches during its build.
For checking after you build it, I recommend a simple 'find' command  
#> find work/destroot -type f | xargs otool -L 2>&1 | sort -u
That'll tell you all libs that the files in destroot link against.



Markus W. Weissmann

Markus W. Weissmann

More information about the macports-dev mailing list