stages: 2/*: Adjust options for build the ISO
[dragora.git] / recipes / libs / libffcall / recipe
blob4db2476d7482d570ef786223dac2e26e8c089b84
1 # Build recipe for libffcall.
3 # Copyright (c) 2017 MMPG, <mmpg@vp.pl>.
4 # Copyright (c) 2017-2019, 2021 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=libffcall
22 version=2.4
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=libs
28 tarname=${program}-${version}.tar.gz
30 # Remote source(s)
31 fetch=https://ftp.gnu.org/pub/gnu/libffcall/$tarname
33 description="
34 Foreign function call libraries.
36 GNU libffcall is a collection of four libraries which can be used to
37 build foreign function call interfaces in embedded interpreters:
39 * avcall
40 Calling C functions with variable arguments.
42 * vacall
43 C functions accepting variable argument prototypes.
45 * trampoline
46 Closures as first-class C functions.
48 * callback
49 Closures with variable arguments as first-class C functions
50 (a reentrant combination of vacall and trampoline).
53 homepage=https://www.gnu.org/software/libffcall/
54 license=GPLv3+
56 # Source doucmentation
57 docs="COPYING ChangeLog DEPENDENCIES NEWS README VERSION"
58 docsdir="${docdir}/${program}-${version}"
60 # Set paralell jobs to 1 for a sucessful compilation
61 jobs=1
63 build()
65     unpack "${tardir}/$tarname"
66         
67     cd "$srcdir"
69     # Set sane permissions
70     chmod -R u+w,go-w,a+rX-s .
72     ./configure \
73     CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
74      $configure_args \
75      --libdir=/usr/lib${libSuffix} \
76      --mandir=$mandir \
77      --docdir=$docsdir \
78      --htmldir=${docsdir}/html \
79      --enable-static=yes \
80      --enable-shared=yes \
81      --build="$(gcc -dumpmachine)"
83     make -j${jobs}
84     make -k check
85     make -j${jobs} DESTDIR="$destdir" install
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
101     # Copy documentation
103     mkdir -p "${destdir}/$docsdir"
105     # Move wrong HTML directory
106     mv "${destdir}/usr/share/html" "${destdir}/$docsdir"
108     cp -p $docs "${destdir}/$docsdir"