How to request MacPorts to add a port?

Scott Haneda talklists at
Mon Jun 22 14:55:03 PDT 2009

On Jun 22, 2009, at 2:24 AM, Scott wrote:

> Hey guys thanks so much for your help, and for actually making
> a MacPorts port for URLtoys.

Seems the portfile I made was missing some dependencies, you can  
follow the progress here:

> (1)
> I ended up doing it manually.  Below were the steps.  I'm sad that I
> had to put these OUTSIDE the /opt/local/ directory:
> * get archive of URLtoys stuff at:
> * make new directory WWW/ in /Library/Perl/Updates/5.8.8
> * dig inside the archive, put in the above
> * same for URLtoys.pod
> * put in my_commands (the dir for my own stuff, placed in
>  PATH); kill the `.pl' extension; chmod +x

I am not familiar with perl enough to say whether that was good or bad.

> QUESTION 1: Could I have done this more easily?

I think so, I believe by sticking with MacPorts, exclusively, this  
would have been much easier, though you would have to wait for someone  
to make the portfile, and for it to be approved, unless you want to  
follow previous steps to set up a local repo.  Doing so takes about 5  
minutes, which is a lot shorter than what you are putting into it now :)

> (2)
> You see that I decided to install the MODULAR version, which relies on
>, which module can be used by other perl scripts.
> QUESTION 2: I know NOTHING about perl.  Can MacPorts handl perl stuff?
> Does it then properly modify the @INC variable?

MacPorts has had a lot of discussion about perl in the past, most of  
which is over my head.  I can say, that I have installed and used  
software that relies on perl modules that rely on a chain of perl  
modules that is very deep.  I was making the portfile, so it was a  
little different, but the end result for an end user is a one command  
install that just works.

> (3)
> I had a really, really sick time trying to get the GUI version of
> URLtoys to work.  It needs the following things:

Where do you get this GUI version?  I am guessing, this just inspires  
some window manager or something?

> * Tk for Perl (only if you want the GUI downloader)
> * LWP::TkIO (only if you want the GUI downloader)
> First, I did:
> $ perl -MCPAN -e 'install "WWW::URLToys"'
> see:

As far as I know, the port file at the above trac listing should work  
to get that far.  You need to set up the local repo part, then just run:
sudo port -d install p5-www-toys

> Then I got LWP::TkIO and did the "perl routine" on it:
> [perl routine =
> $ perl Makefile.PL
> $ make
> $ make test
> $ make install]
> see:

This also seems to be in MacPorts.  Is urltoys dependent on this?  The  
docs do not seem to state so.  If it is, the portfile above should be  
modified to include it.

MacPorts seems to have it
p5-tk @804.028 (perl)
     p5-tk is a Perl interface to Tk

> Then I moved the urltoysw file (notice the final `w': this is the GUI
> script; the regular one is plain `URLtoys') to /opt/local/bin, did
> chmod + x, and ran it.

CPAN does not have a "w" version
Can you elaborate?

I do not think you should manually move files in and out of /opt/local  
unless you specifically know how those will interact.  Moving apache  
http files in and out, yes, fine, but in this case, not sure it would  
work.  At the least, the files will not be registered with MacPorts.

> OH NO!  ERROR: "Can't locate in @INC ..."
> Then:
> $ sudo port install tk

I believe the correct command is to use p5-tk, as seen above, so I  
tested with:
sudo port -d install p5-tk
-d enabled debugging lines to show on the screen, which can give you  
hints on how to solve problems.

Try `man port` as well as read up on `port search` to help you find  
things. All perl modules will start with "p5-"

> This didn’t work.  So I tried:
> $ perl -MCPAN -e 'install "Tk"'
> Then I did:
> $ perl Makefile.PL
> $ make
> $ make test
> $ make install

I may be stepping out on a limb here, but the idea of using MacPorts  
for perl modules is to never have to use CPAN again. At least, that is  
how I look at it. I do not trust Apple to not nuke my installations,  
CPAN is going to drop the builds into pretty standard places, the  
chances of those files getting nuked are too high for my comfort levels.

> Then I tried running URLtoysw again.  Same error.

Can you explain "running", as I do not understand, so I can not try to  
replicate it on my end.

> Then I dug in one of the tk archives, found LWP::TkIO, and placed it
> EVERYWHERE it might be of help.

$port info p5-lwp-tkio
Error: Port p5-lwp-tkio not found

If you absolutely need this, it looks like MacPorts does not have it,  
and will need it, though it should not be hard to add in as well.  Is  
the non "w" version of urltoys dependent on this as well?

Also, there my be a chance it is part of p5-tk. I should know soon  

> Then I tried running URLtoysw again.  Same error.

Just poking around, I downloaded the "w" file from here:

Opened it and edited the first line to

I ran `chmod +x` on the file, and then ran:
to run the file.

I get an error of
Can't locate in @INC

However, as I was writing this, I was also running:
sudo port -d install p5-tk
This install takes ages, I guess there is a ton of xorg stuff that it  
pulls in.

I had also already installed the portfile referenced in the ticket at  
the top of this email.

I have to run out, and the install is not done yet.  Setting this  
laptop to not go to sleep, and I will report back when I get home in a  

> I did this for 9 (NINE) hours.

At some point, you may have wanted to stop, and come back here and  
start asking shorter and more specific questions.  I think it may take  
longer in time, but use less of your time :)
Scott * If you contact me off list replace talklists@ with scott@ *

More information about the macports-users mailing list