1 # Build recipe for isapnptools.
3 # Copyright (c) 2017-2018 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.
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/tools"
24 tarname=${program}-${version}.tgz
27 fetch=http://www.roestockfox.co.uk/files/isapnptools/$tarname
30 ISA plug and play configuration utility.
32 Two programs, one allows the dumping of resource data and generation of
33 a skeleton configuration file, the other configures ISA PnP hardware
34 using a configuration file.
37 homepage=http://www.roestockfox.co.uk/isapnptools/index.html
40 # Source documentation
41 docs="AUTHORS COPYING ChangeLog NEWS README"
42 docsdir="${docdir}/${program}-${version}"
53 echo "isapnptools is for the x86 platform-only ..." 1>&2
60 unpack "${tardir}/$tarname"
64 # Set sane permissions
65 chmod -R u+w,go-w,a+rX-s .
67 # Fix compilation on musl
68 patch -p0 < "${worktree}/patches/isapnptools/isapnptools-musl.patch"
70 # Apply fixes from NetBSD (thanks!)
71 # ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/sysutils/isapnptools/patches/
72 for file in patch-aa patch-ab patch-ac patch-ad patch-ae
74 patch -p0 < "${worktree}/patches/isapnptools/$file"
77 # Update for hosts based on musl
78 cp -f "${worktree}/archive/common/config.guess" config.guess
79 cp -f "${worktree}/archive/common/config.sub" config.sub
81 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
83 --libdir=/usr/lib${libSuffix} \
87 --build="$(cc -dumpmachine)"
90 make -j${jobs} DESTDIR="$destdir" install
92 # Compress and link man pages (if needed)
93 if test -d "${destdir}/$mandir"
96 cd "${destdir}/$mandir"
97 find . -type f -exec lzip -9 '{}' +
98 find . -type l | while read -r file
100 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
107 mkdir -p "${destdir}${docsdir}"
108 cp -p $docs "${destdir}${docsdir}"