recipe 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Build recipe for gc.
  2. #
  3. # Copyright (c) 2018-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=gc
  17. version=8.0.4
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/devel"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=http://github.com/ivmai/bdwgc/releases/download/v${version}/$tarname
  24. #fetch=http://www.hboehm.info/gc/gc_source/$tarname
  25. description="
  26. A garbage collector for C and C++.
  27. The gc package contains the Boehm-Demers-Weiser conservative garbage
  28. collector, which can be used as a garbage collecting replacement for
  29. the C malloc function or C++ new operator. It allows you to allocate
  30. memory basically as you normally would, without explicitly deallocating
  31. memory that is no longer useful. The collector automatically recycles
  32. memory when it determines that it can no longer be otherwise accessed.
  33. The collector is also used by a number of programming language
  34. implementations that either use C as intermediate code, want to
  35. facilitate easier interoperation with C libraries, or just prefer the
  36. simple collector interface. Alternatively, the garbage collector may
  37. be used as a leak detector for C or C++ programs, though that is not
  38. its primary goal.
  39. "
  40. homepage=http://www.hboehm.info/gc/
  41. license=Custom
  42. # Source documentation
  43. docs="AUTHORS ChangeLog" # To complement installed documentation.
  44. docsdir="${docdir}/${program}-${version}"
  45. build()
  46. {
  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. ./configure \
  53. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  54. $configure_args \
  55. --libdir=/usr/lib${libSuffix} \
  56. --mandir=$mandir \
  57. --docdir=$docsdir \
  58. --enable-cplusplus \
  59. --enable-static=no \
  60. --enable-shared=yes \
  61. --enable-threads=posix \
  62. --with-libatomic-ops=yes \
  63. --build="$(cc -dumpmachine)"
  64. make -j${jobs} V=1
  65. make -j${jobs} DESTDIR="$destdir" install-strip
  66. # Compress and link man pages (if needed)
  67. if test -d "${destdir}/$mandir"
  68. then
  69. (
  70. cd "${destdir}/$mandir"
  71. find . -type f -exec lzip -9 '{}' +
  72. find . -type l | while read -r file
  73. do
  74. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  75. rm -- "$file"
  76. done
  77. )
  78. fi
  79. # Copy documentation
  80. mkdir -p "${destdir}${docsdir}"
  81. cp -p $docs "${destdir}${docsdir}"/
  82. }