Add PKGBUILD for libdwarfpp
This commit is contained in:
parent
a946e4104c
commit
48f653ee28
2 changed files with 76 additions and 0 deletions
2
libdwarfpp/.gitignore
vendored
Normal file
2
libdwarfpp/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
libdwarfpp
|
||||
*.patch
|
74
libdwarfpp/PKGBUILD
Normal file
74
libdwarfpp/PKGBUILD
Normal file
|
@ -0,0 +1,74 @@
|
|||
# Maintainer: Théophile Bastian <contact@tobast.fr>
|
||||
pkgname=libdwarfpp-git
|
||||
_pkgname="${pkgname%-git}"
|
||||
pkgver=r289.d7df953
|
||||
pkgrel=1
|
||||
provides=($_pkgname)
|
||||
conflicts=($_pkgname)
|
||||
pkgdesc="A C++ wrapper around libdwarf"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/stephenrkell/libdwarfpp"
|
||||
license=('?')
|
||||
depends=(libcxxfileno libsrk31cxx libdwarf)
|
||||
makedepends=('git' 'make' 'autoconf')
|
||||
install=
|
||||
source=("git+https://github.com/stephenrkell/libdwarfpp"
|
||||
"https://tobast.fr/files/libdwarfpp-dies.patch")
|
||||
sha1sums=('SKIP'
|
||||
'1bfc0b66e1c6bb4b0e284e29a50a1b4be6b3aa50')
|
||||
|
||||
pkgver() {
|
||||
cd "$srcdir/${_pkgname}"
|
||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "$srcdir/${_pkgname}"
|
||||
git apply ../libdwarfpp-dies.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
# Why the hell are those things needed :(
|
||||
export LIBCXXFILENO_CXXFLAGS=" "
|
||||
export LIBSRK31CXX_CXXFLAGS=" "
|
||||
export LIBCXXFILENO_LIBS="-lc++fileno"
|
||||
export LIBSRK31CXX_LIBS="-lsrk31c++"
|
||||
libdwarf_include=$(echo "#include <libdwarf/libdwarf.h>" \
|
||||
| gcc -H -fsyntax-only -x c - 2>&1 \
|
||||
| awk '{ print $2 }' \
|
||||
| xargs dirname)
|
||||
libdwarf_lib=$(ldconfig -p \
|
||||
| grep 'libdwarf.so$' \
|
||||
| sed 's/^.*=> //g' \
|
||||
| xargs dirname)
|
||||
|
||||
if [ -z "$libdwarf_include" ]; then
|
||||
>&2 echo "libdwarf.h not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$libdwarf_lib" ]; then
|
||||
>&2 echo "libdwarf.so not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use python2
|
||||
pydir=$(mktemp -d)
|
||||
ln -s "$(which python2)" "$pydir/python"
|
||||
export PATH="$pydir:$PATH"
|
||||
|
||||
cd "$srcdir/${_pkgname}"
|
||||
|
||||
autoreconf -i
|
||||
./configure --prefix=/usr \
|
||||
--with-libdwarf-includes="$libdwarf_include" \
|
||||
--with-libdwarf-libs="$libdwarf_lib"
|
||||
make -j
|
||||
|
||||
rm -f "$pydir"
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/${_pkgname}"
|
||||
make DESTDIR="$pkgdir/" install
|
||||
}
|
Loading…
Reference in a new issue