Macports and CPAN

Scott Haneda talklists at
Thu Sep 10 12:26:32 PDT 2009

On Sep 10, 2009, at 9:20 AM, Chris Janton wrote:

> Macports 1.8 - Snow Leopard
> I have old PERL programs that use
> Astro::Coord::ECI::Utils

I do not see a port for this.  I believe the suggested method is to  
open a ticket asking for it, or to make one yourself. I know very  
little about this, and have managed to put out many perl ports, most  
of which are not too bad.

> I cannot find an equivalent p5-xyz port to install.

I am not sure if you are asking if there is a "xys" port, or if you  
were just being generic in stating you can not find many p5's that you  

> If I attempt to install it using /opt/local/bin/cpan I get the  
> following
> cpan[4]> install Astro::Coord::ECI::Utils
> Running install for module 'Astro::Coord::ECI::Utils'

[snip...errors output by MacPorts ]	

> 	CPAN::shell() called at /opt/local/bin/cpan line 198
> If I run /usr/bin/cpan and install Astro::Coord::ECI::Utils it  
> works, and is now available to /usr/bin/perl
> I would much rather keep my PERLs clean, using "/usr/bin/env perl"  
> but that gets me in trouble.

This from what I understand, goes against the philosophy of how  
MacPorts works.  You really do not want to mix and match.  Either use  
perl and cpan outside of MacPorts, or use it exclusively inside of  

> any hints, suggestions, workarounds (besides simply using #!/usr/bin/ 
> perl for that particular application)

I am going to try to make this port for you.
First you will need to set up your own local repo as per this doc:

It looks like you need 'Astro-satpass', which contains the util that  
you desire.
$cd ~/macports/perl
$cp -R p5-www-urltoys p5-astro-satpass
$cd p5-astro-satpass
$port edit

All I do is change to my MacPorts working directory, you can put yours  
whereever you like and call it as you like.  I copy an old p5 I made,  
and open the Portfile and edit it

Modified the file to these changes:
PortSystem               1.0
PortGroup                perl5 1.0

perl5.setup              Astro-satpass 0.025

description              Astro-satpass - Predict satellite passes over  
an observer.

long_description         This package contains classes needed to  
predict \
                          satellite visibility, and a demonstration  
application \
                          (satpass) that makes use of these classes.

checksums                md5     36cc8cd5a525e9a027e6bdd25eb67fdb \
e970596e594bae96ef1d7cabf6d8aa071250e3f5 \

platforms               darwin

$sudo port install
* Since I am in the directory of the PortFile, I need not call it by  

That gives me an error of course, as I do not have the checksums, so I  
copy and paste them in.

$sudo port -d install

I should also run portindex to update the index to know about this port.
$cd ~/macports/
Creating software index in /Users/me/macports
Adding port perl/p5-astro-satpass
[snip... Shows output for all my local ports as well]	

Check that it all made it:
$port info p5-astro-satpass
p5-astro-satpass @0.025 (perl)
Variants:    universal

This package contains classes needed to predict satellite visibility,  
and a demonstration application (satpass) that
makes use of these classes.

Library Dependencies: perl5
Platforms:            darwin
Maintainers:          ***

Check that is is installed:
$port installed | grep satpass
   p5-astro-satpass @0.025_0 (active)

Make a test:
	use Astro::Coord::ECI::Utils qw{:all};
	my $now = time ();
	print "The current Julian day is ", julianday ($now);

Run the test:
The current Julian day is 2455085.30760417

I will submit this port to MacPorts, however, you should have what you  
need here, to make it work now, as that submission will require  
approval, and I no doubt have made an error somewhere, as is almost  
always the case :)

Scott * If you contact me off list replace talklists@ with scott@ *

More information about the macports-users mailing list