[MacPorts] #23320: fail to install wxWidgets-devel +universal on snow leopard
MacPorts
noreply at macports.org
Wed Nov 3 14:38:43 PDT 2010
#23320: fail to install wxWidgets-devel +universal on snow leopard
-----------------------------------+----------------------------------------
Reporter: klebermagno@… | Owner: jwa@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 1.8.2
Keywords: | Port: wxWidgets-devel
-----------------------------------+----------------------------------------
Comment(by cdavis@…):
All right, I've worked through this, and there are three distinct issues
here:
1. Using dependency options and compiling PCH files
You can't do either of those with multiple arch flags. Even if you remove
the dependency options, when gcc tries to precompile a header into a PCH
given multiple arch flags, it will instead try to compile a regular ol'
program instead. (ld will complain that '_main' is undefined.)
I fixed it locally by the port belong to the muniversal group.
2. OBJCXXFLAGS isn't set
OK, you got past the first problem, and wxWidgets is building just fine.
Suddenly, the build stops with an error message. Looking at the log file
reveals a bunch of 'file is not of the architecture being linked' messages
from ld.
Inspecting the files that were compiled wrong reveals something telling:
They're all Objective-C++ files! For some reason, wx's build system uses
the OBJCXXFLAGS variable instead of the CXXFLAGS variable when compiling
an Objective-C++ file. Since the Portfile didn't set OBJCXXFLAGS, no
Objective-C++ sources get built for the right architecture. I fixed it by
manually playing with the top-level makefile, but the right way to fix
this is to set OBJCXXFLAGS in the Portfile during the configure stage.
3. Symlink merging madness
Finally, you solved problems 1 and 2 and got the build to finish. Because
we put wxWidgets-devel in the muniversal group, now MacPorts will install
the two build trees into two destroots, then merge them together.
Unfortunately, there's one small problem with that: MacPorts doesn't know
how to merge symlink files. Here's a relevant snippet from the log:
{{{
:debug:destroot universal: merge: /opt/local/lib/wx-devel/bin/wx-config
only exists in
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports
.org_release_ports_graphics_wxWidgets-devel/work/destroot-x86_64
:debug:destroot universal: merge: /opt/local/lib/wx-devel/bin/wx-config
only exists in
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports
.org_release_ports_graphics_wxWidgets-devel/work/destroot-i386
}}}
So it knows that both symlinks are there, but it thinks they're distinct.
So, it copies each one over to the merged destroot. Unfortunately, copying
the second one fails because the file already exists:
{{{
:error:destroot Target org.macports.destroot returned: error copying
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports
.org_release_ports_graphics_wxWidgets-
devel/work/destroot-i386//opt/local/lib/wx-devel/bin/wx-config" to
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports
.org_release_ports_graphics_wxWidgets-devel/work/destroot-
intel//opt/local/lib/wx-devel/bin/wx-config": file already exists
}}}
This is as far as I got. One possible solution is to forcibly copy the
symlink over. However, I think the real solution is to teach MacPorts to
recognize and handle symlinks properly when merging two destroots.
--
Ticket URL: <https://trac.macports.org/ticket/23320#comment:9>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list