recipes: Replace 'outdir' with package hash tags
[dragora.git] / recipes / libs / icu / recipe
blob6785a75d5c4ca97e9cf14124f19d006db6542c30
1 # Build recipe for icu.
3 # Copyright (c) 2019 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 program=icu4c
18 version=65_1
19 release=1
21 # Set custom name and custom version for the package
22 pkgname=icu
23 pkgversion=65.1
25 # Define hash tag to categorize the package name output
26 pkghashtag=libs
28 tarname=${program}-${version}-src.tgz
30 # Remote source(s)
31 fetch="http://github.com/unicode-org/icu/releases/download/release-$(printf $version | tr _ -)/$tarname"
33 description="
34 International Components for Unicode.
36 The International Components for Unicode (icu) package is a mature,
37 widely used set of C/C++ libraries providing Unicode and
38 Globalization support for software applications. ICU is widely
39 portable and gives applications the same results on all platforms.
42 homepage=http://site.icu-project.org
43 license="ICU License"
45 # Source documentation
46 docs="LICENSE icu4c.css license.html readme.html"
47 docsdir="${docdir}/${program}-${version}"
49 # The source has a custom source directory
50 srcdir=icu
52 build()
54     set -e
56     unpack "${tardir}/$tarname"
58     cd "${srcdir}"/source
60     # Set sane permissions
61     chmod -R u+w,go-w,a+rX-s .
63     ./configure CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
64     LDFLAGS="$QILDFLAGS" \
65      $configure_args \
66      --libdir=/usr/lib${libSuffix} \
67      --mandir=$mandir \
68      --docdir=$docsdir \
69      --enable-static=no \
70      --enable-shared=yes \
71      --enable-icu-config \
72      --disable-samples \
73      --disable-tests \
74      --build="$(cc -dumpmachine)"
76     make -j${jobs} V=1
77     make -j${jobs} DESTDIR="$destdir" install
79     # Copy documentation
81     cd ../
83     mkdir -p "${destdir}${docsdir}"
84     cp -p $docs "${destdir}${docsdir}"
86     # Compress and link man pages (if needed)
87     if test -d "${destdir}/$mandir"
88     then
89         (
90             cd "${destdir}/$mandir"
91             find . -type f -exec lzip -9 '{}' +
92             find . -type l | while read -r file
93             do
94                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
95                 rm -- "$file"
96             done
97         )
98     fi