Start mass upgrade
[dragora.git] / recipes / libs / icu / recipe
blobcc71decfa3066802cc71fedbfc2021b54967ea85
1 # Build recipe for icu.
3 # Copyright (c) 2019-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=icu4c
21 version=70_1
22 release=1
24 # Set custom name and custom version for the package
25 pkgname=icu
26 pkgversion="$(echo $version | tr _ .)"
28 # Define a category for the output of the package name
29 pkgcategory=libs
31 tarname=${program}-${version}-src.tgz
33 # Remote source(s)
34 fetch="https://github.com/unicode-org/icu/releases/download/release-$(printf $version | tr _ -)/$tarname"
36 description="
37 International Components for Unicode.
39 The International Components for Unicode (icu) package is a mature,
40 widely used set of C/C++ libraries providing Unicode and
41 Globalization support for software applications. ICU is widely
42 portable and gives applications the same results on all platforms.
45 homepage=https://site.icu-project.org
46 license="ICU License"
48 # Source documentation
49 docs="LICENSE icu4c.css license.html readme.html"
50 docsdir="${docdir}/${program}-${version}"
52 # The source has a custom source directory
53 srcdir=icu
55 build()
57     unpack "${tardir}/$tarname"
59     cd "${srcdir}"/source
61     # Set sane permissions
62     chmod -R u+w,go-w,a+rX-s .
64     ./configure CC=gcc CXX=g++ \
65     CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
66     LDFLAGS="$QILDFLAGS" \
67      $configure_args \
68      --libdir=/usr/lib${libSuffix} \
69      --mandir=$mandir \
70      --docdir=$docsdir \
71      --enable-static=no \
72      --enable-shared=yes \
73      --enable-icu-config \
74      --disable-tests \
75      --build="$(gcc -dumpmachine)"
77     make -j${jobs} V=1
78     make -j${jobs} DESTDIR="$destdir" install
80     # Copy documentation
82     cd ../
84     mkdir -p "${destdir}${docsdir}"
85     cp -p $docs "${destdir}${docsdir}"
87     # Compress and link man pages (if needed)
88     if test -d "${destdir}/$mandir"
89     then
90         (
91             cd "${destdir}/$mandir"
92             find . -type f -exec lzip -9 {} +
93             find . -type l | while read -r file
94             do
95                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
96                 rm -- "$file"
97             done
98         )
99     fi