recipe 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Build recipe for gmp.
  2. #
  3. # Copyright (c) 2015-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=gmp
  17. version=6.1.2
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/libs"
  21. tarname=${program}-${version}.tar.lz
  22. # Remote source(s)
  23. fetch=ftp://ftp.gnu.org/gnu/gmp/$tarname
  24. description="
  25. GNU multiple precision arithmetic library.
  26. GMP is a free library for arbitrary precision arithmetic, operating
  27. on signed integers, rational numbers, and floating-point numbers.
  28. There is no practical limit to the precision except the ones implied
  29. by the available memory in the machine GMP runs on.
  30. GMP has a rich set of functions, and the functions have a regular
  31. interface.
  32. "
  33. homepage=http://gmplib.org
  34. license="GPLv2+, GPLv3+, LGPLv3+"
  35. # Source documentation
  36. docs="AUTHORS COPYING* ChangeLog NEWS README"
  37. docsdir="${docdir}/${program}-${version}"
  38. build()
  39. {
  40. set -e
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. # Update for hosts based on musl
  46. cp -f "${worktree}/archive/common/config.guess" config.guess
  47. cp -f "${worktree}/archive/common/config.sub" config.sub
  48. ./configure \
  49. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  50. $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --infodir=$infodir \
  53. --docdir=$docsdir \
  54. --enable-cxx \
  55. --enable-static \
  56. --enable-shared \
  57. --without-readline \
  58. --build="$(cc -dumpmachine)"
  59. make -j${jobs}
  60. make -j${jobs} check
  61. make -j${jobs} DESTDIR="$destdir" install-strip
  62. # Compress info documents deleting index file for the package
  63. if test -d "${destdir}/$infodir"
  64. then
  65. rm -f "${destdir}/${infodir}/dir"
  66. lzip -9 "${destdir}/${infodir}"/*
  67. fi
  68. # Copy documentation
  69. mkdir -p "${destdir}${docsdir}"
  70. cp -p $docs "${destdir}${docsdir}"
  71. }