recipe 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Build recipe for elfutils.
  2. #
  3. # Copyright (c) 2020 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.180
  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 -Np0 -i "${worktree}/patches/elfutils/fix-uninitialized.patch"
  49. patch -Np0 -i "${worktree}/patches/elfutils/musl-asm_ptrace_h.patch"
  50. patch -Np0 -i "${worktree}/patches/elfutils/musl-cdefs.patch"
  51. patch -Np0 -i "${worktree}/patches/elfutils/musl-fts-obstack.patch"
  52. patch -Np0 -i "${worktree}/patches/elfutils/musl-macros.patch"
  53. patch -Np0 -i "${worktree}/patches/elfutils/musl-qsort_r.patch"
  54. patch -Np0 -i "${worktree}/patches/elfutils/musl-strerror_r.patch"
  55. patch -Np0 -i "${worktree}/patches/elfutils/musl-strndupa.patch"
  56. cp -p -f "${worktree}"/archive/elfutils/error.h lib/
  57. cp -p -f "${worktree}"/archive/elfutils/error.h src/
  58. sed -i 's:-Werror::' ./*Makefile.in
  59. autoreconf -vif
  60. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS -Wno-error=null-dereference" \
  61. LDFLAGS="$QILDFLAGS" \
  62. $configure_args \
  63. --libdir=/usr/lib${libSuffix} \
  64. --docdir=$docsdir \
  65. --mandir=$mandir \
  66. --enable-deterministic-archives \
  67. --disable-debuginfod \
  68. --program-prefix=eu- \
  69. --build="$(gcc -dumpmachine)"
  70. make -j${jobs} V=1
  71. make -j${jobs} V=1 DESTDIR="$destdir" install-strip
  72. # Compress and link man pages (if needed)
  73. if test -d "${destdir}/$mandir"
  74. then
  75. (
  76. cd "${destdir}/$mandir"
  77. find . -type f -exec lzip -9 {} +
  78. find . -type l | while read -r file
  79. do
  80. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  81. rm -- "$file"
  82. done
  83. )
  84. fi
  85. # Copy documentation
  86. mkdir -p "${destdir}${docsdir}"
  87. cp -p $docs "${destdir}${docsdir}"
  88. }