Commit fe368248 authored by Andi Vajda's avatar Andi Vajda
Browse files

- fixed bug with building on MacOS when pkg-config is present

  - added link to note about building everything from sources
parent 4e11e0eb
Version 2.9 ->
- fixed bug with building on MacOS when pkg-config is present
- added link to note about building everything from sources
-
Version 2.8.1 -> 2.9
--------------------
- added support for ICU 71.1
......
......@@ -83,6 +83,10 @@ pre-built binary packages of ICU and PyICU, see below.
## Building PyICU
Please, refer to next section for building OpenSSL, Python, ICU and PyICU
from sources. This section assumes all dependencies such as Python and ICU
are present.
Before building PyICU the ICU libraries must be built and installed. Refer
to each system's [instructions](https://unicode-org.github.io/icu/userguide/icu4c/build.html) for more information.
......@@ -123,6 +127,15 @@ PyICU is built from sources with ``setuptools`` or with ``build`` and ``pip``:
```
## Building OpenSSL, Python 3, ICU and PyICU from sources
The instructions at [note_853](https://gitlab.pyicu.org/main/pyicu/-/issues/153#note_853) contain the complete steps for building everything from sources into
a self-contained directory, without modifying any system directories. They were
made and tested on an M1 Mac but they can be modified and reused for any unix
environment. In particular, they outline how to build PyICU from sources
without icu-config or pkg-config being present.
## Running PyICU
- Mac OS X
......
......@@ -59,14 +59,42 @@ def configure_with_pkg_config(flags, config_args, label):
raise
platform = sys.platform
if platform.startswith(('linux', 'gnu')):
platform = 'linux'
elif platform.startswith('freebsd'):
platform = 'freebsd'
CONFIGURE_WITH_ICU_CONFIG = {
'darwin': False,
'linux': True,
'freebsd': False, # not tested
'win32': False, # no icu-config
'sunos5': False, # not tested
'cygwin': False, # not tested
}
CONFIGURE_WITH_PKG_CONFIG = {
'darwin': False, # no pkg-config ?
'linux': True,
'freebsd': False, # not tested
'win32': False, # no pkg-config ?
'sunos5': False, # not tested
'cygwin': False, # not tested
}
try:
ICU_VERSION = os.environ['ICU_VERSION']
except:
try:
ICU_VERSION = check_output(('icu-config', '--version')).strip()
CONFIGURE_WITH_ICU_CONFIG[platform] = True
except:
try:
ICU_VERSION = check_output(('pkg-config', '--modversion', 'icu-i18n')).strip()
CONFIGURE_WITH_PKG_CONFIG[platform] = True
except:
raise RuntimeError('''
Please install pkg-config on your system or set the ICU_VERSION environment
......@@ -79,24 +107,6 @@ print('''
Building PyICU %s for ICU %s (max ICU major version supported: %s)
''' %(VERSION, ICU_VERSION, ICU_MAX_MAJOR_VERSION))
CONFIGURE_WITH_ICU_CONFIG = {
'darwin': True,
'linux': True,
'freebsd': False, # not tested
'win32': False, # no icu-config
'sunos5': False, # not tested
'cygwin': False, # not tested
}
CONFIGURE_WITH_PKG_CONFIG = {
'darwin': False, # no pkg-config ?
'linux': True,
'freebsd': False, # not tested
'win32': False, # no pkg-config ?
'sunos5': False, # not tested
'cygwin': False, # not tested
}
INCLUDES = {
'darwin': [],
'linux': [],
......@@ -125,8 +135,8 @@ PEDANTIC_FLAGS = {
}
CFLAGS = {
'darwin': [],
'linux': [],
'darwin': ['-std=c++11'],
'linux': ['-std=c++11'],
'freebsd': ['-std=c++11'],
'win32': ['/Zc:wchar_t', '/EHsc'],
'sunos5': ['-std=c++11'],
......@@ -161,12 +171,6 @@ LIBRARIES = {
'cygwin': ['icui18n', 'icuuc', 'icudata'],
}
platform = sys.platform
if platform.startswith(('linux', 'gnu')):
platform = 'linux'
elif platform.startswith('freebsd'):
platform = 'freebsd'
if 'PYICU_INCLUDES' in os.environ:
_includes = os.environ['PYICU_INCLUDES'].split(os.pathsep)
else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment