stages: 2/04-iso: Do not include kernel build/source tree in the LiveCD
[dragora.git] / recipes / libs / libunistring / recipe
blobcb1d1cdab0f5e9a862ed43748ea793a6deaaaa99
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
18 set -e
20 program=libunistring
21 version=1.1
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=libs
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://ftp.gnu.org/gnu/libunistring/$tarname
32 description="
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
42 Unicode text.
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}"
55 build()
57     unpack "${tardir}/$tarname"
59     cd "$srcdir"
61     # Set sane permissions
62     chmod -R u+w,go-w,a+rX-s .
64     ./configure CPPFLAGS="$QICPPFLAGS" \
65     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
66      $configure_args \
67      --libdir=/usr/lib${libSuffix} \
68      --infodir=$infodir \
69      --mandir=$mandir \
70      --docdir=$docsdir \
71      --enable-static=no \
72      --enable-shared=yes \
73      --enable-threads=posix \
74      --build="$(gcc -dumpmachine)"
76     make -j${jobs} V=1
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"
85     then
86         rm -f "${destdir}/${infodir}/dir"
87         lzip -9 "${destdir}/${infodir}"/*
88     fi
90     # Compress and link man pages (if needed)
91     if test -d "${destdir}/$mandir"
92     then
93         (
94             cd "${destdir}/$mandir"
95             find . -type f -exec lzip -9 {} +
96             find . -type l | while read -r file
97             do
98                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
99                 rm -- "$file"
100             done
101         )
102     fi
104     # Copy documentation
105     mkdir -p "${destdir}/$docsdir"
106     cp -p $docs "${destdir}/$docsdir"