| @@ -1,79 +1,80 @@ | | | @@ -1,79 +1,80 @@ |
1 | $NetBSD: patch-setup.py,v 1.1 2020/03/21 17:02:14 gutteridge Exp $ | | 1 | $NetBSD: patch-setup.py,v 1.2 2020/07/15 15:04:18 adam Exp $ |
2 | | | 2 | |
3 | Add NetBSD support. | | 3 | Add NetBSD support. |
4 | | | 4 | |
5 | --- setup.py.orig 2020-03-19 20:58:31.000000000 +0000 | | 5 | --- setup.py.orig 2020-05-26 22:08:37.000000000 +0000 |
6 | +++ setup.py | | 6 | +++ setup.py |
7 | @@ -85,6 +85,7 @@ CONFIGURE_WITH_ICU_CONFIG = { | | 7 | @@ -86,6 +86,7 @@ CONFIGURE_WITH_ICU_CONFIG = { |
8 | 'win32': False, # no icu-config | | 8 | 'win32': False, # no icu-config |
9 | 'sunos5': False, # not tested | | 9 | 'sunos5': False, # not tested |
10 | 'cygwin': False, # not tested | | 10 | 'cygwin': False, # not tested |
11 | + 'netbsd': False, | | 11 | + 'netbsd': False, |
12 | } | | 12 | } |
13 | | | 13 | |
14 | CONFIGURE_WITH_PKG_CONFIG = { | | 14 | CONFIGURE_WITH_PKG_CONFIG = { |
15 | @@ -94,6 +95,7 @@ CONFIGURE_WITH_PKG_CONFIG = { | | 15 | @@ -95,6 +96,7 @@ CONFIGURE_WITH_PKG_CONFIG = { |
16 | 'win32': False, # no pkg-config ? | | 16 | 'win32': False, # no pkg-config ? |
17 | 'sunos5': False, # not tested | | 17 | 'sunos5': False, # not tested |
18 | 'cygwin': False, # not tested | | 18 | 'cygwin': False, # not tested |
19 | + 'netbsd': True, | | 19 | + 'netbsd': True, |
20 | } | | 20 | } |
21 | | | 21 | |
22 | INCLUDES = { | | 22 | INCLUDES = { |
23 | @@ -103,6 +105,7 @@ INCLUDES = { | | 23 | @@ -104,6 +106,7 @@ INCLUDES = { |
24 | 'win32': ['c:/icu/include'], | | 24 | 'win32': ['c:/icu/include'], |
25 | 'sunos5': [], | | 25 | 'sunos5': [], |
26 | 'cygwin': [], | | 26 | 'cygwin': [], |
27 | + 'netbsd': [], | | 27 | + 'netbsd': [], |
28 | } | | 28 | } |
29 | | | 29 | |
30 | VER_FLAGS = { | | 30 | VER_FLAGS = { |
31 | @@ -112,6 +115,7 @@ VER_FLAGS = { | | 31 | @@ -119,6 +122,8 @@ VER_FLAGS = { |
32 | 'win32': ['/DPYICU_VER=\\"%s\\"' %(VERSION)], | | 32 | '-DPYICU_ICU_MAX_VER="%s"' %(ICU_MAX_MAJOR_VERSION)], |
33 | 'sunos5': ['-DPYICU_VER="%s"' %(VERSION)], | | 33 | 'cygwin': ['-DPYICU_VER="%s"' %(VERSION), |
34 | 'cygwin': ['-DPYICU_VER="%s"' %(VERSION)], | | 34 | '-DPYICU_ICU_MAX_VER="%s"' %(ICU_MAX_MAJOR_VERSION)], |
35 | + 'netbsd': ['-DPYICU_VER="%s"' %(VERSION)], | | 35 | + 'netbsd': ['-DPYICU_VER="%s"' %(VERSION), |
| | | 36 | + '-DPYICU_ICU_MAX_VER="%s"' %(ICU_MAX_MAJOR_VERSION)], |
36 | } | | 37 | } |
37 | | | 38 | |
38 | CFLAGS = { | | 39 | PEDANTIC_FLAGS = { |
39 | @@ -121,6 +125,7 @@ CFLAGS = { | | 40 | @@ -137,6 +142,7 @@ CFLAGS = { |
40 | 'win32': ['/Zc:wchar_t', '/EHsc'], | | 41 | 'win32': ['/Zc:wchar_t', '/EHsc'], |
41 | 'sunos5': ['-std=c++11'], | | 42 | 'sunos5': ['-std=c++11'], |
42 | 'cygwin': ['-D_GNU_SOURCE=1', '-std=c++11'], | | 43 | 'cygwin': ['-D_GNU_SOURCE=1', '-std=c++11'], |
43 | + 'netbsd': [], | | 44 | + 'netbsd': [], |
44 | } | | 45 | } |
45 | | | 46 | |
46 | # added to CFLAGS when setup is invoked with --debug | | 47 | # added to CFLAGS when setup is invoked with --debug |
47 | @@ -131,6 +136,7 @@ DEBUG_CFLAGS = { | | 48 | @@ -147,6 +153,7 @@ DEBUG_CFLAGS = { |
48 | 'win32': ['/Od', '/DDEBUG'], | | 49 | 'win32': ['/Od', '/DDEBUG'], |
49 | 'sunos5': ['-DDEBUG'], | | 50 | 'sunos5': ['-DDEBUG'], |
50 | 'cygwin': ['-Og', '-g', '-DDEBUG'], | | 51 | 'cygwin': ['-Og', '-g', '-DDEBUG'], |
51 | + 'netbsd': ['-O0', '-g', '-DDEBUG'], | | 52 | + 'netbsd': ['-O0', '-g', '-DDEBUG'], |
52 | } | | 53 | } |
53 | | | 54 | |
54 | LFLAGS = { | | 55 | LFLAGS = { |
55 | @@ -140,6 +146,7 @@ LFLAGS = { | | 56 | @@ -156,6 +163,7 @@ LFLAGS = { |
56 | 'win32': ['/LIBPATH:c:/icu/lib'], | | 57 | 'win32': ['/LIBPATH:c:/icu/lib'], |
57 | 'sunos5': [], | | 58 | 'sunos5': [], |
58 | 'cygwin': [], | | 59 | 'cygwin': [], |
59 | + 'netbsd': [], | | 60 | + 'netbsd': [], |
60 | } | | 61 | } |
61 | | | 62 | |
62 | LIBRARIES = { | | 63 | LIBRARIES = { |
63 | @@ -149,6 +156,7 @@ LIBRARIES = { | | 64 | @@ -165,6 +173,7 @@ LIBRARIES = { |
64 | 'win32': ['icuin', 'icuuc', 'icudt'], | | 65 | 'win32': ['icuin', 'icuuc', 'icudt'], |
65 | 'sunos5': ['icui18n', 'icuuc', 'icudata'], | | 66 | 'sunos5': ['icui18n', 'icuuc', 'icudata'], |
66 | 'cygwin': ['icui18n', 'icuuc', 'icudata'], | | 67 | 'cygwin': ['icui18n', 'icuuc', 'icudata'], |
67 | + 'netbsd': [], | | 68 | + 'netbsd': [], |
68 | } | | 69 | } |
69 | | | 70 | |
70 | platform = sys.platform | | 71 | platform = sys.platform |
71 | @@ -156,6 +164,8 @@ if platform.startswith(('linux', 'gnu')) | | 72 | @@ -172,6 +181,8 @@ if platform.startswith(('linux', 'gnu')) |
72 | platform = 'linux' | | 73 | platform = 'linux' |
73 | elif platform.startswith('freebsd'): | | 74 | elif platform.startswith('freebsd'): |
74 | platform = 'freebsd' | | 75 | platform = 'freebsd' |
75 | +elif platform.startswith('netbsd'): | | 76 | +elif platform.startswith('netbsd'): |
76 | + platform = 'netbsd' | | 77 | + platform = 'netbsd' |
77 | | | 78 | |
78 | if 'PYICU_INCLUDES' in os.environ: | | 79 | if 'PYICU_INCLUDES' in os.environ: |
79 | _includes = os.environ['PYICU_INCLUDES'].split(os.pathsep) | | 80 | _includes = os.environ['PYICU_INCLUDES'].split(os.pathsep) |