Ticket #17090: apr-universal.patch

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

This is a revised version of my previous patch that fixes some problems

  • 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# Don't append "-m32" or "-m64" to compiler command itself (only to the args) or libtool
     50# won't work.
     51set merger_arch_compiler "no"
     52
     53set diff_format_shell_ppc {--old-group-format='if test "x$TARGET_ARCH" != "xppc64"; then
     54%<fi
     55' --new-group-format='if test "x$TARGET_ARCH" = "xppc64"; then
     56%>fi
     57' --unchanged-group-format='%=' --changed-group-format='if test "x$TARGET_ARCH" = "xppc64"; then
     58%>else
     59%<fi
     60'}
     61
     62set diff_format_make_ppc {--old-group-format='ifneq ($(TARGET_ARCH), ppc64)
     63%<endif
     64' --new-group-format='ifeq ($(TARGET_ARCH), ppc64)
     65%>endif
     66' --unchanged-group-format='%=' --changed-group-format='ifeq ($(TARGET_ARCH), ppc64)
     67%>else
     68%<endif
     69'}
     70
     71set diff_format_shell_intel {--old-group-format='if test "x$TARGET_ARCH" != "xx86_64"; then
     72%<fi
     73' --new-group-format='if test "x$TARGET_ARCH" = "xx86_64"; then
     74%>fi
     75' --unchanged-group-format='%=' --changed-group-format='if test "x$TARGET_ARCH" = "xx86_64"; then
     76%>else
     77%<fi
     78'}
     79
     80set diff_format_make_intel {--old-group-format='ifneq ($(TARGET_ARCH), x86_64)
     81%<endif
     82' --new-group-format='ifeq ($(TARGET_ARCH), x86_64)
     83%>endif
     84' --unchanged-group-format='%=' --changed-group-format='ifeq ($(TARGET_ARCH), x86_64)
     85%>else
     86%<endif
     87'}
     88
     89post-destroot {
     90    if {[variant_isset universal]} {
     91        foreach fl ${merger_dont_diff} {
     92            set fl [subst ${fl}]
     93            if { ${os.arch}=="i386" } {
     94                set fl64 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/x86_64-\1}]]
     95                set fl32 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/i386-\1}]]
     96                if { [file exists ${destroot}${fl32}] && [file exists ${destroot}${fl64}] } {
     97                    if { [string match {*.mk} ${fl}] } {
     98                        system "/usr/bin/diff -d ${diff_format_make_intel} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     99                    } else {
     100                        system "/usr/bin/diff -d ${diff_format_shell_intel} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     101                        system "/bin/chmod a+x ${destroot}${fl}"
     102                    }
     103                }
     104            } else {
     105                set fl64 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/ppc64-\1}]]
     106                set fl32 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/ppc-\1}]]
     107                ui_debug "fl64: $fl64, fl32: $fl32"
     108                if { [file exists ${destroot}${fl32}] && [file exists ${destroot}${fl64}] } {
     109                    if { [string match {*.mk} ${fl}] } {
     110                        system "/usr/bin/diff -d ${diff_format_make_ppc} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     111                    } else {
     112                        system "/usr/bin/diff -d ${diff_format_shell_ppc} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     113                        system "/bin/chmod a+x ${destroot}${fl}"
     114                    }
     115                }
     116            }
     117        }
     118    }
     119}
     120                       
    37121livecheck.check regex
    38122livecheck.url   http://apache.org/dist/apr/
    39123livecheck.regex {<a href="#apr">APR (\d+(?:\.\d+)*) is the latest available version</a>}
  • 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
     
    3651        use_parallel_build      no
    3752}
    3853
     54# No cross architecture universal binaries
     55if { ${os.arch}=="i386" } {
     56    set universal_archs_supported  "i386 x86_64"
     57} else {
     58    set universal_archs_supported  "ppc ppc64"
     59}
    3960
     61set merger_dont_diff "${prefix}/bin/apu-1-config"
     62         
     63
     64set diff_format_shell_ppc {--old-group-format='if test "x$TARGET_ARCH" != "xppc64"; then
     65%<fi
     66' --new-group-format='if test "x$TARGET_ARCH" = "xppc64"; then
     67%>fi
     68' --unchanged-group-format='%=' --changed-group-format='if test "x$TARGET_ARCH" = "xppc64"; then
     69%>else
     70%<fi
     71'}
     72
     73set diff_format_make_ppc {--old-group-format='ifneq ($(TARGET_ARCH), ppc64)
     74%<endif
     75' --new-group-format='ifeq ($(TARGET_ARCH), ppc64)
     76%>endif
     77' --unchanged-group-format='%=' --changed-group-format='ifeq ($(TARGET_ARCH), ppc64)
     78%>else
     79%<endif
     80'}
     81
     82set diff_format_shell_intel {--old-group-format='if test "x$TARGET_ARCH" != "xx86_64"; then
     83%<fi
     84' --new-group-format='if test "x$TARGET_ARCH" = "xx86_64"; then
     85%>fi
     86' --unchanged-group-format='%=' --changed-group-format='if test "x$TARGET_ARCH" = "xx86_64"; then
     87%>else
     88%<fi
     89'}
     90
     91set diff_format_make_intel {--old-group-format='ifneq ($(TARGET_ARCH), x86_64)
     92%<endif
     93' --new-group-format='ifeq ($(TARGET_ARCH), x86_64)
     94%>endif
     95' --unchanged-group-format='%=' --changed-group-format='ifeq ($(TARGET_ARCH), x86_64)
     96%>else
     97%<endif
     98'}
     99
     100post-destroot {
     101    if {[variant_isset universal]} {
     102        foreach fl ${merger_dont_diff} {
     103            set fl [subst ${fl}]
     104            if { ${os.arch}=="i386" } {
     105                set fl64 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/x86_64-\1}]]
     106                set fl32 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/i386-\1}]]
     107                if { [file exists ${destroot}${fl32}] && [file exists ${destroot}${fl64}] } {
     108                    if { [string match {*.mk} ${fl}] } {
     109                        system "/usr/bin/diff -d ${diff_format_make_intel} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     110                    } else {
     111                        system "/usr/bin/diff -d ${diff_format_shell_intel} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     112                        system "/bin/chmod a+x ${destroot}${fl}"
     113                    }
     114                }
     115            } else {
     116                set fl64 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/ppc64-\1}]]
     117                set fl32 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/ppc-\1}]]
     118                ui_debug "fl64: $fl64, fl32: $fl32"
     119                if { [file exists ${destroot}${fl32}] && [file exists ${destroot}${fl64}] } {
     120                    if { [string match {*.mk} ${fl}] } {
     121                        system "/usr/bin/diff -d ${diff_format_make_ppc} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     122                    } else {
     123                        system "/usr/bin/diff -d ${diff_format_shell_ppc} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
     124                        system "/bin/chmod a+x ${destroot}${fl}"
     125                    }
     126                }
     127            }
     128        }
     129    }
     130}
     131                       
     132
     133
    40134variant no_bdb  description {Build without BerkeleyDB support} {
    41135                        depends_lib-delete port:db46
    42136                        configure.args-delete --with-berkeley-db=${prefix}/include:${prefix}/lib/db46