Ticket #39786: wxWidgets30-universal.patch

File wxWidgets30-universal.patch, 3.7 KB (added by mojca (Mojca Miklavec), 11 years ago)

A patch that enables universal build of wxWidgets30

  • Portfile

     
    6969                --disable-sdltest \
    7070                --enable-unicode \
    7171                --enable-display \
    72     --enable-xrc
     72                --enable-xrc \
     73                --with-macosx-sdk=no \                                                             
     74                --with-macosx-version-min=no
    7375
    7476build.target
    7577
    7678use_parallel_build  yes
    7779
    7880variant universal {
    79     configure.args-append   --enable-universal_binary \
    80         --with-macosx-sdk=${configure.sdkroot}/ \
    81         --with-macosx-version-min=${macosx_deployment_target}
     81    set archs [join ${configure.universal_archs} ,]
     82    configure.args-append   --enable-universal_binary=${archs}
    8283}
    8384
    8485configure.ccache    no
     
    8889    ln -sf ${confscript} ${destroot}${prefix}/bin/wx-config
    8990}
    9091
    91 post-patch {
    92     reinplace "s|@@MP_ARCH_FLAGS@@|[get_canonical_archflags]|g" ${worksrcpath}/../configure
    93 }
    94 
    9592default_variants    +sdl
    9693
    9794variant monolithic description {build only one library} {
  • files/patch-configure-change_install_names.diff

     
    1 --- configure   2011-10-19 17:36:57.000000000 +0200
    2 +++ configure   2011-10-19 18:01:41.000000000 +0200
    3 @@ -19176,10 +19176,10 @@
    4      fi
    5  
    6      if test "x$wxUSE_UNIVERSAL_BINARY" != xyes; then
    7 -        OSX_ARCH_OPTS=$wxUSE_UNIVERSAL_BINARY
    8 +        OSX_ARCH_OPTS="@@MP_ARCH_FLAGS@@"
    9      else         OSX_ARCH_OPTS="ppc,i386"
    10          if test "$wxUSE_OSX_COCOA" = 1; then
    11 -            OSX_ARCH_OPTS="$OSX_ARCH_OPTS,x86_64"
    12 +            OSX_ARCH_OPTS="@@MP_ARCH_FLAGS@@"
    13          fi
    14      fi
    15  
    16 @@ -19204,8 +19204,6 @@
    17          disable_macosx_deps=yes
    18      fi
    19  
    20 -    OSX_ARCH_OPTS=`echo $OSX_ARCH_OPTS | sed -e 's/^/-arch /' -e 's/,/ -arch /g'`
    21 -
    22      CXXFLAGS="$OSX_ARCH_OPTS $CXXFLAGS"
    23      CFLAGS="$OSX_ARCH_OPTS $CFLAGS"
    24      OBJCXXFLAGS="$OSX_ARCH_OPTS $OBJCXXFLAGS"
    25 @@ -29071,16 +29069,18 @@
     1--- configure.orig
     2+++ configure
     3@@ -29407,16 +29405,18 @@ rm -f core conftest.err conftest.$ac_objext \
    264             DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
    275             cat <<EOF >change-install-names
    286 #!/bin/sh
     
    4725         fi
    4826 
    4927                                         HEADER_PAD_OPTION="-headerpad_max_install_names"
    50 --- configure.in        2011-10-19 17:36:57.000000000 +0200
    51 +++ configure.in        2011-10-19 17:38:38.000000000 +0200
    52 @@ -3847,16 +3847,18 @@
    53              DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
    54              cat <<EOF >change-install-names
    55  #!/bin/sh
    56 -libnames=\`cd \${2} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\`
    57 -for i in \${libnames} ; do
    58 -    ${HOST_PREFIX}install_name_tool -id \${3}/\${i} \${1}/\${i}
    59 -    for dep in \${libnames} ; do
    60 -        ${HOST_PREFIX}install_name_tool -change \${2}/\${dep} \${3}/\${dep} \${1}/\${i}
    61 -    done
    62 +libnames=\`find \$4  -type f -a -regex '.*\.[0-9]+\.dylib' -exec basename '{}' \;\`
    63 +changes=''
    64 +for dep in \$libnames; do
    65 +    changes="\$changes -change \$4/\$dep \$3/\$dep"
    66  done
    67 +for i in \$libnames; do
    68 +    ${HOST_PREFIX}install_name_tool \$changes -id \$3/\$i \$1/\$i
    69 +done
    70 +${HOST_PREFIX}install_name_tool \$changes \$2/wxrc-2.9
    71  EOF
    72              chmod +x change-install-names
    73 -            DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \$(wx_top_builddir)/lib \${libdir}"
    74 +            DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \${DESTDIR}\${bindir} \${libdir} \$(wx_top_builddir)/lib"
    75          fi
    76  
    77          dnl the HEADER_PAD_OPTION is required by some wx samples to avoid the error: