Because I get some requests about how to apply the patch ...
Check where you installed macports, that is usually /opt/local/
Locate the Portfile for OpenCV, for me that is at
/opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/opencv
now apply the third patch (Portfile-sl_64bit_21014.diff)
by executing
sudo patch Portfile -i ~/Downloads/Portfile-sl_64bit_21014.diff
in the above directory (adjust the last path accordingly to your download
location)
When you execute port variants opencv you should see the sl_64bit_21014
variant. Now install opencv with
sudo port install opencv +sl_64bit_21014
{{{
$ port deps opencv
Full Name: opencv @1.0.0
Library Dependencies: gtk2, zlib, jpeg, libpng, tiff
$ port variants gtk2 zlib jpeg libpng tiff
gtk2 has the variants:
darwin_7: Platform variant, selected automatically
darwin_8: Platform variant, selected automatically
no_x11: Disable support for X11
quartz: Enable Quartz rendering
* conflicts with x11
* requires no_x11
universal: Build for multiple architectures
[+]x11: Enable rendering in X11 (default)
* conflicts with quartz
zlib has the variants:
universal: Build for multiple architectures
jpeg has the variants:
universal: Build for multiple architectures
libpng has the variants:
universal: Build for multiple architectures
tiff has the variants:
macosx: Platform variant, selected automatically
universal: Build for multiple architectures
}}}
Building OpenCV's dependencies as universal variants succeeds.
When "build_arch" is commented out in macports.conf, the one command "
sudo port upgrade --enforce-variants atk +universal
sudo port upgrade --enforce-variants cairo +universal
sudo port upgrade --enforce-variants jasper +universal
sudo port upgrade --enforce-variants pango +universal
sudo port upgrade --enforce-variants tiff +universal
port install gtk2 +universal
" succeeds, and installs all of OpenCV's
dependencies.