From 2af14707147d3dd668befc73f69591cf03e9e990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Forysiuk?= Date: Wed, 8 Feb 2012 18:14:00 +0100 Subject: [PATCH] Initial import (#787878). --- .gitignore | 1 + icu4c-4_6_1-crossbuild.patch | 216 +++++++++++++++++++++++++++++++++++ icu4c-4_6_1-win32.patch | 11 ++ mingw-icu.spec | 168 +++++++++++++++++++++++++++ sources | 1 + 5 files changed, 397 insertions(+) create mode 100644 icu4c-4_6_1-crossbuild.patch create mode 100644 icu4c-4_6_1-win32.patch create mode 100644 mingw-icu.spec diff --git a/.gitignore b/.gitignore index e69de29..eb41030 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/icu4c-4_8_1_1-src.tgz diff --git a/icu4c-4_6_1-crossbuild.patch b/icu4c-4_6_1-crossbuild.patch new file mode 100644 index 0000000..32dc212 --- /dev/null +++ b/icu4c-4_6_1-crossbuild.patch @@ -0,0 +1,216 @@ +--- a/source/common/unicode/platform.h.in ++++ b/source/common/unicode/platform.h.in +@@ -248,6 +248,12 @@ + #ifndef U_GNUC_UTF16_STRING + #define U_GNUC_UTF16_STRING @U_CHECK_GNUC_UTF16_STRING@ + #endif ++ ++/** ++ * Never define U_DECLARE_UTF16 for MinGW, as that will cause ++ * bogus UNICODE_STRING and U_STRING_DECL definitions. ++ */ ++#ifndef __MINGW32__ + #if @U_CHECK_UTF16_STRING@ || defined(U_CHECK_UTF16_STRING) + #if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \ + || (defined(__HP_aCC) && __HP_aCC >= 035000) \ +@@ -263,6 +269,7 @@ + #define U_DECLARE_UTF16(string) L ## string + #endif + #endif ++#endif + + /** @} */ + +--- a/source/config/icu.pc.in ++++ b/source/config/icu.pc.in +@@ -1,27 +1,27 @@ + # Copyright (C) 2010, International Business Machines Corporation. All Rights Reserved. + +-prefix = @prefix@ +-exec_prefix = @exec_prefix@ +-#bindir = @bindir@ +-libdir = @libdir@ +-includedir = @includedir@ +-baselibs = @LIBS@ +-#datarootdir = @datarootdir@ +-#datadir = @datadir@ +-#sbindir = @sbindir@ +-#mandir = @mandir@ +-#sysconfdir = @sysconfdir@ +-CFLAGS = @CFLAGS@ +-#CXXFLAGS = @CXXFLAGS@ +-DEFS = @DEFS@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++#bindir=@bindir@ ++libdir=@libdir@ ++includedir=@includedir@ ++baselibs=@LIBS@ ++#datarootdir=@datarootdir@ ++#datadir=@datadir@ ++#sbindir=@sbindir@ ++#mandir=@mandir@ ++#sysconfdir=@sysconfdir@ ++CFLAGS=@CFLAGS@ ++#CXXFLAGS=@CXXFLAGS@ ++DEFS=@DEFS@ + UNICODE_VERSION=@UNICODE_VERSION@ + ICUPREFIX=icu + ICULIBSUFFIX=@ICULIBSUFFIX@ +-LIBICU=lib${ICUPREFIX} ++LIBICU=${ICUPREFIX} + #SHAREDLIBCFLAGS=-fPIC + pkglibdir=${libdir}/@PACKAGE@${ICULIBSUFFIX}/@VERSION@ + #pkgdatadir=${datadir}/@PACKAGE@${ICULIBSUFFIX}/@VERSION@ +-ICUDATA_NAME = icudt@LIB_VERSION_MAJOR@@ICUDATA_CHAR@ ++ICUDATA_NAME=icudt@LIB_VERSION_MAJOR@@ICUDATA_CHAR@ + #ICUPKGDATA_DIR=@libdir@ + #ICUDATA_DIR=${pkgdatadir} + ICUDESC=International Components for Unicode +--- a/source/config/Makefile.inc.in ++++ b/source/config/Makefile.inc.in +@@ -41,7 +41,7 @@ + # The prefix for ICU libraries, normally 'icu' + ICUPREFIX = icu + PACKAGE = @PACKAGE@ +-LIBICU = lib$(ICUPREFIX) ++LIBICU = $(ICUPREFIX) + + # Static library prefix and file extension + STATIC_PREFIX = s +@@ -113,6 +113,7 @@ + ICULIBS_BASE = $(LIBS) -L$(libdir) + + # for icu-config to test with ++SO = lib + ICULIBS_COMMON_LIB_NAME = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO} + ICULIBS_COMMON_LIB_NAME_A = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A} + +--- a/source/config/mh-mingw ++++ b/source/config/mh-mingw +@@ -38,8 +38,10 @@ + #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) + + ## Commands to make a shared library +-SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared +-SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared ++# $(subst) won't work in shell script. #M# at the end omits these ++# lines from the shell script (Make only) ++SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,--enable-auto-import -Wl,--out-implib=$(subst $(SO_TARGET_VERSION_MAJOR),,$(subst $(ICUPREFIX),$(LIBPREFIX)$(ICUPREFIX),$@)).$(A)#M# ++SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,--enable-auto-import -Wl,--out-implib=$(subst $(SO_TARGET_VERSION_MAJOR),,$(subst $(ICUPREFIX),$(LIBPREFIX)$(ICUPREFIX),$@)).$(A)#M# + + ## Compiler switch to embed a runtime search path + LD_RPATH= +@@ -52,22 +54,20 @@ + SO = dll + ## Non-shared intermediate object suffix + STATIC_O = ao +-SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) +- +-# Static library prefix and file extension +-LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX) +-A = lib +- +-## An import library is needed for z/OS and MSVC +-#IMPORT_LIB_EXT = .lib +- +-LIBPREFIX= +- +-# Change the stubnames so that poorly working FAT disks and installation programs can work. +-# This is also for backwards compatibility. +-DATA_STUBNAME = dt +-I18N_STUBNAME = in +-LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) ++LIBICU = $(ICUPREFIX) ++LIBSICU = $(LIBPREFIX)$(ICUPREFIX) ++## To have an import library is better on Windows ++IMPORT_LIB_EXT = .dll.a ++ ++LIBICU = $(ICUPREFIX) ++ICULIBS_DT = -l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX) ++ICULIBS_UC = -l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX) ++ICULIBS_I18N = -l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX) ++ICULIBS_LE = -l$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX) ++ICULIBS_LX = -l$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX) ++ICULIBS_IO = -l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX) ++ICULIBS_CTESTFW = -l$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX) ++ICULIBS_TOOLUTIL = -l$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX) + + # The #M# is used to delete lines for icu-config + # Current full path directory. +@@ -103,21 +103,32 @@ + ## Versioned target for a shared library. + ## Since symbolic links don't work the same way on Windows, + ## we only use the version major number. +-#FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) + FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) + MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) ++SHARED_OBJECT = $(FINAL_SO_TARGET) ++ ++IMPORT_LIB = $(subst $(ICUPREFIX),$(LIBPREFIX)$(ICUPREFIX),$(basename $(SO_TARGET))).$(SO).$(A)#M# ++MIDDLE_IMPORT_LIB = $(IMPORT_LIB)#M# ++FINAL_IMPORT_LIB = $(IMPORT_LIB)#M# + +-## Special pkgdata information that is needed +-PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR) +-#ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M# +-#ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M# ++# The following is for Makefile.inc's use. ++ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) + + ## Versioned libraries rules +-#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) +-# $(RM) $@ && cp ${= 68 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-gcc-c++ +BuildRequires: mingw32-binutils +#BuildRequires: mingw32-pkg-config + + +%description +ICU is a set of C and C++ libraries that provides robust and +full-featured Unicode and locale support. The library provides calendar +support, conversions for many character sets, language sensitive +collation, date and time formatting, support for many locales, message +catalogs and resources, message formatting, normalization, number and +currency formatting, time zone support, transliteration, and word, +line, and sentence breaking, etc. + + + +%package -n mingw32-icu +Summary: MinGW compilation of International Components for Unicode Tools +Group: Development/Libraries + + +%description -n mingw32-icu +ICU is a set of C and C++ libraries that provides robust and +full-featured Unicode and locale support. The library provides calendar +support, conversions for many character sets, language sensitive +collation, date and time formatting, support for many locales, message +catalogs and resources, message formatting, normalization, number and +currency formatting, time zone support, transliteration, and word, +line, and sentence breaking, etc. + + + +%{_mingw32_debug_package} + +%prep +%setup -q -n icu + +%patch0 -p1 -b .crossbuild +%patch1 -p1 -b .win32 + +%build +pushd source + +mkdir -p nativebuild + +pushd nativebuild + +../configure --enable-static --disable-shared + +make %{?_smp_mflags} || make + +popd + +%{_mingw32_configure} \ + --enable-shared --disable-static \ + --with-cross-build=$(pwd)/nativebuild \ + --with-data-packaging=library + +make %{?_smp_mflags} + +popd + +%install +pushd source + +make DESTDIR=$RPM_BUILD_ROOT install + +popd + +# UGLY HACKS RESTARTING + +find $RPM_BUILD_ROOT%{_mingw32_libdir} -name "*.dll" -type l -delete + +rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/icudata48.dll + +mv $RPM_BUILD_ROOT%{_mingw32_libdir}/libicudata48.1.1.dll \ + $RPM_BUILD_ROOT%{_mingw32_libdir}/icudata48.dll + +for i in $RPM_BUILD_ROOT%{_mingw32_libdir}/*.dll; \ + do mv $i $RPM_BUILD_ROOT%{_mingw32_bindir}/; done + +sed -i -e 's,default_ENABLE_RPATH=.*,default_ENABLE_RPATH="N",' -e 's,^SO=.*$,SO="dll",' $RPM_BUILD_ROOT%{_mingw32_bindir}/icu-config + +# UGLY HACKS ENDING AGAIN + +rm -fr $RPM_BUILD_ROOT%{_mingw32_mandir} +# remove dangling pointers +rm -fr $RPM_BUILD_ROOT%{_mingw32_libdir}/icu/Makefile.inc +rm -fr $RPM_BUILD_ROOT%{_mingw32_libdir}/icu/pkgdata.inc + +%files -n mingw32-icu +%doc license.html unicode-license.txt + +%{_mingw32_bindir}/genrb.exe +%{_mingw32_bindir}/gencnval.exe +%{_mingw32_bindir}/uconv.exe +%{_mingw32_bindir}/gencmn.exe +%{_mingw32_bindir}/makeconv.exe +%{_mingw32_bindir}/genbrk.exe +%{_mingw32_bindir}/gensprep.exe +%{_mingw32_bindir}/pkgdata.exe +%{_mingw32_bindir}/icupkg.exe +%{_mingw32_bindir}/derb.exe +%{_mingw32_bindir}/genccode.exe +%{_mingw32_bindir}/genctd.exe +%{_mingw32_bindir}/gencfu.exe +%{_mingw32_bindir}/gennorm2.exe +%{_mingw32_bindir}/icuinfo.exe + +%{_mingw32_bindir}/icuio48.dll +%{_mingw32_bindir}/icuuc48.dll +%{_mingw32_bindir}/icule48.dll +%{_mingw32_bindir}/icui18n48.dll +%{_mingw32_bindir}/icutu48.dll +%{_mingw32_bindir}/icudata48.dll +%{_mingw32_bindir}/iculx48.dll +%{_mingw32_bindir}/icutest48.dll + +%{_mingw32_bindir}/icu-config +%{_mingw32_libdir}/libicule.dll.a +%{_mingw32_libdir}/libicudata.dll.a +%{_mingw32_libdir}/libicui18n.dll.a +%{_mingw32_libdir}/libicuuc.dll.a +%{_mingw32_libdir}/libiculx.dll.a +%{_mingw32_libdir}/libicuio.dll.a +%{_mingw32_libdir}/libicutest.dll.a +%{_mingw32_libdir}/libicutu.dll.a +%{_mingw32_libdir}/pkgconfig/icu-i18n.pc +%{_mingw32_libdir}/pkgconfig/icu-io.pc +%{_mingw32_libdir}/pkgconfig/icu-le.pc +%{_mingw32_libdir}/pkgconfig/icu-lx.pc +%{_mingw32_libdir}/pkgconfig/icu-uc.pc +%{_mingw32_includedir}/layout +%{_mingw32_includedir}/unicode +%{_mingw32_libdir}/icu +%{_mingw32_datadir}/icu + + +%changelog +* Tue Feb 07 2012 Forysiuk Paweł - 4.8.1.1-2 +- Fix icu4c-4_6_1-crossbuild.patch to compile cleanly +- Minor packaging cleanup + +* Tue Feb 07 2012 Forysiuk Paweł - 4.8.1.1-1 +- Initial release based on openSUSE mingw32-icu package diff --git a/sources b/sources index e69de29..f6ccab5 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +ea93970a0275be6b42f56953cd332c17 icu4c-4_8_1_1-src.tgz