1 # Build recipe for libunistring.
3 # Copyright (c) 2018, 2022 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.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.gz
30 fetch=https://ftp.gnu.org/gnu/libunistring/$tarname
33 A library that provides functions for manipulating Unicode strings.
35 Text files are nowadays usually encoded in Unicode, and may consist of
36 very different scripts from Latin letters to Chinese Hanzi, with many
37 kinds of special characters accents, right-to-left writing marks,
38 hyphens, Roman numbers, and much more. But the POSIX platform APIs for
39 text do not contain adequate functions for dealing with particular
40 properties of many Unicode characters. In fact, the POSIX APIs for
41 text have several assumptions at their base which don't hold for
44 This library provides functions for manipulating Unicode strings and
45 for manipulating C strings according to the Unicode standard.
48 homepage=https://www.gnu.org/software/libunistring/
49 license="GPLv3+, LGPLv3+"
51 # Source documentation
52 docs="AUTHORS BUGS COPYING* HACKING NEWS README THANKS"
53 docsdir="${docdir}/${program}-${version}"
57 unpack "${tardir}/$tarname"
61 # Set sane permissions
62 chmod -R u+w,go-w,a+rX-s .
64 ./configure CPPFLAGS="$QICPPFLAGS" \
65 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
67 --libdir=/usr/lib${libSuffix} \
73 --enable-threads=posix \
74 --build="$(gcc -dumpmachine)"
77 make -j${jobs} DESTDIR="$destdir" install-strip
79 # Delete generated charset.alias
80 rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
81 rmdir "${destdir}/usr/lib${libSuffix}/" 2> /dev/null || true
83 # Compress info documents deleting index file for the package
84 if test -d "${destdir}/$infodir"
86 rm -f "${destdir}/${infodir}/dir"
87 lzip -9 "${destdir}/${infodir}"/*
90 # Compress and link man pages (if needed)
91 if test -d "${destdir}/$mandir"
94 cd "${destdir}/$mandir"
95 find . -type f -exec lzip -9 {} +
96 find . -type l | while read -r file
98 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
105 mkdir -p "${destdir}/$docsdir"
106 cp -p $docs "${destdir}/$docsdir"