Update ICU in windows binary

This commit is contained in:
Kovid Goyal 2012-07-05 13:11:03 +05:30
parent d67cdb495e
commit 37286ca39c
4 changed files with 27 additions and 10 deletions

View File

@ -34,6 +34,7 @@ if iswindows:
MT = os.path.join(os.path.dirname(p), 'bin', 'mt.exe') MT = os.path.join(os.path.dirname(p), 'bin', 'mt.exe')
MT = os.path.join(SDK, 'bin', 'mt.exe') MT = os.path.join(SDK, 'bin', 'mt.exe')
os.environ['QMAKESPEC'] = 'win32-msvc' os.environ['QMAKESPEC'] = 'win32-msvc'
ICU = r'Q:\icu'
QMAKE = '/Volumes/sw/qt/bin/qmake' if isosx else 'qmake' QMAKE = '/Volumes/sw/qt/bin/qmake' if isosx else 'qmake'
if find_executable('qmake-qt4'): if find_executable('qmake-qt4'):
@ -97,8 +98,9 @@ if iswindows:
prefix = r'C:\cygwin\home\kovid\sw' prefix = r'C:\cygwin\home\kovid\sw'
sw_inc_dir = os.path.join(prefix, 'include') sw_inc_dir = os.path.join(prefix, 'include')
sw_lib_dir = os.path.join(prefix, 'lib') sw_lib_dir = os.path.join(prefix, 'lib')
icu_inc_dirs = [sw_inc_dir] icu_inc_dirs = [os.path.join(ICU, 'source', 'common'), os.path.join(ICU,
icu_lib_dirs = [sw_lib_dir] 'source', 'i18n')]
icu_lib_dirs = [os.path.join(ICU, 'source', 'lib')]
sqlite_inc_dirs = [sw_inc_dir] sqlite_inc_dirs = [sw_inc_dir]
fc_inc = os.path.join(sw_inc_dir, 'fontconfig') fc_inc = os.path.join(sw_inc_dir, 'fontconfig')
fc_lib = sw_lib_dir fc_lib = sw_lib_dir

View File

@ -13,6 +13,7 @@ from setup import (Command, modules, functions, basenames, __version__,
from setup.build_environment import msvc, MT, RC from setup.build_environment import msvc, MT, RC
from setup.installer.windows.wix import WixMixIn from setup.installer.windows.wix import WixMixIn
ICU_DIR = r'Q:\icu'
OPENSSL_DIR = r'Q:\openssl' OPENSSL_DIR = r'Q:\openssl'
QT_DIR = 'Q:\\Qt\\4.8.2' QT_DIR = 'Q:\\Qt\\4.8.2'
QT_DLLS = ['Core', 'Gui', 'Network', 'Svg', 'WebKit', 'Xml', 'XmlPatterns'] QT_DLLS = ['Core', 'Gui', 'Network', 'Svg', 'WebKit', 'Xml', 'XmlPatterns']
@ -147,6 +148,8 @@ class Win32Freeze(Command, WixMixIn):
ignore=shutil.ignore_patterns('msvc*.dll', 'Microsoft.*')) ignore=shutil.ignore_patterns('msvc*.dll', 'Microsoft.*'))
for x in glob.glob(self.j(OPENSSL_DIR, 'bin', '*.dll')): for x in glob.glob(self.j(OPENSSL_DIR, 'bin', '*.dll')):
shutil.copy2(x, self.dll_dir) shutil.copy2(x, self.dll_dir)
for x in glob.glob(self.j(ICU_DIR, 'source', 'lib', '*.dll')):
shutil.copy2(x, self.dll_dir)
for x in QT_DLLS: for x in QT_DLLS:
x += '4.dll' x += '4.dll'
if not x.startswith('phonon'): x = 'Qt'+x if not x.startswith('phonon'): x = 'Qt'+x

View File

@ -131,11 +131,22 @@ calibre-debug -c "import _imaging, _imagingmath, _imagingft, _imagingcms"
ICU ICU
------- -------
Download the win32 msvc9 binary from http://www.icu-project.org/download/4.4.html Download the win32 source .zip from http://www.icu-project.org/download
Note that 4.4 is the last version of ICU that can be compiled (is precompiled) with msvc9 Extract to q:\icu
Put the dlls into sw/bin and the unicode dir into sw/include and the contents of lib int sw/lib Add Q:\icu\bin to PATH and reboot
In a Visual Studio Command Prompt
cd to <ICU>\source
Run set PATH=%PATH%;c:\cygwin\bin
Run dos2unix on configure and runConfigureICU
Run bash ./runConfigureICU Cygwin/MSVC
Run make (note that you must have GNU make installed in cygwin)
Optionally run make test
Libunrar Libunrar
---------- ----------

View File

@ -276,23 +276,21 @@ pêché'''
german = create(german) german = create(german)
c = _icu.Collator('de') c = _icu.Collator('de')
print 'Sorted german:: (%s)'%c.actual_locale
gs = list(sorted(german, key=c.sort_key)) gs = list(sorted(german, key=c.sort_key))
for x in gs: for x in gs:
print '\t', x.encode('utf-8') print '\t', x.encode('utf-8')
if gs != create(german_good): if gs != create(german_good):
print 'German failed' print 'German sorting failed'
return return
print print
french = create(french) french = create(french)
c = _icu.Collator('fr') c = _icu.Collator('fr')
print 'Sorted french:: (%s)'%c.actual_locale
fs = list(sorted(french, key=c.sort_key)) fs = list(sorted(french, key=c.sort_key))
for x in fs: for x in fs:
print '\t', x.encode('utf-8') print '\t', x.encode('utf-8')
if fs != create(french_good): if fs != create(french_good):
print 'French failed (note that French fails with icu < 4.6 i.e. on windows and OS X)' print 'French sorting failed (note that French fails with icu < 4.6)'
# return return
test_strcmp(german + french) test_strcmp(german + french)
print '\nTesting case transforms in current locale' print '\nTesting case transforms in current locale'
@ -309,13 +307,16 @@ pêché'''
u'Štepánek':u'Štepanek'}.iteritems(): u'Štepánek':u'Štepanek'}.iteritems():
if primary_strcmp(k, v) != 0: if primary_strcmp(k, v) != 0:
print 'primary_strcmp() failed with %s != %s'%(k, v) print 'primary_strcmp() failed with %s != %s'%(k, v)
return
if primary_find(v, u' '+k)[0] != 1: if primary_find(v, u' '+k)[0] != 1:
print 'primary_find() failed with %s not in %s'%(v, k) print 'primary_find() failed with %s not in %s'%(v, k)
return
global _primary_collator global _primary_collator
_primary_collator = _icu.Collator('es') _primary_collator = _icu.Collator('es')
if primary_strcmp(u'peña', u'pena') == 0: if primary_strcmp(u'peña', u'pena') == 0:
print 'Primary collation in Spanish locale failed' print 'Primary collation in Spanish locale failed'
return
# }}} # }}}