1SUMMARY="A utility for patching ELF binaries"
2DESCRIPTION="PatchELF is a simple utility for modifying existing ELF executables and libraries."
3HOMEPAGE="https://github.com/NixOS/patchelf"
4COPYRIGHT="2004-2019 Eelco Dolstra"
5LICENSE="GNU GPL v3"
6REVISION="1"
7SOURCE_URI="$HOMEPAGE/releases/download/$portVersion/patchelf-$portVersion.tar.bz2"
8CHECKSUM_SHA256="1952b2a782ba576279c211ee942e341748fdb44997f704dd53def46cd055470b"
9
10ARCHITECTURES="all ?x86_gcc2"
11SECONDARY_ARCHITECTURES="x86"
12
13commandBinDir=$binDir
14commandSuffix=$secondaryArchSuffix
15if [ "$targetArchitecture" = x86_gcc2 ]; then
16	commandSuffix=
17	commandBinDir=$prefix/bin
18fi
19
20PROVIDES="
21	patchelf$secondaryArchSuffix = $portVersion
22	cmd:patchelf$commandSuffix = $portVersion
23	"
24REQUIRES="
25	haiku$secondaryArchSuffix
26	"
27
28BUILD_REQUIRES="
29	haiku${secondaryArchSuffix}_devel
30	"
31BUILD_PREREQUIRES="
32	cmd:aclocal
33	cmd:autoreconf
34	cmd:gcc$secondaryArchSuffix
35	cmd:make
36	"
37
38
39BUILD()
40{
41	autoreconf -vfi
42	runConfigure --omit-dirs binDir ./configure \
43		--bindir=$commandBinDir
44	make $jobArgs
45}
46
47INSTALL()
48{
49	make install
50}
51
52TEST()
53{
54	make -C tests -j1 check
55}
56