recipe 3.0 KB

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