Continue with the upgrades...
[dragora.git] / recipes / libs / audiofile / recipe
blobfe4dc13319bc8d5f96235684a898c9dc14399fc1
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 # Exit immediately on any error
18 set -e
20 program=audiofile
21 version=0.3.6
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=libs
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://audiofile.68k.org/$tarname
32 description="
33 Audio file library.
35 The Audio File Library is a C-based library for reading and writing
36 audio files in many common formats.
38 The Audio File Library provides a uniform API which abstracts away
39 details of file formats and data formats. The same calls for opening
40 a file, accessing and manipulating audio metadata (e.g. sample rate,
41 sample format, textual information, MIDI parameters), and reading and
42 writing sample data will work with any supported audio file format.
44 The Audio File Library lets you work with audio data in whatever
45 format is most convenient for you.
48 homepage=https://audiofile.68k.org
49 license="LGPLv2.1, GPLv2+"
51 # Source documentation
52 docs="ACKNOWLEDGEMENTS AUTHORS COPYING* ChangeLog NEWS NOTES README TODO"
53 docsdir="${docdir}/${program}-${version}"
55 build()
57     unpack "${tardir}/$tarname"
59     cd "$srcdir"
61     # Update for hosts based on musl
62     cp -f "${worktree}/archive/common/config.guess" config.guess
63     cp -f "${worktree}/archive/common/config.sub" config.sub
65     # Apply patches from Debian to refresh this old source
66     while read -r line
67     do
68         patch -Np1 -i "${worktree}/patches/audiofile/${line}"
69     done < "${worktree}/patches/audiofile/series"
71     # Set sane permissions
72     chmod -R u+w,go-w,a+rX-s .
74     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
75     LDFLAGS="$QILDFLAGS" \
76      $configure_args \
77      --libdir=/usr/lib${libSuffix} \
78      --mandir=$mandir \
79      --docdir=$docsdir \
80      --enable-shared=yes \
81      --enable-static=yes \
82      --build="$(gcc -dumpmachine)"
84     make -j${jobs} V=1
85     make -j${jobs} DESTDIR="$destdir" install-strip
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
102     mkdir -p "${destdir}${docsdir}"
103     cp -p $docs "${destdir}${docsdir}"