website: move footer.t2t to the section that belongs (according to language)
[dragora.git] / recipes / libs / libffcall / recipe
bloba0305268c0292edfdef9067cb5405f9b583dfe33
1 # Build recipe for libffcall.
3 # Copyright (c) 2017 MMPG, <mmpg@vp.pl>.
4 # Copyright (c) 2017-2018 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 program=libffcall
19 version=2.1
20 release=1
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/libs"
25 tarname=${program}-${version}.tar.gz
27 # Remote source(s)
28 fetch=http://ftp.gnu.org/pub/gnu/libffcall/$tarname
30 description="
31 Foreign function call libraries.
33 GNU libffcall is a collection of four libraries which can be used to
34 build foreign function call interfaces in embedded interpreters:
36 * avcall
37 Calling C functions with variable arguments.
39 * vacall
40 C functions accepting variable argument prototypes.
42 * trampoline
43 Closures as first-class C functions.
45 * callback
46 Closures with variable arguments as first-class C functions
47 (a reentrant combination of vacall and trampoline).
50 homepage=http://www.gnu.org/software/libffcall/
51 license=GPLv3+
53 # Source doucmentation
54 docs="COPYING ChangeLog DEPENDENCIES NEWS README VERSION"
55 docsdir="${docdir}/${program}-${version}"
57 # Set paralell jobs to 1 for a sucessful compilation
58 jobs=1
60 build()
62     set -e
64     unpack "${tardir}/$tarname"
65         
66     cd "$srcdir"
68     # Set sane permissions
69     chmod -R u+w,go-w,a+rX-s .
71     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
72      $configure_args \
73      --libdir=/usr/lib${libSuffix} \
74      --mandir=$mandir \
75      --docdir=$docsdir \
76      --htmldir=${docsdir}/html \
77      --enable-static \
78      --disable-shared \
79      --build="$(cc -dumpmachine)"
81     make -j${jobs}
82     #make -k check
83     make -j${jobs} DESTDIR="$destdir" install
85     #strip --strip-unneeded "${destdir}/usr/lib${libSuffix}"/*.so.0
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}/"