1 # Build recipe for elfutils.
3 # Copyright (c) 2020-2022 Matias Fonzo, <selk@dragora.org>.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.bz2
30 fetch=https://sourceware.org/elfutils/ftp/${version}/$tarname
33 Libraries and utilities to handle ELF objects.
35 elfutils is a collection of utilities and libraries to read,
36 create and modify ELF binary files, find and handle DWARF
37 debug data, symbols, thread state and stacktraces for
38 processes and core files on GNU/Linux.
40 Note: This package has been configured to make use of the \"eu\"
41 prefix for elfutils utilities.
44 homepage=https://sourceware.org/elfutils/
45 license="GPLv2+, GPLv3+, LGPLv3"
47 # Source documentation
48 docs="AUTHORS CONTRIBUTING COPYING* src/ChangeLog NEWS NOTES README THANKS TODO"
49 docsdir="${docdir}/${program}-${version}"
53 unpack "${tardir}/$tarname"
57 # Set sane permissions
58 chmod -R u+w,go-w,a+rX-s .
60 # Apply patches against Musl (Thanks to "noname-linux", xhebox)
61 # Url: https://github.com/xhebox/noname-linux/tree/master/ports/elfutils
62 patch -Np1 -i "${worktree}/patches/elfutils/fix-uninitialized.patch"
63 patch -Np1 -i "${worktree}/patches/elfutils/musl-asm-ptrace-h.patch"
64 patch -Np0 -i "${worktree}/patches/elfutils/musl-macros.patch"
65 patch -Np0 -i "${worktree}/patches/elfutils/musl-strndupa.patch"
67 cp -p -f "${worktree}"/archive/elfutils/error.h lib/
68 cp -p -f "${worktree}"/archive/elfutils/error.h src/
69 sed -i 's:-Werror::' ./*Makefile.in
72 ./configure CPPFLAGS="$QICPPFLAGS" \
73 CFLAGS="$QICFLAGS -Wno-error=null-dereference" \
74 LDFLAGS="$QILDFLAGS" \
76 --libdir=/usr/lib${libSuffix} \
79 --enable-deterministic-archives \
80 --disable-debuginfod \
81 --enable-libdebuginfod=dummy \
82 --program-prefix=eu- \
83 --build="$(gcc -dumpmachine)"
86 make -j${jobs} V=1 DESTDIR="$destdir" install-strip
88 # Compress and link man pages (if needed)
89 if test -d "${destdir}/$mandir"
92 cd "${destdir}/$mandir"
93 find . -type f -exec lzip -9 {} +
94 find . -type l | while read -r file
96 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
103 mkdir -p "${destdir}${docsdir}"
104 cp -p $docs "${destdir}${docsdir}"