stages/1: do not build gettext-tiny here since this will be built from 00-core.order...
[dragora.git] / recipes / x-apps / feh / recipe
blob5cd7dd3360deb6b1322d598beed154f84cbcb6cf
1 # Build recipe for feh.
3 # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
4 # Copyright (c) 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=feh
19 version=3.1.1
20 release=1
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/x-apps"
25 tarname=${program}-${version}.tar.bz2
27 # Remote source(s)
28 fetch=http://feh.finalrewind.org/"$tarname"
30 description="
31 A fast and light image viewer.
33 Feh is a fast, lightweight image viewer which uses imlib2.  It is
34 command line-driven and supports multiple images through slideshows,
35 thumbnail browsing or multiple windows, and montages or index prints 
36 (using TrueType fonts to display file info).  Advanced features include
37 fast dynamic zooming, progressive loading, loading via HTTP (with
38 reload support for watching webcams), recursive file opening (slideshow
39 of a directory hierarchy), and mouse wheel/keyboard control. 
42 homepage=http://feh.finalrewind.org
43 license="MIT Expat variant"
45 # Source documentation
46 docs="AUTHORS COPYING ChangeLog README.md TODO"
47 docsdir="${docdir}/${program}-${version}"
49 # Limit parallel jobs for this build
50 jobs=1
52 build()
54     set -e
56     unpack "${tardir}/$tarname"
58     cd "$srcdir"
60     # Apply patch from Dragora adding a missing header in getopt.c
61     patch -p1 < "${worktree}/patches/feh/getopt.c_header"
63     # Replace default C flags with the ones provided by Qi
64     sed -i "s/-g -O2/$QICFLAGS/" config.mk
66     make -j${jobs} V=1 PREFIX=/usr
67     make -j${jobs} V=1 \
68      PREFIX=/usr \
69      doc_dir="$destdir/$docsdir" \
70      example_dir="$destdir/${docsdir}/examples" \
71      DESTDIR="$destdir" install
73     strip --strip-unneeded "${destdir}/usr/bin/feh"
75     # Compress and link man pages (if needed)
76     if test -d "${destdir}/$mandir"
77     then
78         (
79             cd "${destdir}/$mandir"
80             find . -type f -exec lzip -9 '{}' +
81             find . -type l | while read -r file
82             do
83                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
84                 rm -- "$file"
85             done
86         )
87     fi
89     # Copy documentation
90     mkdir -p "${destdir}${docsdir}"
91     cp -p $docs "${destdir}${docsdir}/"