1SUMMARY="The GNU iconv implementation to convert text encodings"
2DESCRIPTION="For historical reasons, international text is often encoded using \
3a language or country dependent character encoding. With the advent of the \
4internet and the frequent exchange of text across countries - even the \
5viewing of a web page from a foreign country is a \"text exchange\" in \
6this context -, conversions between these encodings have become important. \
7They have also become a problem, because many characters which are present \
8in one encoding are absent in many other encodings. To solve this mess, the \
9Unicode encoding has been created. It is a super-encoding of all others and \
10is therefore the default encoding for new text formats like XML.
11
12Still, many computers still operate in locale with a traditional (limited) \
13character encoding. Some programs, like mailers and web browsers, must be able \
14to convert between a given text encoding and the user's encoding. Other \
15programs internally store strings in Unicode, to facilitate internal \
16processing, and need to convert between internal string representation \
17(Unicode) and external string representation (a traditional encoding) when \
18they are doing I/O. GNU libiconv is a conversion library for both kinds of \
19applications.
20
21This library provides an iconv() implementation, for use on systems which \
22don't have one, or whose implementation cannot convert from/to Unicode.
23It provides support for these encodings:
24
25European languages
26- ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16}, KOI8-R, KOI8-U, KOI8-RU, \
27CP{1250,1251,1252,1253,1254,1257}, CP{850,866,1131}, \
28Mac{Roman,CentralEurope,Iceland,Croatian,Romania}, \
29Mac{Cyrillic,Ukraine,Greek,Turkish}, Macintosh
30Semitic languages
31- ISO-8859-{6,8}, CP{1255,1256}, CP862, Mac{Hebrew,Arabic}
32Japanese
33- EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-2, ISO-2022-JP-1
34Chinese
35- EUC-CN, HZ, GBK, CP936, GB18030, EUC-TW, BIG5, CP950, BIG5-HKSCS, \
36BIG5-HKSCS:2004, BIG5-HKSCS:2001, BIG5-HKSCS:1999, ISO-2022-CN, ISO-2022-CN-EXT
37Korean
38- EUC-KR, CP949, ISO-2022-KR, JOHAB
39Armenian
40- ARMSCII-8
41Georgian
42- Georgian-Academy, Georgian-PS
43Tajik
44- KOI8-T
45Kazakh
46- PT154, RK1048
47Thai
48- ISO-8859-11, TIS-620, CP874, MacThai
49Laotian
50- MuleLao-1, CP1133
51Vietnamese
52- VISCII, TCVN, CP1258
53Platform specifics
54- HP-ROMAN8, NEXTSTEP
55Full Unicode
56- UTF-8
57- UCS-2, UCS-2BE, UCS-2LE
58- UCS-4, UCS-4BE, UCS-4LE
59- UTF-16, UTF-16BE, UTF-16LE
60- UTF-32, UTF-32BE, UTF-32LE
61- UTF-7
62- C99, JAVA
63Full Unicode, in terms of uint16_t or uint32_t (with machine dependent \
64endianness and alignment)
65- UCS-2-INTERNAL, UCS-4-INTERNAL
66Locale dependent, in terms of 'char' or 'wchar_t' (with machine dependent \
67endianness and alignment, and with OS and locale dependent semantics)
68- char, wchar_t
69- The empty encoding name \"\" is equivalent to \"char\": it denotes the \
70locale dependent character encoding.
71
72When configured with the option --enable-extra-encodings, it also provides \
73support for a few extra encodings:
74European languages
75- CP{437,737,775,852,853,855,857,858,860,861,863,865,869,1125}
76Semitic languages
77- CP864
78Japanese
79- EUC-JISX0213, Shift_JISX0213, ISO-2022-JP-3
80Chinese
81- BIG5-2003 (experimental)
82Turkmen
83- TDS565
84Platform specifics
85- ATARIST, RISCOS-LATIN1
86
87It can convert from any of these encodings to any other, through Unicode \
88conversion.
89It has also some limited support for transliteration, i.e. when a character \
90cannot be represented in the target character set, it can be approximated \
91through one or several similarly looking characters. Transliteration is \
92activated when \"//TRANSLIT\" is appended to the target encoding name.
93
94libiconv is for you if your application needs to support multiple character \
95encodings, but that support lacks from your system."
96HOMEPAGE="https://www.gnu.org/software/libiconv/"
97COPYRIGHT="2000-2022 Free Software Foundation, Inc."
98LICENSE="GNU LGPL v2
99	GNU GPL v3"
100REVISION="3"
101SOURCE_URI="https://ftpmirror.gnu.org/libiconv/libiconv-$portVersion.tar.gz"
102CHECKSUM_SHA256="8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313"
103PATCHES="libiconv-$portVersion.patchset"
104
105ARCHITECTURES="all"
106SECONDARY_ARCHITECTURES="x86"
107
108libiconvVersion="2.6.1"
109libcharsetVersion="1.0.0"
110
111portVersionCompat="$portVersion compat >= 1.13"
112libiconvVersionCompat="$libiconvVersion compat >= ${libiconvVersion%%.*}"
113libcharsetVersionCompat="$libcharsetVersion compat >= ${libcharsetVersion%%.*}"
114
115PROVIDES="
116	libiconv$secondaryArchSuffix = $portVersionCompat
117	lib:libiconv$secondaryArchSuffix = $libiconvVersionCompat
118	lib:libcharset$secondaryArchSuffix = $libcharsetVersionCompat
119	"
120if [ -z "$secondaryArchSuffix" ]; then
121	PROVIDES="$PROVIDES
122		cmd:iconv = $libiconvVersionCompat
123		"
124fi
125
126REQUIRES="
127	haiku$secondaryArchSuffix
128	"
129
130PROVIDES_devel="
131	libiconv${secondaryArchSuffix}_devel = $portVersionCompat
132	devel:libiconv${secondaryArchSuffix} = $libiconvVersionCompat
133	devel:libcharset${secondaryArchSuffix} = $libcharsetVersionCompat
134	"
135REQUIRES_devel="
136	libiconv$secondaryArchSuffix == $portVersion base
137	"
138
139BUILD_REQUIRES="
140	haiku${secondaryArchSuffix}_devel
141	"
142BUILD_PREREQUIRES="
143	cmd:awk
144	cmd:gcc$secondaryArchSuffix
145	cmd:ld$secondaryArchSuffix
146	cmd:libtoolize$secondaryArchSuffix
147	cmd:make
148	"
149
150if [ -z "$secondaryArchSuffix" ]; then
151	defineDebugInfoPackage libiconv$secondaryArchSuffix \
152		$binDir/iconv \
153		$libDir/libiconv.so.$libiconvVersion \
154		$libDir/libcharset.so.$libcharsetVersion
155else
156	defineDebugInfoPackage libiconv$secondaryArchSuffix \
157		$libDir/libiconv.so.$libiconvVersion \
158		$libDir/libcharset.so.$libcharsetVersion
159fi
160
161BUILD()
162{
163	ln -s build-aux/compile compile || true
164	runConfigure ./configure \
165		--enable-relocatable \
166		--enable-shared \
167		--disable-static \
168		--disable-nls \
169		--enable-extra-encodings
170	make $jobArgs
171}
172
173INSTALL()
174{
175	ACLOCALDIR=$prefix/data/aclocal
176	mkdir -p ${ACLOCALDIR}
177	cp -f srcm4/iconv.m4 ${ACLOCALDIR}/iconv.m4
178	make install
179
180	rm $libDir/*.la
181
182	# remove command for secondary architecture
183	if [ -n "$secondaryArchSuffix" ]; then
184		rm -rf $binDir
185	fi
186
187	prepareInstalledDevelLibs libiconv libcharset
188
189	# devel package
190	packageEntries devel \
191		$developDir \
192		$manDir/man3 \
193		$dataDir \
194		$docDir/*.3.html
195}
196
197TEST()
198{
199	make check
200}
201