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
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.gz
31 fetch=https://ftp.gnu.org/pub/gnu/libffcall/$tarname
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:
40 Calling C functions with variable arguments.
43 C functions accepting variable argument prototypes.
46 Closures as first-class C functions.
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/
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
65 unpack "${tardir}/$tarname"
69 # Set sane permissions
70 chmod -R u+w,go-w,a+rX-s .
73 CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
75 --libdir=/usr/lib${libSuffix} \
78 --htmldir=${docsdir}/html \
81 --build="$(gcc -dumpmachine)"
85 make -j${jobs} DESTDIR="$destdir" install
87 # Compress and link man pages (if needed)
88 if test -d "${destdir}/$mandir"
91 cd "${destdir}/$mandir"
92 find . -type f -exec lzip -9 {} +
93 find . -type l | while read -r file
95 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
103 mkdir -p "${destdir}/$docsdir"
105 # Move wrong HTML directory
106 mv "${destdir}/usr/share/html" "${destdir}/$docsdir"
108 cp -p $docs "${destdir}/$docsdir"