6

I am trying to install p5-app-ack port from Mac Ports, but it seems it doesn't create a /opt/local/bin/ack binary at the end:

$ sudo port search *app-ack
Password:
p5-app-ack @1.960.0 (perl)
    A grep replacement that ignores .svn/CVS/blib directories

p5.8-app-ack @1.960.0 (perl)
    A grep replacement that ignores .svn/CVS/blib directories

p5.10-app-ack @1.960.0 (perl)
    A grep replacement that ignores .svn/CVS/blib directories

p5.12-app-ack @1.960.0 (perl)
    A grep replacement that ignores .svn/CVS/blib directories

p5.14-app-ack @1.960.0 (perl)
    A grep replacement that ignores .svn/CVS/blib directories

p5.16-app-ack @1.960.0 (perl)
    A grep replacement that ignores .svn/CVS/blib directories

Found 6 ports.
$ perl --version

This is perl 5, version 12, subversion 4 (v5.12.4) built for darwin-thread-multi-2level

Copyright 1987-2010, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

$ sudo port install p5-app-ack
--->  Computing dependencies for p5-app-ack
--->  Cleaning p5-app-ack
--->  Updating database of binaries: 100.0%
--->  Scanning binaries for linking errors: 35.0%
--->  No broken files found.
$


$ ls /opt/local/bin/ac* 
/opt/local/bin/ack-5.12         /opt/local/bin/aclocal          /opt/local/bin/aclocal-1.12     /opt/local/bin/activation-client    /opt/local/bin/acyclic
$ which ack
$ ack
-bash: ack: command not found

Update

If I then try to install p5.12-app-ack afterwards, I get

$ sudo port install p5.12-app-ack
Password:
--->  Computing dependencies for p5.12-app-ack
--->  Cleaning p5.12-app-ack
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.
$

Update: cpan also does not work

$ack
-bash: ack: command not found
$sudo port p5-app-ack
Password:
Error: Unrecognized action "port p5-app-ack"
$sudo port installed p5-app-ack
The following ports are currently installed:
  p5-app-ack @1.960.0_1 (active)
$sudo cpan App::Ack
Reading '/Users/foobar/.cpan/Metadata'
  Database was generated on Sun, 18 Dec 2011 20:10:30 GMT
Fetching with Net::FTP:
ftp://cpan.mirror.cdnetworks.com/CPAN/authors/01mailrc.txt.gz
Reading '/Users/foobar/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with Net::FTP:
ftp://cpan.mirror.cdnetworks.com/CPAN/modules/02packages.details.txt.gz
Reading '/Users/foobar/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Sat, 15 Dec 2012 21:19:04 GMT
  HTTP::Date not available
............................................................................DONE
Fetching with Net::FTP:
ftp://cpan.mirror.cdnetworks.com/CPAN/modules/03modlist.data.gz
Reading '/Users/foobar/.cpan/sources/modules/03modlist.data.gz'
............................................................................DONE
Writing /Users/foobar/.cpan/Metadata
Running install for module 'App::Ack'
Running make for P/PE/PETDANCE/ack-1.96.tar.gz
Fetching with Net::FTP:
ftp://cpan.mirror.cdnetworks.com/CPAN/authors/id/P/PE/PETDANCE/ack-1.96.tar.gz
Fetching with Net::FTP:
ftp://cpan.mirror.cdnetworks.com/CPAN/authors/id/P/PE/PETDANCE/CHECKSUMS
Checksum for /Users/foobar/.cpan/sources/authors/id/P/PE/PETDANCE/ack-1.96.tar.gz ok

  CPAN.pm: Building P/PE/PETDANCE/ack-1.96.tar.gz

Checking if your kit is complete...
Looks good
Warning: prerequisite File::Next 0.4 not found.
No documentation found for "File::Next".
Writing Makefile for ack
Writing MYMETA.yml and MYMETA.json
---- Unsatisfied dependencies detected during ----
----         PETDANCE/ack-1.96.tar.gz         ----
    File::Next [requires]
Running make test
  Delayed until after prerequisites
Running make install
  Delayed until after prerequisites
Running install for module 'File::Next'
Running make for P/PE/PETDANCE/File-Next-1.10.tar.gz
Fetching with Net::FTP:
ftp://cpan.mirror.cdnetworks.com/CPAN/authors/id/P/PE/PETDANCE/File-Next-1.10.tar.gz
Checksum for /Users/foobar/.cpan/sources/authors/id/P/PE/PETDANCE/File-Next-1.10.tar.gz ok

  CPAN.pm: Building P/PE/PETDANCE/File-Next-1.10.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for File::Next
Writing MYMETA.yml and MYMETA.json
cp Next.pm blib/lib/File/Next.pm
Manifying blib/man3/File::Next.3pm
  PETDANCE/File-Next-1.10.tar.gz
  /usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
