recipes: upgrade libevent to snapshot 246f440 and tmux to version 2.8
[dragora.git] / recipes / libs / libevent / recipe
blob34c655f64a4f15f3068b923496c74736a3ccb5e7
1 # Build recipe for libevent.
3 # Copyright 2018 Mateus P. Rodrigues <mprodrigues@dragora.org>.
4 # Copyright 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=libevent
19 version=246f44041e0782f728fa5ff2d39113005a1ab02d
20 release=1
22 pkgversion=246f440
24 # Set 'outdir' for a nice and well-organized output directory
25 outdir="${outdir}/${arch}/libs"
27 tarname=${program}-${version}.tar.lz
29 # Remote source(s)
30 fetch="
31  http://rsync.dragora.org/current/sources/$tarname
32  http://csphy.blue/dragora/mirror/current/sources/$tarname
35 description="
36 An event notification library.
38 The libevent API provides a mechanism to execute a callback function
39 when a specific event occurs on a file descriptor or after a timeout
40 has been reached.  Furthermore, libevent also support callbacks due
41 to signals or regular timeouts.
44 homepage=http://libevent.org/
45 license="3-clause BSD"
47 # Source documentation
48 docs="ChangeLog* LICENSE"
49 docsdir="${docdir}/${program}-${pkgversion}"
51 build()
53     set -e
55     unpack "${tardir}/$tarname"
57     cd "$srcdir"
59     # Set sane permissions
60     chmod -R u+w,go-w,a+rX-s .
62     sh ./autogen.sh
64     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
65      $configure_args \
66      --libdir=/usr/lib${libSuffix} \
67      --docdir=$docsdir \
68      --build="$(cc -dumpmachine)"
70     make -j${jobs} V=1
71     make -j${jobs} DESTDIR="$destdir" install
73     # Strip remaining binaries and libraries
74     find "$destdir" -type f | xargs file | \
75      awk '/ELF/ && /executable/ || /shared object/' | \
76       cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
78     find "$destdir" -type f | xargs file | awk '/current ar archive/' | \
79      cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
81     # Copy documentation
82     mkdir -p "${destdir}${docsdir}"
83     cp -p $docs "${destdir}${docsdir}"