Ticket #43959: patch-icu.diff
File patch-icu.diff, 15.9 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 10 years ago) |
---|
-
Portfile
8 8 set my_name icu4c 9 9 # Don't forget to increase the revision number of the dependents (e.g. boost) 10 10 # whenever the library version number changes. Thanks. 11 version 51.2 12 revision111 # port echo depends:icu finds dependencies 12 version 53.1 13 13 categories devel textproc 14 14 platforms darwin freebsd 15 15 license MIT … … 28 28 distname ${my_name}-[join [split ${version} .] _] 29 29 extract.suffix .tgz 30 30 distfiles ${distname}-src${extract.suffix} 31 patchfiles patch-configure.diff \32 patch-config-mh-darwin.diff \33 inline.patch34 31 35 32 checksums ${distname}-src.tgz \ 36 rmd160 ef1256bb87b3dcec1cf40b32b11c5c3f1bd48af6\37 sha256 deb027a05f1b3bec03298b96fb93b28c84e9683c22e6f94effa67fdc7bd704cc33 rmd160 9bd1b4bdc2010545c76a927dcf46049686beeab9 \ 34 sha256 6fa74fb5aac070c23eaba1711a7178fe582c59867484c5ec07c49002787a9a28 38 35 39 36 worksrcdir ${name}/source 40 37 set docdir ${prefix}/share/doc/${name} 41 38 39 # icu appends -O2 to the cflags and cxxflags 40 configure.optflags-delete -Os 41 42 # ICU has three mechanisms to aid other projects in building properly 43 # 1) .pc files for pkg-config 44 # 2) shell script icu-config that can output compiler flags 45 # 3) Makefile include files Makefile.inc and pkgdata.inc 46 # For a time, all three assumed other projects would want to be 47 # built as ICU had been built, regardless of whether it was appropriate. 48 # For the most part, the extraneous flags have been removed. 49 # 1) They have been removed completely from the .pc files. 50 # pkg-config is the recommended way of building against ICU. 51 # 2) icu-config does not print them out, but they are still contained in the script itself. 52 # 3) They still exist in the Makefile include files. 53 # 54 # for descriptions of the problem, see 55 # r101578 56 # #40069 57 # https://bugs.gentoo.org/show_bug.cgi?id=202059 58 # 59 # for upstream reports and discussion, see 60 # http://bugs.icu-project.org/trac/ticket/10308 61 # http://bugs.icu-project.org/trac/ticket/6102 42 62 if {[variant_isset universal]} { 43 patchfiles-append patch-universal.diff 44 45 # weirdly, icu needs a separate source dir built for the build 46 # machine in order to cross-compile 47 pre-configure { 48 global merger_configure_args 49 set cross 0 50 set 32bit 0 51 set crosspath ${worksrcpath}-cross 52 if {${os.major} < 9 || [sysctl hw.cpu64bit_capable] == 0} { 53 set 32bit 1 54 } 55 foreach a $universal_archs_to_use { 56 if {($32bit && ($a eq "x86_64" || $a eq "ppc64")) 57 || (${os.arch} eq "powerpc" && ($a eq "x86_64" || $a eq "i386")) 58 || (${os.arch} eq "i386" && ($a eq "ppc" || $a eq "ppc64"))} { 59 set cross 1 60 set merger_configure_args($a) --with-cross-build=${crosspath} 63 merger-post-destroot { 64 set rebuilton "" 65 foreach arch ${universal_archs_to_use} { 66 set dir ${destroot}-${arch} 67 68 # SIZEOF_VOID_P is no longer used in icu-config, so remove it to facilitate merging of the shell script 69 reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${dir}${prefix}/bin/icu-config 70 71 # icu-config contains the exact time it was built, which makes merging difficult 72 # ensure that all versions of icu-config have the same build timestamp 73 if { ${rebuilton} eq "" } { 74 set rebuilton [exec /usr/bin/tail -n 1 ${dir}${prefix}/bin/icu-config] 75 } else { 76 reinplace "s|^# Rebuilt on .*|${rebuilton}|" ${dir}${prefix}/bin/icu-config 61 77 } 78 79 # Removing architecture specific information from the Makefile include files is necessary to merge them correctly. 80 # It is concivable that this could cause problems for certain projects. 81 # The developers of ICU suggest using pkg-config over both icu-config and the Makefile includes. 82 reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${dir}${prefix}/lib/icu/${version}/Makefile.inc 83 reinplace -E {s:-arch +[^ ]+::g} ${dir}${prefix}/lib/icu/${version}/pkgdata.inc 62 84 } 63 if {$cross} {64 copy ${worksrcpath} ${crosspath}65 set configure_dir_save ${configure.dir}66 configure.dir ${crosspath}67 portconfigure::configure_main68 configure.dir $configure_dir_save69 system -W ${crosspath} "${build.cmd}[portbuild::build_getjobsarg]"70 }71 85 } 86 } else { 87 post-destroot { 88 # stay consistent with the universal build (see comments above) 89 reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${destroot}${prefix}/bin/icu-config 90 reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${destroot}${prefix}/lib/icu/${version}/Makefile.inc 91 reinplace -E {s:-arch +[^ ]+::g} ${destroot}${prefix}/lib/icu/${version}/pkgdata.inc 92 } 72 93 } 73 94 74 post-patch { 75 reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/config/mh-darwin 95 post-destroot { 96 # The ICU build mechanism passes rpath to the linker, but this should not be necessary if the shared libraries were built correctly. 97 reinplace {s|^default_ENABLE_RPATH="YES"$|default_ENABLE_RPATH="NO"|g} ${destroot}${prefix}/bin/icu-config 98 reinplace -E {s| -Wl,-rpath,.+/lib||g} ${destroot}${prefix}/lib/icu/${version}/pkgdata.inc 76 99 } 77 100 78 101 set platform [switch ${os.platform} {darwin {format MacOSX} freebsd {format FreeBSD}}] 79 102 configure.cmd ./runConfigureICU ${platform} 80 103 104 # enable-rpath forces ICU to build the shared library correctly (with directory name in -install_name) 81 105 configure.args --enable-static \ 82 --disable-samples 106 --disable-samples \ 107 --enable-rpath 83 108 84 109 configure.universal_args-delete --disable-dependency-tracking 110 if {[variant_isset universal]} { 111 # ICU detects cross compiling by trying to run binaries. 112 # r73849 and #29904 indicate that cross compiling is a problem. 113 # Of the solutions tried (r79660, r73865, and r73849), simply disallowing cross compiling is by far the simplest. 114 # Note that #29904 should not show up again because universal now better recognizes 32/64-bit cross compiling (r79658) 115 set merger_must_run_binaries "yes" 116 } 85 117 86 118 # Fix bug #11981 that prevents ICU from building when upgrading. 87 119 # The default configure flags causes utilisation of outdated ICU … … 89 121 configure.cppflags 90 122 configure.ldflags 91 123 92 post-configure {93 if {[variant_isset universal]} {94 # Ticket #2377395 foreach a ${universal_archs_to_use} {96 reinplace "s|__ARCH__|${a}|g" ${worksrcpath}-${a}/Makefile97 }98 }99 }100 101 124 build.type gnu 102 125 103 126 use_parallel_build yes 104 127 105 post-build {106 if {[variant_isset universal]} {107 set dirs {}108 foreach arch ${universal_archs_to_use} {109 lappend dirs ${worksrcpath}-${arch}110 }111 } else {112 set dirs ${worksrcpath}113 }114 foreach dir ${dirs} {115 foreach f {Makefile.inc icu-config icu-i18n.pc icu-io.pc icu-le.pc icu-lx.pc icu-uc.pc icu.pc pkgdata.inc} {116 reinplace -E {s|-arch [a-z0-9_]+||g} ${dir}/config/${f}117 }118 }119 }120 121 128 test.run yes 122 129 test.target check 123 130 124 131 post-destroot { 125 132 xinstall -d ${destroot}${docdir} 126 133 eval xinstall -m 0644 [glob ${worksrcpath}/../*.{css,html,txt}] ${destroot}${docdir} 127 128 if {[variant_isset universal]} {129 # Ticket #23773130 foreach a ${universal_archs_to_use} {131 reinplace "s|/Makefile.inc|/Makefile-${a}.inc|g" ${destroot}${prefix}/bin/icu-config-${a}132 }133 ln -s current/Makefile.inc ${destroot}${prefix}/lib/icu/Makefile.inc134 }135 134 } 136 135 137 post-activate {138 if {[variant_isset universal]} {139 # Ticket #23773140 set a ${configure.build_arch}141 if {$a == "ppc64"} {142 if {![file exists ${prefix}/bin/icu-config-${a}]} {143 set a "ppc"144 }145 } elseif {$a == "x86_64"} {146 if {![file exists ${prefix}/bin/icu-config-${a}]} {147 set a "i386"148 if {![file exists ${prefix}/bin/icu-config-${a}]} {149 set a "ppc"150 }151 }152 } elseif {$a == "i386"} {153 if {![file exists ${prefix}/bin/icu-config-${a}]} {154 set a "ppc"155 }156 }157 foreach {p q} [list "${prefix}/bin/icu-config-${a}" "${prefix}/bin/icu-config" \158 "${prefix}/lib/icu/${version}/Makefile-${a}.inc" "${prefix}/lib/icu/${version}/Makefile.inc" \159 "${prefix}/lib/pkgconfig/icu-i18n-${a}.pc" "${prefix}/lib/pkgconfig/icu-i18n.pc" \160 "${prefix}/lib/pkgconfig/icu-io-${a}.pc" "${prefix}/lib/pkgconfig/icu-io.pc" \161 "${prefix}/lib/pkgconfig/icu-le-${a}.pc" "${prefix}/lib/pkgconfig/icu-le.pc" \162 "${prefix}/lib/pkgconfig/icu-lx-${a}.pc" "${prefix}/lib/pkgconfig/icu-lx.pc" \163 "${prefix}/lib/pkgconfig/icu-uc-${a}.pc" "${prefix}/lib/pkgconfig/icu-uc.pc"] {164 if {[file exists ${p}]} {165 ln -s ${p} ${q}166 }167 }168 }169 }170 171 136 # icu @51.2_0 and earlier also installed the following files directly, bypassing destroot: 172 137 # ${prefix}/lib/icu/${version}/pkgdata.inc 173 138 # These files can be removed from the below deactivation block after August 2014. … … 192 157 extract.only ${distname}-src${extract.suffix} 193 158 distfiles-append ${distname}-docs.zip 194 159 checksums-append ${distname}-docs.zip \ 195 rmd160 87f332c1c2e4c5322cd110f93e8ccb288d0303a9\196 sha256 c488b3ddbb99a4a368cfc74e725d6a9e491ae6ac0169caba2197c15ffb85b7c5160 rmd160 60ce19f8633c18d670ad2f0b8d7920cd6ed0a314 \ 161 sha256 2c700534d52b98615b4baffcf0502f37540604e67817625f05d6e2fbf98d0c0b 197 162 198 163 post-extract { 199 164 xinstall -m 0755 -d ${worksrcpath}/doc -
files/inline.patch
1 --- common/umutex.h.orig 2012-06-01 07:52:44.000000000 -07002 +++ common/umutex.h 2013-01-18 23:34:55.000000000 -08003 @@ -29,7 +29,7 @@4 #if U_PLATFORM_IS_DARWIN_BASED5 #if defined(__STRICT_ANSI__)6 #define UPRV_REMAP_INLINE7 -#define inline8 +#define inline __inline__9 #endif10 #include <libkern/OSAtomic.h>11 #define USE_MAC_OS_ATOMIC_INCREMENT 1 -
files/patch-config-mh-darwin.diff
1 --- config/mh-darwin.orig 2011-10-14 04:38:41.000000000 -07002 +++ config/mh-darwin 2011-10-14 05:32:55.000000000 -07003 @@ -28,7 +28,7 @@4 ifeq ($(ENABLE_RPATH),YES)5 LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET))6 else7 -LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET))8 +LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name __PREFIX__/lib/$(notdir $(MIDDLE_SO_TARGET))9 endif10 11 ## Compiler switch to embed a runtime search path -
files/patch-configure.diff
1 --- configure.org 2013-05-30 14:16:18.000000000 +02002 +++ configure 2013-05-30 14:17:11.000000000 +02003 @@ -4066,7 +4066,7 @@4 then5 # Do not use -ansi. It limits us to C90, and it breaks some platforms.6 # We use -std=c99 to disable the gnu99 defaults and its associated warnings7 - CFLAGS="$CFLAGS -Wall -std=c99 -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"8 + CFLAGS="$CFLAGS -std=c99 -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"9 else10 case "${host}" in11 *-*-cygwin)12 @@ -4078,7 +4078,7 @@13 fi14 if test "$GXX" = yes15 then16 - CXXFLAGS="$CXXFLAGS -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"17 + CXXFLAGS="$CXXFLAGS -W -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"18 else19 case "${host}" in20 *-*-cygwin)21 @@ -6006,40 +6006,6 @@22 $as_echo_n "(cached) " >&623 else24 ac_cv_c_bigendian=unknown25 - # See if we're dealing with a universal compiler.26 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext27 -/* end confdefs.h. */28 -#ifndef __APPLE_CC__29 - not a universal capable compiler30 - #endif31 - typedef int dummy;32 -33 -_ACEOF34 -if ac_fn_c_try_compile "$LINENO"; then :35 -36 - # Check for potential -arch flags. It is not universal unless37 - # there are at least two -arch flags with different values.38 - ac_arch=39 - ac_prev=40 - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do41 - if test -n "$ac_prev"; then42 - case $ac_word in43 - i?86 | x86_64 | ppc | ppc64)44 - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then45 - ac_arch=$ac_word46 - else47 - ac_cv_c_bigendian=universal48 - break49 - fi50 - ;;51 - esac52 - ac_prev=53 - elif test "x$ac_word" = "x-arch"; then54 - ac_prev=arch55 - fi56 - done57 -fi58 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext59 if test $ac_cv_c_bigendian = unknown; then60 # See if sys/param.h defines the BYTE_ORDER macro.61 cat confdefs.h - <<_ACEOF >conftest.$ac_ext62 @@ -6214,11 +6180,6 @@63 ;; #(64 no)65 ;; #(66 - universal)67 -68 -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h69 -70 - ;; #(71 *)72 as_fn_error $? "unknown endianness73 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; -
files/patch-universal.diff
1 --- Makefile.in.orig 2013-05-23 15:06:32.000000000 -05002 +++ Makefile.in 2013-08-15 01:22:22.000000000 -05003 @@ -169,15 +169,18 @@4 $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh5 @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig6 $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/7 + @for f in $(ALL_PKGCONFIG_SUFFIX); do \8 + mv "$(DESTDIR)$(libdir)/pkgconfig/icu-$${f}.pc" "$(DESTDIR)$(libdir)/pkgconfig/icu-$${f}-__ARCH__.pc"; \9 + done;10 $(INSTALL_DATA) $(top_srcdir)/../license.html $(DESTDIR)$(pkgdatadir)/license.html11 - $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config12 - $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc13 + $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config-__ARCH__14 + $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile-__ARCH__.inc15 $(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc16 # @echo icuinfo.xml is built after make check.17 # -$(INSTALL_DATA) $(top_builddir)/config/icuinfo.xml $(DESTDIR)$(pkglibdir)/icuinfo.xml18 cd $(DESTDIR)$(pkglibdir)/..; \19 $(RM) current && ln -s $(VERSION) current; \20 - $(RM) Makefile.inc && ln -s current/Makefile.inc Makefile.inc; \21 +# $(RM) Makefile.inc && ln -s current/Makefile.inc Makefile.inc; \22 $(RM) pkgdata.inc && ln -s current/pkgdata.inc pkgdata.inc23 24 ifeq ($(DOXYGEN),)