Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#13885 closed defect (fixed)

perl5.8 assumes MacPorts is installed in /opt/local; causes failure of p5-xml-parser and probably others when using different MacPorts prefix

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: afb@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: george@…, ryandesign (Ryan Carsten Schmidt)
Port:

Description

George Georgalis reported on macports-users that when MacPorts is installed in a prefix other than /opt/local, p5-xml-parser does not install because it cannot find expat, and I can reproduce this problem:

$ PATH=/bin:/sbin:/usr/bin:/usr/sbin \
./configure \
--enable-readline \
--prefix=/tmp/macports \
--with-tclpackage=/tmp/macports/share/macports/Tcl \
--with-install-user=rschmidt \
--with-install-group=rschmidt
$ make
$ make install
$ sudo mv /opt/local /opt/local-off
Password:

Note that moving an existing MacPorts installation in /opt/local aside is essential to this reproduction recipe. If you don't do so, and your existing install contains expat, the install in the other prefix will succeed.

$ rmdir /tmp/macports/var/macports/distfiles 
$ ln -s /opt/local-off/var/macports/distfiles /tmp/macports/var/macports/distfiles
$ /tmp/macports/bin/port install p5-xml-parser
--->  Fetching expat
--->  Verifying checksum(s) for expat
--->  Extracting expat
--->  Configuring expat
--->  Building expat with target all
--->  Staging expat into destroot
--->  Installing expat 2.0.1_0
--->  Activating expat 2.0.1_0
--->  Cleaning expat
--->  Fetching perl5.8
--->  Verifying checksum(s) for perl5.8
--->  Extracting perl5.8
--->  Applying patches to perl5.8
--->  Configuring perl5.8
--->  Building perl5.8 with target all
--->  Staging perl5.8 into destroot
--->  Installing perl5.8 5.8.8_0+darwin_8
--->  Activating perl5.8 5.8.8_0+darwin_8
--->  Cleaning perl5.8
--->  Fetching p5-xml-parser
--->  Verifying checksum(s) for p5-xml-parser
--->  Extracting p5-xml-parser
--->  Configuring p5-xml-parser
Error: Target org.macports.configure returned: configure failure: shell command " cd "/tmp/macports/var/macports/build/_Users_rschmidt_macports_dports_perl_p5-xml-parser/work/XML-Parser-2.36" && /tmp/macports/bin/perl Makefile.PL INSTALLDIRS=vendor " returned error 2
Command output: Note (probably harmless): No library found for -lexpat

Expat must be installed prior to building XML::Parser and I can't find
it in the standard library directories. You can download expat from:

http://sourceforge.net/projects/expat/

If expat is installed, but in a non-standard directory, then use the
following options to Makefile.PL:

    EXPATLIBPATH=...  To set the directory in which to find libexpat

    EXPATINCPATH=...  To set the directory in which to find expat.h

For example:

    perl Makefile.PL EXPATLIBPATH=/home/me/lib EXPATINCPATH=/home/me/include

Note that if you build against a shareable library in a non-standard location
you may (on some platforms) also have to set your LD_LIBRARY_PATH environment
variable at run time for perl to find the library.


Error: Status 1 encountered during processing.
$

Attachments (1)

perl5.10-Portfile.diff (510 bytes) - added by ryandesign (Ryan Carsten Schmidt) 17 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

I see the file ${prefix}/lib/perl5/5.8.8/darwin-2level/Config_heavy.pl contains these lines:

locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib'

even when ${prefix} is not /opt/local. This would seem to be a bug in the perl5.8 port.

comment:2 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: p5-xml-parser does not install in non-standard MacPorts prefixperl5.8 assumes MacPorts is installed in /opt/local; causes failure of p5-xml-parser and probably others when using different MacPorts prefix

Fixed perl5.8 in r32623. Wait 12 hours, then sudo port selfupdate, then sudo port upgrade perl5.8, then sudo port clean --work p5-xml-parser, and you should be fine.

I wonder if perl5.10 suffers from the same problem?

comment:3 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Owner: changed from ryandesign@… to afb@…

I believe perl5.10 does have the same problem so I'm attaching a patch and assigning this to perl5.10's maintainer.

Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: perl5.10-Portfile.diff added

comment:4 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

perl5.9-devel is probably also affected, so it should either be fixed there as well, or maybe perl5.9-devel should just be deleted, since perl5.10 is out now.

comment:5 Changed 17 years ago by afb@…

Resolution: fixed
Status: newclosed

Fixed, r32636 and r32638.

comment:6 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.