recipe 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Build recipe for libexecinfo.
  2. #
  3. # Copyright (c) 2022-2023 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=libexecinfo
  19. version=1.1
  20. release=2
  21. # Define a category for the output of the package name
  22. pkgcategory=libs
  23. tarname=${program}-${version}.tar.bz2
  24. # Remote source(s)
  25. fetch=http://distcache.freebsd.org/local-distfiles/itetcu/$tarname
  26. description="
  27. Clone of the GNU libc backtrace facility.
  28. This is a quick-n-dirty BSD licensed clone of backtrace facility found
  29. in the GNU libc, mainly intended for porting Linuxish code to BSD
  30. platforms, however it can be used at any platform which has a GCC
  31. compiler.
  32. "
  33. homepage=http://www.freshports.org/devel/libexecinfo
  34. license="BSD 2-clause"
  35. # Source documentation
  36. docs="README"
  37. docsdir="${docdir}/${program}-${version}"
  38. build()
  39. {
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # Set sane permissions
  43. chmod -R u+w,go-w,a+rX-s .
  44. # Apply patches from "Void Linux" in order to build Rust
  45. patch -Np1 -i "${worktree}/patches/libexecinfo/01-execinfo.patch"
  46. patch -Np1 -i "${worktree}/patches/libexecinfo/02-makefile.patch"
  47. patch -Np1 -i "${worktree}/patches/libexecinfo/03-define-gnu-source.patch"
  48. patch -Np1 -i "${worktree}/patches/libexecinfo/libexecinfo_pc.patch"
  49. make -j${jobs} V=1 \
  50. CFLAGS="$QICFLAGS -fno-stack-protector" \
  51. LDFLAGS="$(echo "$QILDFLAGS" | sed 's/-s//')"
  52. sed -e "/Version:/s@version@${version}@" -i libexecinfo.pc
  53. mkdir -p "${destdir}/usr/include" "${destdir}/usr/lib${libSuffix}/pkgconfig"
  54. for header in *.h
  55. do
  56. install -p -m 644 "$header" "${destdir}/usr/include"
  57. done
  58. unset -v header
  59. for library in *.a *.so*
  60. do
  61. install -p -m 755 "$library" "${destdir}/usr/lib${libSuffix}"
  62. done
  63. unset -v library
  64. chmod 644 "${destdir}/usr/lib${libSuffix}"/*.a
  65. install -p -m 644 libexecinfo.pc "${destdir}/usr/lib${libSuffix}/pkgconfig"
  66. # Copy documentation
  67. mkdir -p "${destdir}/$docsdir"
  68. cp -p $docs "${destdir}/$docsdir"
  69. head -n 28 execinfo.c > "${destdir}/${docsdir}/LICENSE"
  70. }