recipes: x-apps/emacs: Enable emacs again, trying the -no-pie option
[dragora.git] / recipes / compressors / xz / recipe
blobce0f593dc1b541bc1014b340beeb4bef8cc54c7b
1 # Build recipe for xz.
3 # Copyright (c) 2016-2019, 2021 Matias Fonzo, <selk@dragora.org>.
4 # Copyright (c) 2022 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
19 set -e
21 program=xz
22 version=5.4.0
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=compressors
28 tarname=${program}-${version}.tar.bz2
30 # Remote source(s)
31 fetch=https://tukaani.org/xz/$tarname
33 description="
34 A (complex) compression utility based on the LZMA algorithm.
36 XZ Utils is free general-purpose data compression software with a high
37 compression ratio.  XZ Utils were written for POSIX-like systems, but
38 also work on some not-so-POSIX systems.
40 WARNING:
41   The usage of this utility to distribute files or backup your data
42 IS TOTALLY DISCOURAGED.  Limit its usage to decompression only,
43 since some maintainers refuse to distribute in a better format.
45 For more information, see https://lzip.nongnu.org/xz_inadequate.html
47 It is highly recommended the use of lzip(1) instead of xz(1).
50 homepage=https://tukaani.org/xz
51 license=GPLv2+
53 # Source documentation
54 docsdir="${docdir}/${program}-${version}"
56 build()
58     unpack "${tardir}/$tarname"
60     cd "$srcdir"
62     # Set sane permissions
63     chmod -R u+w,go-w,a+rX-s .
65     ./configure CPPFLAGS="$QICPPFLAGS" \
66     CFLAGS="$QICFLAGS" 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      --disable-rpath \
74      --disable-lzmadec \
75      --disable-lzmainfo \
76      --disable-lzma-links \
77      --build="$(gcc -dumpmachine)"
79     make -j${jobs} V=1
80     make -j${jobs} DESTDIR="$destdir" install-strip
82     # Compress and link man pages (if needed)
83     if test -d "${destdir}/$mandir"
84     then
85         (
86             cd "${destdir}/$mandir"
87             find . -type f -exec lzip -9 {} +
88             find . -type l | while read -r file
89             do
90                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
91                 rm -- "$file"
92             done
93         )
94     fi