1 # Build recipe for libunistring.
3 # Copyright (c) 2018 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/libs"
24 tarname=${program}-${version}.tar.gz
27 fetch=http://ftp.gnu.org/gnu/libunistring/$tarname
30 A library that provides functions for manipulating Unicode strings.
32 Text files are nowadays usually encoded in Unicode, and may consist of
33 very different scripts from Latin letters to Chinese Hanzi, with many
34 kinds of special characters accents, right-to-left writing marks,
35 hyphens, Roman numbers, and much more. But the POSIX platform APIs for
36 text do not contain adequate functions for dealing with particular
37 properties of many Unicode characters. In fact, the POSIX APIs for
38 text have several assumptions at their base which don't hold for
41 This library provides functions for manipulating Unicode strings and
42 for manipulating C strings according to the Unicode standard.
45 homepage=http://www.gnu.org/software/libunistring/
46 license="GPLv3+, LGPLv3+"
48 # Source documentation
49 docs="AUTHORS BUGS COPYING* HACKING NEWS README THANKS"
50 docsdir="${docdir}/${program}-${version}"
56 unpack "${tardir}/$tarname"
60 # Set sane permissions
61 chmod -R u+w,go-w,a+rX-s .
63 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
65 --libdir=/usr/lib${libSuffix} \
71 --enable-threads=posix \
72 --build="$(cc -dumpmachine)"
75 make -j${jobs} DESTDIR="$destdir" install-strip
77 # Delete generated charset.alias
78 rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
79 rmdir "${destdir}/usr/lib${libSuffix}/" 2> /dev/null || true
81 # Compress info documents deleting index file for the package
82 if test -d "${destdir}/$infodir"
84 rm -f "${destdir}/${infodir}/dir"
85 lzip -9 "${destdir}/${infodir}"/*
88 # Compress and link man pages (if needed)
89 if test -d "${destdir}/$mandir"
92 cd "${destdir}/$mandir"
93 find . -type f -exec lzip -9 '{}' +
94 find . -type l | while read -r file
96 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
103 mkdir -p "${destdir}${docsdir}"
104 cp -p $docs "${destdir}${docsdir}"/