recipe 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. # Build recipe for valgrind.
  2. #
  3. # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
  4. # Copyright (c) 2017-2018 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. program=valgrind
  18. version=3.13.0
  19. release=4
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/devel"
  22. tarname=${program}-${version}.tar.bz2
  23. # Remote source(s)
  24. fetch=ftp://sourceware.org/pub/valgrind/$tarname
  25. description="
  26. Generic framework for creating dynamic analysis tools.
  27. Valgrind is an instrumentation framework for building dynamic analysis tools.
  28. There are Valgrind tools that can automatically detect many memory management
  29. and threading bugs, and profile your programs in detail. You can also use
  30. Valgrind to build new tools.
  31. "
  32. homepage=http://valgrind.org/
  33. license="GPLv2"
  34. # Source documentation
  35. docs="AUTHORS COPYING* FAQ.txt NEWS* README*"
  36. docsdir="${docdir}/${program}-${version}"
  37. build()
  38. {
  39. set -e
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # Set sane permissions
  43. chmod -R u+w,go-w,a+rX-s .
  44. # Set installation for documentation directory
  45. patch -p0 < "${worktree}/patches/valgrind/valgrind-docdir.patch"
  46. # Set specific options for the architecture
  47. case $arch in
  48. i?86)
  49. arch_options="--enable-only32bit --build=$(cc -dumpmachine)"
  50. ;;
  51. x86_64)
  52. arch_options="--enable-only64bit --build=$(cc -dumpmachine)"
  53. ;;
  54. esac
  55. # We do not try to strip any debugging symbol as
  56. # suggested in README_PACKAGERS
  57. ./configure CFLAGS="-no-pie -fno-PIE -fPIC" \
  58. CXXFLAGS="-no-pie -fno-PIE -fPIC" \
  59. $configure_args \
  60. --libdir=/usr/lib${libSuffix} \
  61. --infodir=$infodir \
  62. --mandir=$mandir \
  63. --docdir=$docsdir \
  64. --disable-ubsan \
  65. --enable-tls \
  66. --enable-inner \
  67. $arch_options
  68. unset arch_options
  69. make -j${jobs} V=1
  70. make -j${jobs} DESTDIR="$destdir" install
  71. # Remove valgrind manual in order to reduce the package size
  72. # considerably, we already provide the manual in HTML format
  73. rm -f "${destdir}${docsdir}"/*.pdf "${destdir}${docsdir}"/*.ps
  74. # Compress info documents deleting index file for the package
  75. if test -d "${destdir}/$infodir"
  76. then
  77. rm -f "${destdir}/${infodir}/dir"
  78. lzip -9 "${destdir}/${infodir}"/*
  79. fi
  80. # Compress and link man pages (if needed)
  81. if test -d "${destdir}/$mandir"
  82. then
  83. (
  84. cd "${destdir}/$mandir"
  85. find . -type f -exec lzip -9 '{}' +
  86. find . -type l | while read -r file
  87. do
  88. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  89. rm -- "$file"
  90. done
  91. )
  92. fi
  93. # Copy documentation
  94. mkdir -p "${destdir}${docsdir}"
  95. for file in $docs
  96. do
  97. if test -e $file
  98. then
  99. cp -p $file "${destdir}${docsdir}"
  100. fi
  101. done
  102. }