recipe 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Build recipe for libffi.
  2. #
  3. # Copyright (c) 2017 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=libffi
  17. version=3.2.1
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/libs"
  21. description="
  22. A high level programming interface to various calling conventions.
  23. The libffi library provides a portable, high level programming
  24. interface to various calling conventions. This allows a programmer to
  25. call any function specified by a call interface description at run time.
  26. "
  27. homepage=http://sourceware.org/libffi/
  28. license=BSD
  29. tarname=${program}-${version}.tar.gz
  30. # Remote source(s)
  31. fetch=ftp://sourceware.org/pub/libffi/$tarname
  32. # Parallel jobs for the compiler
  33. jobs=1
  34. # Source documentation
  35. docs="ChangeLog LICENSE README"
  36. docsdir="${docdir}/${program}-${version}"
  37. build() {
  38. set -e
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Set sane permissions
  42. chmod -R u+w,go-w,a+rX-s .
  43. # Sanitize the header installation path
  44. patch -p0 < "${worktree}/patches/libffi/libffi-paths.patch"
  45. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  46. $configure_args \
  47. --libdir=/usr/lib${libSuffix} \
  48. --infodir=$infodir \
  49. --mandir=$mandir \
  50. --docdir=$docsdir \
  51. --build="$(cc -dumpmachine)"
  52. make -j${jobs} V=1
  53. make -j${jobs} DESTDIR="$destdir" install-strip
  54. # Compress info documents deleting index file for the package
  55. if test -d "${destdir}/$infodir"
  56. then
  57. rm -f "${destdir}/${infodir}/dir"
  58. lzip -9 "${destdir}/${infodir}"/*
  59. fi
  60. # Compress manual pages
  61. if [ -d "${destdir}/$mandir" ] ; then
  62. (
  63. cd "${destdir}/$mandir"
  64. find . -type f -exec lzip -9 '{}' +
  65. find . -type l | while read -r file
  66. do
  67. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  68. rm -- "$file"
  69. done
  70. )
  71. fi
  72. # Copy documentation
  73. mkdir -p "${destdir}${docsdir}"
  74. cp -p $docs "${destdir}${docsdir}/"
  75. }