void-packages/srcpkgs/wrk/template
Noel Cower 42bce6b564 wrk: fix CFLAGS and LDFLAGS
The build for 4.0.2_1 was missing a handful of CFLAGS and LDFLAGS
necessary to correctly build and link wrk. This fixes that by simply
setting both in prebuild, borrowing their values from wrk's Makefile.
This is necessary since wrk's Makefile doesn't handle changes to CFLAGS
or LDFLAGS well (since the gnu-makefile build style passes these, and
hardening sets some flags, wrk's Makefile used only those in 4.0.2_1).

Closes: #10108 [via git-merge-pr]
2017-12-19 05:55:08 +01:00

48 lines
1.2 KiB
Bash

# Template file for 'wrk'
pkgname=wrk
version=4.0.2
revision=2
build_style=gnu-makefile
make_build_args="VER=${version} WITH_OPENSSL=/usr WITH_LUAJIT=/usr"
hostmakedepends="LuaJIT"
makedepends="LuaJIT-devel libressl-devel"
short_desc="Modern HTTP benchmarking tool"
maintainer="Noel Cower <ncower@gmail.com>"
license="Apache-2.0"
homepage="https://github.com/wg/wrk"
distfiles="https://github.com/wg/wrk/archive/${version}.tar.gz"
checksum=a4a6ad6727733023771163e7250189a9a23e6253b5e5025191baa6092d5a26fb
pre_build() {
case "$XBPS_TARGET_MACHINE" in
aarch64*)
broken="LuaJIT not supported on $XBPS_TARGET_MACHINE"
;;
mips*)
broken="__sync_fetch_and_add_8 and __sync_val_compare_and_swap_8 supported on $XBPS_TARGET_MACHINE"
;;
armv[5-7]*)
make obj
luajit -b -a arm src/wrk.lua obj/bytecode.o
;;
i686*)
make obj
luajit -b -a x86 src/wrk.lua obj/bytecode.o
;;
esac
# Borrow flags from Makefile
CFLAGS="-std=c99 -Wall -D_REENTRANT -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE ${CFLAGS}"
LDFLAGS="-Wl,-E ${LDFLAGS}"
}
do_install() {
vbin wrk
vdoc README
vdoc CHANGES
vdoc SCRIPTING
vlicense LICENSE
vlicense NOTICE
for f in scripts/*; do
vsconf "${f}"
done
}