New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #17633 (closed defect: fixed)

Opened 3 years ago

Last modified 22 months ago

MacPorts port needs to be built from an /opt/local-installed MacPorts

Reported by: blb@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.9.0
Component: base Version: 1.7.0
Keywords: prefix Cc: raimue@…
Port:

Description

Building the MacPorts port with a MacPorts install not using /opt/local as its prefix can cause issues. Overriding prefix in the MacPorts Portfile (either directly or just overriding --prefix in configure.pre_args) doesn't work as MacPorts' configure (via MP_PATH_SCAN) will now ignore /opt/local, not your true MacPorts prefix. Hence it can pick up stuff installed in your true MacPorts install.

This is best demonstrated by installing MacPorts to an alternate path (for this example, /mp), and installing the tcl and curl ports. Now, if you just run the configure phase on the MacPorts port, you'll see

checking for Tcl configuration... found /usr/lib/tclConfig.sh
checking for existence of /usr/lib/tclConfig.sh... loading
checking for Tcl public headers... /usr/include
checking for tclsh... /mp/bin/tclsh
checking for Tcl package directory... /mp/lib/tcl8.5
checking whether tclsh was compiled with threads... yes
checking for curl-config... /mp/bin/curl-config
checking for curl_easy_strerror in -lcurl... no

Note that it now picks up the tcl and curl from your initial MacPorts install because you've overridden what it thinks of as prefix, and hence doesn't ignore the original install's prefix.

For now, the MacPorts Portfile errors out if you try to use a port from anywhere but /opt/local.

Change History

Changed 3 years ago by mmpestorich@…

I was able to get around this by commenting out MP_PATH_SCAN in configure.ac and regenerating the configure files by running regen.sh.

pre-configure {
    reinplace "s|MP_PATH_SCAN|#MP_PATH_SCAN|" ${worksrcpath}/configure.ac
    system "cd ${worksrcpath} && ./regen.sh"
}

I don't know the ramifications of disabling the MP_PATH_SCAN routine, but do know that by enusring my path is set correctly prior to installing the port and disabling that routine allowed the configure script to properly detect the correct tcl and curl installations when installing to a different prefix.

Changed 3 years ago by jmr@…

There were also multiple hardcoded /opt/local references in the preflight script, though that's now reduced to one in InstallationCheck.

Changed 3 years ago by jmr@…

  • milestone changed from MacPorts 1.8.0 to MacPorts 1.8.1

Changed 3 years ago by raimue@…

  • cc raimue@… added

Would configure.env PATH=/bin:/sbin:/usr/bin:/usr/sbin in the MacPorts Portfile be a possible solution?

Changed 2 years ago by blb@…

  • milestone changed from MacPorts 1.8.1 to MacPorts 1.9.0

Changed 22 months ago by jmr@…

  • status changed from new to closed
  • resolution set to fixed

Hardcoded /opt/local removed from dmg resources in r66776, MacPorts port updated in r66777.

Note: See TracTickets for help on using tickets.