py2app error when building opencv app

Issue #72 wontfix
Luc Jean
created an issue

I am trying to build an app using opencv and pygame. These two libs have been installed with macport. I also installed py2app in the macport python.

I am running a simple py2app script

from setuptools import setup

    app = [
            'argv_emulation': True, 

Unfortunately, py2app fails with the following error :"ValueError: New Mach-O header is too large to relocate"

Is it possible to make an app bundle with opencv and macport?

Thanks for your help

Comments (5)

  1. Ronald Oussoren repo owner

    Shared libraries on OSX contain an absolute path to their location, and likewise all used libraries are also mentioned using an absolute path. Py2app uses macholib to rewrite those mentions to relative paths starting with '@executable_path'. For libraries that are located in /opt/local the new path requires more space than the old one, hence the error message.

    One way to ensure that there is enough space is the linker flag "headerpad_max_install_names". I don't know how to tell darwinports to add this flag when building opencv.

  2. Ronald Oussoren repo owner

    I don't know how to get macports to include additional compiler flags during a build.

    A workaround could be to install macports in a deeply nested path (like /opt/workaround-to-get-long-enough-linkpath-for-macports/), but that's both annoying to use and could break other stuff (using alternate installation roots is likely less tested than the regular location)

  3. Log in to comment