Ticket #17090: apr-universal.2.patch

File apr-universal.2.patch, 6.1 KB (added by mtalexander (Mike Alexander), 15 years ago)

Patch to use muniversal to build 32/64 universal versions of apr and apr-util

  • dports/_resources/port1.0/group/muniversal-1.0.tcl

     
    3434
    3535# User variables:
    3636#         merger_configure_env: associative array of configure.env variables
     37#             merger_build_env: assoicative array of build.env variables
    3738#                  merger_host: associative array of host values
    3839#        merger_configure_args: associative array of configure.args
    3940#    merger_configure_cppflags: associative array of configure.cppflags
     
    177178    build {
    178179        foreach arch ${universal_archs_to_use} {
    179180            ui_msg "universal: Running build for architecture ${arch}"
     181           
     182            if { [info exists merger_build_env(${arch})] } {
     183                build.env-append  $merger_build_env(${arch})
     184            }
    180185            build.dir  ${workpath}/${arch}
    181186            build_main
     187            if { [info exists merger_build_env(${arch})] } {
     188                build.env-delete  $merger_build_env(${arch})
     189            }
    182190        }
    183191    }
    184192
     
    243251                        # Files are neither directories nor links
    244252                        if { ! [catch {system "/usr/bin/cmp ${dir1}/${fl} ${dir2}/${fl} && /bin/cp -v ${dir1}/${fl} ${dir}"}] } {
    245253                            # Files are byte by byte the same
    246                             ui_debug "universal: merge: ${prefixDir}${fl} is identical in ${base1} and ${base2}"
     254                            ui_debug "universal: merge: ${prefixDir}/${fl} is identical in ${base1} and ${base2}"
    247255                        } else {
    248256                            # Actually try to merge the files
    249257                            # First try lipo
  • dports/devel/apr-util/Portfile

     
    11# $Id$
    22
    33PortSystem 1.0
     4PortGroup  muniversal 1.0
    45
    56name            apr-util
    67version         1.3.4
     
    2930                --with-iconv=${prefix} --with-berkeley-db=${prefix}/include:${prefix}/lib/db46 \
    3031                --without-mysql --without-pgsql --with-sqlite3=${prefix}
    3132
     33array set merger_configure_env {
     34    ppc     TARGET_ARCH=ppc
     35    i386    TARGET_ARCH=i386
     36    ppc64   TARGET_ARCH=ppc64
     37    x86_64  TARGET_ARCH=x86_64
     38}
     39
     40array set merger_build_env {
     41    ppc     TARGET_ARCH=ppc
     42    i386    TARGET_ARCH=i386
     43    ppc64   TARGET_ARCH=ppc64
     44    x86_64  TARGET_ARCH=x86_64
     45}
     46
    3247test.run        yes
    3348test.target     check
    3449test.env        DYLD_LIBRARY_PATH=${worksrcpath}/.libs
  • dports/devel/apr/Portfile

     
    11# $Id$
    22
    33PortSystem      1.0
     4PortGroup  muniversal 1.0
    45
    56name            apr
    67version         1.3.3
     
    3435        use_parallel_build      no
    3536}
    3637
     38# configure script expects to be able to run binaries
     39if { ${os.arch}=="i386" } {
     40    set universal_archs_supported  "i386 x86_64"
     41} else {
     42    set universal_archs_supported  "ppc ppc64"
     43}
     44
     45set merger_dont_diff "${prefix}/bin/apr-1-config \
     46    ${prefix}/share/apr-1/build/apr_rules.mk
     47    ${prefix}/share/apr-1/build/libtool"
     48         
     49
     50set diff_format_shell_ppc {--old-group-format='if test "x$TARGET_ARCH" != "xppc64"; then
     51%<fi
     52' --new-group-format='if test "x$TARGET_ARCH" = "xppc64"; then
     53%>fi
     54' --unchanged-group-format='%=' --changed-group-format='if test "x$TARGET_ARCH" = "xppc64"; then
     55%>else
     56%<fi
     57'}
     58
     59set diff_format_make_ppc {--old-group-format='ifneq ($(TARGET_ARCH), ppc64)
     60%<endif
     61' --new-group-format='ifeq ($(TARGET_ARCH), ppc64)
     62%>endif
     63' --unchanged-group-format='%=' --changed-group-format='ifeq ($(TARGET_ARCH), ppc64)
     64%>else
     65%<endif
     66'}
     67
     68set diff_format_shell_intel {--old-group-format='if test "x$TARGET_ARCH" != "xx86_64"; then
     69%<fi
     70' --new-group-format='if test "x$TARGET_ARCH" = "xx86_64"; then
     71%>fi
     72' --unchanged-group-format='%=' --changed-group-format='if test "x$TARGET_ARCH" = "xx86_64"; then
     73%>else
     74%<fi
     75'}
     76
     77set diff_format_make_intel {--old-group-format='ifneq ($(TARGET_ARCH), x86_64)
     78%<endif
     79' --new-group-format='ifeq ($(TARGET_ARCH), x86_64)
     80%>endif
     81' --unchanged-group-format='%=' --changed-group-format='ifeq ($(TARGET_ARCH), x86_64)
     82%>else
     83%<endif
     84'}
     85
     86post-destroot {
     87    if {[variant_isset universal]} {
     88        foreach fl ${merger_dont_diff} {
     89            set fl [subst ${fl}]
     90            if { ${os.arch}=="i386" } {
     91                set fl64 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/x86_64-\1}]]
     92                set fl32 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/i386-\1}]]
     93                if { [file exists ${fl32}] && [file exists ${fl64}] } {
     94                    if { [string match {*.mk} ${fl}] } {
     95                        system "/usr/bin/diff -d ${diff_format_make_intel} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     96                    } else {
     97                        system "/usr/bin/diff -d ${diff_format_shell_intel} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     98                    }
     99                }
     100            } else {
     101                set fl64 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/ppc64-\1}]]
     102                set fl32 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/ppc-\1}]]
     103                if { [file exists ${fl32}] && [file exists ${fl64}] } {
     104                    if { [string match {*.mk} ${fl}] } {
     105                        system "/usr/bin/diff -d ${diff_format_make_ppc} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     106                    } else {
     107                        system "/usr/bin/diff -d ${diff_format_shell_ppc} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     108                    }
     109                }
     110            }
     111        }
     112    }
     113}
     114                       
    37115livecheck.check regex
    38116livecheck.url   http://apache.org/dist/apr/
    39117livecheck.regex {<a href="#apr">APR (\d+(?:\.\d+)*) is the latest available version</a>}