PERL_DL_NONLAZY=1 /opt/local/bin/perl5.16 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t ....... # Testing File::Next 1.10, Perl 5.016001, /opt/local/bin/perl5.16
t/00-load.t ....... ok   
t/api.t ........... ok     
t/basic.t ......... ok     
t/dirs.t .......... ok   
t/dot.t ........... ok   
t/everything.t .... ok   
t/follow.t ........ ok   
t/from_file.t ..... ok     
t/from_stdin.t .... ok   
t/methods.t ....... ok   
t/named-pipe.t .... ok   
t/parms.t ......... ok     
t/pod-coverage.t .. skipped: Test::Pod::Coverage 1.04 required for testing POD
t/pod.t ........... skipped: Test::Pod 1.14 required for testing POD
t/sort.t .......... ok   
t/zero.t .......... ok   
All tests successful.
Files=16, Tests=82,  1 wallclock secs ( 0.11 usr  0.07 sys +  0.59 cusr  0.15 csys =  0.92 CPU)
Result: PASS
  PETDANCE/File-Next-1.10.tar.gz
  /usr/bin/make test -- OK
Running make install
Installing /opt/local/lib/perl5/site_perl/5.16.1/File/Next.pm
Installing /opt/local/share/perl5.16/siteman/man3/File::Next.3pm
Appending installation info to /opt/local/lib/perl5/5.16.1/darwin-thread-multi-2level/perllocal.pod
  PETDANCE/File-Next-1.10.tar.gz
  /usr/bin/make install  -- OK
Running make for P/PE/PETDANCE/ack-1.96.tar.gz
  Has already been unwrapped into directory /Users/foobar/.cpan/build/ack-1.96-wJTiPB

  CPAN.pm: Building P/PE/PETDANCE/ack-1.96.tar.gz

cp Ack.pm blib/lib/App/Ack.pm
cp Repository.pm blib/lib/App/Ack/Repository.pm
cp Plugin.pm blib/lib/App/Ack/Plugin.pm
cp Resource.pm blib/lib/App/Ack/Resource.pm
cp Basic.pm blib/lib/App/Ack/Plugin/Basic.pm
/opt/local/bin/perl5.16 squash ack-base File::Next Ack.pm Repository.pm Resource.pm Basic.pm > ack
Reading ack-base
Reading /opt/local/lib/perl5/site_perl/5.16.1/File/Next.pm
Reading Ack.pm
Reading Repository.pm
Reading Resource.pm
Reading Basic.pm
chmod 0755 ack
/opt/local/bin/perl5.16 -T -c ack
ack syntax OK
/opt/local/bin/perl5.16 -T ack --noenv --help > ack-help.txt || perl -e0
/opt/local/bin/perl5.16 -T ack --noenv --help=types > ack-help-types.txt || perl -e0
/opt/local/bin/perl5.16 -T ack --noenv --help=dirs > ack-help-dirs.txt || perl -e0
cp ack blib/script/ack
/opt/local/bin/perl5.16 -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/ack
Manifying blib/man1/ack.1pm
  PETDANCE/ack-1.96.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /opt/local/bin/perl5.16 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t ............... 1/4 # Testing App::Ack 1.96, File::Next 1.10, Perl 5.016001, /opt/local/bin/perl5.16
t/00-load.t ............... ok   
t/ack-1.t ................. ok     
t/ack-a.t ................. ok   
t/ack-binary.t ............ ok   
t/ack-c.t ................. ok     
t/ack-color.t ............. ok     
t/ack-column.t ............ ok   
t/ack-env.t ............... ok     
t/ack-g.t ................. ok     
t/ack-group.t ............. ok     
t/ack-h.t ................. ok     
t/ack-ignore-dir.t ........ ok     
t/ack-line.t .............. ok     
t/ack-match.t ............. ok     
t/ack-o.t ................. ok   
t/ack-passthru.t .......... ok   
t/ack-print0.t ............ ok     
t/ack-text.t .............. ok   
t/ack-type.t .............. ok     
t/ack-u.t ................. ok     
t/ack-v.t ................. ok   
t/ack-w.t ................. ok   
t/code.t .................. ok     
t/command-line-files.t .... ok   
t/context.t ............... ok     
t/encoding.t .............. ok   
t/file-permission.t ....... skipped: Can't be run as root
t/filetypes.t ............. ok     
t/illegal-regex.t ......... ok     
t/incomplete-last-line.t .. ok   
t/interesting.t ........... ok   
t/longopts.t .............. ok     
t/module.t ................ ok     
t/multiline.t ............. ok   
t/pod.t ................... skipped: Test::Pod 1.14 required for testing POD
t/rc.t .................... ok   
t/standalone.t ............ ok   
t/tar.t ................... skipped: Testing the uncompleted feature of acking through a tar file.
t/zero.t .................. ok   
All tests successful.
Files=39, Tests=585, 20 wallclock secs ( 0.29 usr  0.13 sys + 13.47 cusr  2.57 csys = 16.46 CPU)
Result: PASS
  PETDANCE/ack-1.96.tar.gz
  /usr/bin/make test -- OK
Running make install
Manifying blib/man1/ack.1pm
Installing /opt/local/lib/perl5/site_perl/5.16.1/App/Ack.pm
Installing /opt/local/lib/perl5/site_perl/5.16.1/App/Ack/Plugin.pm
Installing /opt/local/lib/perl5/site_perl/5.16.1/App/Ack/Repository.pm
Installing /opt/local/lib/perl5/site_perl/5.16.1/App/Ack/Resource.pm
Installing /opt/local/lib/perl5/site_perl/5.16.1/App/Ack/Plugin/Basic.pm
Installing /opt/local/share/perl5.16/siteman/man1/ack.1pm
Installing /opt/local/libexec/perl5.16/sitebin/ack
Appending installation info to /opt/local/lib/perl5/5.16.1/darwin-thread-multi-2level/perllocal.pod
  PETDANCE/ack-1.96.tar.gz
  /usr/bin/make install  -- OK
$ which ack
4
  • What happens if you try to install p5.12-app-ack directly (although it appears that it is already in /opt/local/bin)?
    – lupincho
    Commented Oct 13, 2012 at 19:31
  • @lupincho I added what happend to the OP.
    – qazwsx
    Commented Oct 13, 2012 at 23:42
  • I am not sure what is causing the issue with p5-app-ack, but a possible workaround so that you could use ack could be to create a link, /opt/local/bin/ack pointing to /opt/local/bin/ack-5.12 that you seem to already have. I don't have ack installed, but looking at my /opt/local/bin, quite a few things are actually links to something.5-12 (e.g. lrwxr-xr-x ... a2p -> a2p-5.12). That should work assuming that ack-5.12 is installed correctly and works fine.
    – lupincho
    Commented Oct 14, 2012 at 7:03
  • Doing this pollutes your system in some sense as one would need to remember what and where to update the symbolic links when updates are available, and manually do that.
    – qazwsx
    Commented Nov 28, 2012 at 3:42

2 Answers 2

6

You can try:

sudo cpan App::Ack

It installs ack and configures the binary in /opt/local/bin/ack with the default perl environment on your machine. After installing, you can just run "ack pattern" and you are good to go.

4
  • It doesn't fix the issue. See edit in OP.
    – qazwsx
    Commented Dec 16, 2012 at 1:04
  • Are you sure? You just made me to re-install ack and confirm this. cpan installed ack and configured the binaries (and path) for me. I was able to go from install to running ack in one step.
    – Kata
    Commented Dec 16, 2012 at 15:42
  • When i did sudo cpan App::Ack, at the end if i do which ack, it doesn't find anything.
    – qazwsx
    Commented Dec 16, 2012 at 16:25
  • One caveat: follow the CPAN results closely to see where the module ended up. Mine ended up at /opt/local/libexec/perl5.12/sitebin/ack for some reason, and I had to ln it to /opt/local/bin Commented Jul 22, 2014 at 17:22
4

The package p5-app-ack ist a stub package, that installs a package containing the real executable matching your installed perl version.

shiny:~ fl$ port deps p5-app-ack
Full Name: p5-app-ack @1.960.0_1
Library Dependencies: p5.12-app-ack

As you have perl5.12 installed, you will find the stub package and the package containing the binary:

shiny:~ fl$ port list p5*-app-ack
p5-app-ack                     @1.960.0        perl/p5-app-ack
p5.12-app-ack                  @1.960.0        perl/p5-app-ack

and the program will be installed to match the Perl environment:

shiny:~ fl$ port contents p5.12-app-ack
Port p5.12-app-ack contains:
  /opt/local/bin/ack-5.12
  /opt/local/lib/perl5/vendor_perl/5.12.4/App/Ack.pm
  /opt/local/lib/perl5/vendor_perl/5.12.4/App/Ack/Plugin.pm
  /opt/local/lib/perl5/vendor_perl/5.12.4/App/Ack/Plugin/Basic.pm
  /opt/local/lib/perl5/vendor_perl/5.12.4/App/Ack/Repository.pm
  /opt/local/lib/perl5/vendor_perl/5.12.4/App/Ack/Resource.pm
  /opt/local/lib/perl5/vendor_perl/5.12.4/darwin-thread-multi-2level/auto/ack/.packlist
  /opt/local/libexec/perl5.12/ack
  /opt/local/share/perl5.12/man/man1/ack.1pm

You could either add /opt/local/libexec/perl5.12 to your $PATH, or create a symlink to the program /opt/local/libexec/perl5.12/ack somewhere in your $PATH

2
  • This fixes the symptom not the cause. Thanks.
    – qazwsx
    Commented Nov 28, 2012 at 3:47
  • ah ok. just checked my portfile /opt/local/var/macports/distfiles/perl5/ack-1.96.tar.gz with checksum sha256: bb9d29842d8c5c1ec7ad9b577707aca0e1d278e8e21560dbed76ea3b5aa6cb64 and the symlink comes out all right. Do you build it, or do you install the package? Commented Nov 28, 2012 at 19:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .