recipe 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Build recipe for mpc.
  2. #
  3. # Copyright (c) 2015-2019 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=mpc
  17. version=1.1.0
  18. release=2
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/libs"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=ftp://ftp.gnu.org/gnu/mpc/$tarname
  24. description="
  25. Library for the arithmetic of complex numbers.
  26. The MPC package contains a library for the arithmetic of complex
  27. numbers with arbitrarily high precision and correct rounding of
  28. the result.
  29. "
  30. homepage=http://www.multiprecision.org
  31. license=LGPLv3+
  32. # Source documentation
  33. docs="AUTHORS COPYING* ChangeLog NEWS README TODO"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Update for hosts based on musl
  41. cp -f "${worktree}/archive/common/config.guess" config.guess
  42. cp -f "${worktree}/archive/common/config.sub" config.sub
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  46. $configure_args \
  47. --libdir=/usr/lib${libSuffix} \
  48. --infodir=$infodir \
  49. --with-gmp=/usr \
  50. --enable-static \
  51. --enable-shared \
  52. --build="$(cc -dumpmachine)"
  53. make -j${jobs}
  54. make -j${jobs} check
  55. make -j${jobs} DESTDIR="$destdir" install-strip
  56. # Compress info documents deleting index file for the package
  57. if test -d "${destdir}/$infodir"
  58. then
  59. rm -f "${destdir}/${infodir}/dir"
  60. lzip -9 "${destdir}/${infodir}"/*
  61. fi
  62. # Copy documentation
  63. mkdir -p "${destdir}${docsdir}"
  64. cp -p $docs "${destdir}${docsdir}"
  65. }