recipe 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Build recipe for gmp.
  2. #
  3. # Copyright (c) 2015-2017 Matias Fonzo, <selk@dragora.org>.
  4. # Copyright (c) 2019-2021 Matias Fonzo, <selk@dragora.org>.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. # Exit immediately on any error
  18. set -e
  19. program=gmp
  20. version=6.2.1
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=libs
  24. tarname=${program}-${version}.tar.lz
  25. # Remote source(s)
  26. fetch=ftp://ftp.gnu.org/gnu/gmp/$tarname
  27. description="
  28. GNU multiple precision arithmetic library.
  29. GMP is a free library for arbitrary precision arithmetic, operating
  30. on signed integers, rational numbers, and floating-point numbers.
  31. There is no practical limit to the precision except the ones implied
  32. by the available memory in the machine GMP runs on.
  33. GMP has a rich set of functions, and the functions have a regular
  34. interface.
  35. "
  36. homepage=https://gmplib.org
  37. license="GPLv2+, GPLv3+, LGPLv3+"
  38. # Source documentation
  39. docs="AUTHORS COPYING* ChangeLog NEWS README"
  40. docsdir="${docdir}/${program}-${version}"
  41. build()
  42. {
  43. unpack "${tardir}/$tarname"
  44. cd "$srcdir"
  45. # Set sane permissions
  46. chmod -R u+w,go-w,a+rX-s .
  47. ./configure \
  48. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  49. $configure_args \
  50. --libdir=/usr/lib${libSuffix} \
  51. --infodir=$infodir \
  52. --docdir=$docsdir \
  53. --enable-cxx \
  54. --enable-static \
  55. --enable-shared \
  56. --without-readline \
  57. --build="$(gcc -dumpmachine)"
  58. make -j${jobs}
  59. make -j${jobs} check
  60. make -j${jobs} DESTDIR="$destdir" install-strip
  61. # Compress info documents deleting index file for the package
  62. if test -d "${destdir}/$infodir"
  63. then
  64. rm -f "${destdir}/${infodir}/dir"
  65. lzip -9 "${destdir}/${infodir}"/*
  66. fi
  67. # Copy documentation
  68. mkdir -p "${destdir}/$docsdir"
  69. cp -p $docs "${destdir}/$docsdir"
  70. }