recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / libs / audiofile / recipe
blobf5f40f0cb5af1d0c51b0a2e198e96754dfff96de
1 # Build recipe for audiofile.
3 # Copyright (c) 2020 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=audiofile
18 version=0.3.6
19 release=1
21 # Define a category for the output of the package name
22 pkgcategory=libs
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://audiofile.68k.org/$tarname
29 description="
30 Audio file library.
32 The Audio File Library is a C-based library for reading and writing
33 audio files in many common formats.
35 The Audio File Library provides a uniform API which abstracts away
36 details of file formats and data formats. The same calls for opening
37 a file, accessing and manipulating audio metadata (e.g. sample rate,
38 sample format, textual information, MIDI parameters), and reading and
39 writing sample data will work with any supported audio file format.
41 The Audio File Library lets you work with audio data in whatever
42 format is most convenient for you.
45 homepage=http://audiofile.68k.org
46 license="LGPLv2.1, GPLv2+"
48 # Source documentation
49 docs="ACKNOWLEDGEMENTS AUTHORS COPYING* ChangeLog NEWS NOTES README TODO"
50 docsdir="${docdir}/${program}-${version}"
52 build()
54     set -e
56     unpack "${tardir}/$tarname"
58     cd "$srcdir"
60     # Update for hosts based on musl
61     cp -f "${worktree}/archive/common/config.guess" config.guess
62     cp -f "${worktree}/archive/common/config.sub" config.sub
64     # Apply patches from Debian to refresh this old source
65     while read -r line
66     do
67         patch -Np1 -i "${worktree}/patches/audiofile/${line}"
68     done < "${worktree}/patches/audiofile/series"
70     # Set sane permissions
71     chmod -R u+w,go-w,a+rX-s .
73     ./configure CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
74     LDFLAGS="$QILDFLAGS" \
75      $configure_args \
76      --libdir=/usr/lib${libSuffix} \
77      --mandir=$mandir \
78      --docdir=$docsdir \
79      --enable-shared=yes \
80      --enable-static=yes \
81      --build="$(cc -dumpmachine)"
83     make -j${jobs} V=1
84     make -j${jobs} DESTDIR="$destdir" install-strip
86     # Compress and link man pages (if needed)
87     if test -d "${destdir}/$mandir"
88     then
89         (
90             cd "${destdir}/$mandir"
91             find . -type f -exec lzip -9 '{}' +
92             find . -type l | while read -r file
93             do
94                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
95                 rm -- "$file"
96             done
97         )
98     fi
100     # Copy documentation
101     mkdir -p "${destdir}${docsdir}"
102     cp -p $docs "${destdir}${docsdir}"