summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ff7769e8fbec39d5b374ff2018e7a000c3144960 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Maintainer: Adrián Pérez de Castro <aperez@igalia.com>
pkgname='eresi-git'
pkgdesc='Reverse engineering tool suite (includes elfsh)'
pkgver=r1267.d0facbfd
pkgrel=1
license=('GPL')
url='https://github.com/thorkill/eresi'
source=("${pkgname}::git+${url}")
sha512sums=('SKIP')
arch=('x86_64' 'i686')
depends=('readline' 'termcap' 'bash')

pkgver () {
	cd "${pkgname}"
	(
		set -o pipefail
		git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
		printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	)
}

build () {
	cd "${pkgname}"
	CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure \
		--enable-32-64 \
		--enable-readline \
		--enable-gstabs+ \
		--prefix=/usr
	cat >> config.h <<-EOF
	CFLAGS32 += -fPIC
	CFLAGS64 += -fPIC
	CFLAGS   += -fPIC
	CXXFLAGS += -fPIC
	LDFLAGS  += -Wl,--as-needed
	EOF
	make -j$(getconf _NPROCESSORS_ONLN)
}

package () {
	cd "${pkgname}"
	make install DESTDIR="${pkgdir}/usr"
	make install64 DESTDIR="${pkgdir}/usr"
}