recipe 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Build recipe for elfutils.
  2. #
  3. # Copyright (c) 2020-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=elfutils
  19. version=0.186
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=devel
  23. tarname=${program}-${version}.tar.bz2
  24. # Remote source(s)
  25. fetch=https://sourceware.org/elfutils/ftp/${version}/$tarname
  26. description="
  27. Libraries and utilities to handle ELF objects.
  28. elfutils is a collection of utilities and libraries to read,
  29. create and modify ELF binary files, find and handle DWARF
  30. debug data, symbols, thread state and stacktraces for
  31. processes and core files on GNU/Linux.
  32. Note: This package has been configured to make use of the \"eu\"
  33. prefix for elfutils utilities.
  34. "
  35. homepage=https://sourceware.org/elfutils/
  36. license="GPLv2+, GPLv3+, LGPLv3"
  37. # Source documentation
  38. docs="AUTHORS CONTRIBUTING COPYING* src/ChangeLog NEWS NOTES README THANKS TODO"
  39. docsdir="${docdir}/${program}-${version}"
  40. build()
  41. {
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. # Apply patches against Musl (Thanks to "noname-linux", xhebox)
  47. # Url: https://github.com/xhebox/noname-linux/tree/master/ports/elfutils
  48. patch -Np1 -i "${worktree}/patches/elfutils/fix-uninitialized.patch"
  49. patch -Np1 -i "${worktree}/patches/elfutils/musl-asm-ptrace-h.patch"
  50. patch -Np0 -i "${worktree}/patches/elfutils/musl-macros.patch"
  51. patch -Np0 -i "${worktree}/patches/elfutils/musl-strndupa.patch"
  52. cp -p -f "${worktree}"/archive/elfutils/error.h lib/
  53. cp -p -f "${worktree}"/archive/elfutils/error.h src/
  54. sed -i 's:-Werror::' ./*Makefile.in
  55. autoreconf -vif
  56. ./configure CPPFLAGS="$QICPPFLAGS" \
  57. CFLAGS="$QICFLAGS -Wno-error=null-dereference" \
  58. LDFLAGS="$QILDFLAGS" \
  59. $configure_args \
  60. --libdir=/usr/lib${libSuffix} \
  61. --docdir=$docsdir \
  62. --mandir=$mandir \
  63. --enable-deterministic-archives \
  64. --disable-debuginfod \
  65. --enable-libdebuginfod=dummy \
  66. --program-prefix=eu- \
  67. --build="$(gcc -dumpmachine)"
  68. make -j${jobs} V=1
  69. make -j${jobs} V=1 DESTDIR="$destdir" install-strip
  70. # Compress and link man pages (if needed)
  71. if test -d "${destdir}/$mandir"
  72. then
  73. (
  74. cd "${destdir}/$mandir"
  75. find . -type f -exec lzip -9 {} +
  76. find . -type l | while read -r file
  77. do
  78. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  79. rm -- "$file"
  80. done
  81. )
  82. fi
  83. # Copy documentation
  84. mkdir -p "${destdir}/$docsdir"
  85. cp -p $docs "${destdir}/$docsdir"
  86. }