recipe 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # Build recipe for isapnptools.
  2. #
  3. # Copyright (c) 2017-2018 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. program=isapnptools
  17. version=1.27
  18. release=3
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/tools"
  21. tarname=${program}-${version}.tgz
  22. # Remote source(s)
  23. fetch=http://www.roestockfox.co.uk/files/isapnptools/$tarname
  24. description="
  25. ISA plug and play configuration utility.
  26. Two programs, one allows the dumping of resource data and generation of
  27. a skeleton configuration file, the other configures ISA PnP hardware
  28. using a configuration file.
  29. "
  30. homepage=http://www.roestockfox.co.uk/isapnptools/index.html
  31. license=GPLv2+
  32. # Source documentation
  33. docs="AUTHORS COPYING ChangeLog NEWS README"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. # Check architecture
  38. case $arch in
  39. i?86)
  40. true
  41. ;;
  42. *)
  43. echo "isapnptools is for the x86 platform-only ..." 1>&2
  44. return 0
  45. ;;
  46. esac
  47. set -e
  48. unpack "${tardir}/$tarname"
  49. cd "$srcdir"
  50. # Set sane permissions
  51. chmod -R u+w,go-w,a+rX-s .
  52. # Fix compilation on musl
  53. patch -p0 < "${worktree}/patches/isapnptools/isapnptools-musl.patch"
  54. # Apply fixes from NetBSD (thanks!)
  55. # ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/sysutils/isapnptools/patches/
  56. for file in patch-aa patch-ab patch-ac patch-ad patch-ae
  57. do
  58. patch -p0 < "${worktree}/patches/isapnptools/$file"
  59. done
  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
  63. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  64. $configure_args \
  65. --libdir=/usr/lib${libSuffix} \
  66. --mandir=$mandir \
  67. --disable-realtime \
  68. --disable-pci \
  69. --build="$(cc -dumpmachine)"
  70. make -j${jobs} V=1
  71. make -j${jobs} DESTDIR="$destdir" install
  72. # Compress and link man pages (if needed)
  73. if test -d "${destdir}/$mandir"
  74. then
  75. (
  76. cd "${destdir}/$mandir"
  77. find . -type f -exec lzip -9 '{}' +
  78. find . -type l | while read -r file
  79. do
  80. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  81. rm -- "$file"
  82. done
  83. )
  84. fi
  85. # Copy documentation
  86. mkdir -p "${destdir}${docsdir}"
  87. cp -p $docs "${destdir}${docsdir}"
  88. }