/
Portfile
237 lines (191 loc) · 9.09 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup clang_dependency 1.0
name icu
set my_name icu4c
#===============================================================================
# *** IMPORTANT NOTE ***
#
# Any updates to this port require coordination with all maintainers, as the
# number of downstream dependents is very large. And it shouldn't be updated,
# without prior communication (and approval) via the Dev mailing list.
#===============================================================================
# Please increase the revision number of the dependents whenever the library
# version number changes. To find dependencies, use:
# port file all | sort -u | xargs grep -El ':icu( |$)' | rev | cut -d / -f 2 | rev | sort -u
version 67.1
revision 4
epoch 1
subport ${name}-docs { revision 0 }
subport ${name}-lx { revision 1 }
subport ${name}-doxygen-docs { revision 1 }
categories devel textproc
platforms darwin freebsd
maintainers nomaintainer
license Permissive
description International Components for Unicode
long_description \
The International Components for Unicode (ICU) libraries provide robust \
and full-featured Unicode services on a wide variety of platforms. ICU \
supports the most current version of the Unicode standard, and they provide \
support for supplementary Unicode characters (needed for GB 18030 repertoire support).
homepage http://site.icu-project.org/
master_sites https://github.com/unicode-org/icu/releases/download/release-[string map {. -} ${version}]/
set docdir ${prefix}/share/doc/${name}
if {${subport} eq ${name} || ${subport} eq "${name}-lx"} {
# we will only use the muniversal PG on < 10.14. (see footnote 1).
set using_muniversal_PG false
if {${os.platform} eq "darwin" && ${os.major} < 18} {
set using_muniversal_PG true
PortGroup muniversal 1.0
# ICU needs to run binaries when building, to generate its data. (see footnote 2).
merger_must_run_binaries yes
}
distname ${my_name}-[string map {. _} ${version}]-src
extract.suffix .tgz
worksrcdir ${name}/source
# please also update the icu-docs checksums at the bottom of the Portfile
checksums rmd160 c4a84ef7d2e18d6d1374b5ed6449227b94550e14 \
sha256 94a80cd6f251a53bd2a997f6f1b5ac6653fe791dfab66e1eb0227740fb86d5dc \
size 24518055
# use full pathnames to libraries in tools
patchfiles-append patch-config-mh-darwin.diff
# (#60325)
patchfiles-append patch-declspec-conflict.patch
patchfiles-append patch-i18n-formatted_string_builder.h.diff
compiler.cxx_standard 2011
configure.python /usr/bin/python
# prevent ICU from finding installed icu when upgrading (#11981).
compiler.cpath
compiler.library_path
configure.cppflags-delete -I${prefix}/include
configure.ldflags-delete -L${prefix}/lib
configure.args --disable-layoutex \
--disable-samples \
--enable-static
configure.universal_args-delete --disable-dependency-tracking
build.type gnu
build.args VERBOSE=1
post-build {
if {[variant_exists universal] && [variant_isset universal] && ${using_muniversal_PG}} {
set dirs {}
foreach arch ${universal_archs_to_use} {
lappend dirs ${worksrcpath}-${arch}
}
} else {
set dirs ${worksrcpath}
}
foreach dir ${dirs} {
# Remove architecture-specific differences to allow merging. (See footnote 3).
reinplace {s| -DSIZEOF_VOID_P=[48]||g} ${dir}/config/Makefile.inc \
${dir}/config/icu-config
reinplace -E {s| -arch +[^ ]+||g} ${dir}/config/pkgdata.inc
reinplace {s|host=\".*\"|host=\"\"|g} ${dir}/config/icu-config
reinplace {s|host_alias=\".*\"|host_alias=\"\"|g} ${dir}/config/icu-config
reinplace {s|host_cpu=\".*\"|host_cpu=\"\"|g} ${dir}/config/icu-config
}
}
test.run yes
test.target check
test.args VERBOSE=1
if {${os.platform} eq "darwin" && ${os.major} < 11} {
depends_build-append port:python27
license_noconflict python27
configure.python ${prefix}/bin/python2.7
}
if {${build_arch} eq "ppc" || ${build_arch} eq "ppc64"} {
# (#59514) TODO: still needed?
post-extract {
xinstall -d -m 0755 ${worksrcpath}/data/out
}
}
platform darwin 8 {
patchfiles-append patch-common-putil.cpp.diff
}
platform freebsd {
configure.cmd ./runConfigureICU FreeBSD
build.env MAKE=/usr/local/bin/gmake
destroot.env MAKE=/usr/local/bin/gmake
}
}
if {${subport} eq ${name}} {
post-destroot {
xinstall -d ${destroot}${docdir}
xinstall -m 0644 {*}[glob ${worksrcpath}/../*.{css,html,txt}] ${destroot}${docdir}
}
}
if {${subport} eq "${name}-lx"} {
# http://userguide.icu-project.org/layoutengine/paragraph
description ICU paragraph layout library
long_description {*}${description}
depends_build-append port:pkgconfig
depends_lib-append port:icu \
port:icu-le-hb
configure.args-replace --disable-layoutex --enable-layoutex
destroot.dir ${worksrcpath}/layoutex
}
if {${subport} eq "${name}-docs"} {
supported_archs noarch
description-append (documentation)
long_description-append Documentation.
use_zip yes
distname ${my_name}-[string map {. _} ${version}]-docs
checksums rmd160 5132c05255a982017540088fa5a133237f22510e \
sha256 d5a2b188a3bd55252d5fbcce75d563ec1ab574e31de626b40dc7b797f03d89b4 \
size 7913999
extract.dir ${worksrcpath}/doc/html
use_configure no
build {}
destroot {
xinstall -m 755 -d ${destroot}${docdir}
copy ${worksrcpath}/doc/html ${destroot}${docdir}
}
}
if {${subport} eq "${name}-doxygen-docs"} {
# remove after 20220407
PortGroup obsolete 1.0
replaced_by ${name}-docs
}
if {${subport} eq ${name}} {
livecheck.url http://site.icu-project.org/download
livecheck.regex "ICU (\[0-9.\]+) is now available."
} else {
livecheck.type none
}
# Note 1:
# prior to 10.14, universal means different library bit depths or endianness,
# so we had to build separately and lipo together using the muniversal PG
# We can't easily use the muniversal PG on darwin20+ (footnote 2), however we don't
# need to use it because the universal build there has the same library bit
# depth and endianness on both Intel and arm64. Therefore we can build universal in
# one pass using clang's ability to generate both archs at once.
# Note 2:
# ICU needs to run binaries when building, to generate its data.
# Simply disallowing cross compiling is the simplest solution, however
# that means that an x86_64/arm64 universal version can never be built on an Intel Mac.
# ancient refs: #29904, ancient solutions tried (r79660, r73865, and r73849)
# Note 3:
# Remove architecture-specific differences to allow merging. (See note 2).
# we do not believe icu-config uses SIZEOF_VOID_P. Projects using Makefile
# include files may experience problems. The developers of ICU suggest using
# pkg-config over both icu-config and the Makefile includes.
# calling icu-config for the host information is not mentioned in any
# icu man pages, differs between architectures, and can't be merged
# ICU has three mechanisms to aid other projects in building properly
# 1) .pc files for pkg-config
# 2) shell script icu-config that can output compiler flags
# 3) Makefile include files Makefile.inc and pkgdata.inc
# For a time, all three assumed other projects would want to be
# built as ICU had been built, regardless of whether it was appropriate.
# For the most part, the extraneous flags have been removed.
# 1) They have been removed completely from the .pc files.
# pkg-config is the recommended way of building against ICU.
# 2) icu-config does not print them out, but they are still contained in the script itself.
# 3) They still exist in the Makefile include files.
#
# for descriptions of the problem, see r101578, (#40069)
# https://bugs.gentoo.org/show_bug.cgi?id=202059
#
# for upstream reports and discussion, see
# http://bugs.icu-project.org/trac/ticket/10308
# http://bugs.icu-project.org/trac/ticket/6102