new package: wrk (#5262)

* add wrk package
* install luajit into docker image
This commit is contained in:
ifurther 2020-05-07 23:23:01 +00:00 committed by GitHub
parent 9af8040c9b
commit fe9c49ae32
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,30 @@
diff -uNr wrk-4.1.0/Makefile wrk-4.1.0.mod/Makefile
--- wrk-4.1.0/Makefile 2018-01-21 08:00:58.000000000 +0200
+++ wrk-4.1.0.mod/Makefile 2020-05-08 02:09:33.254774677 +0300
@@ -1,5 +1,5 @@
-CFLAGS += -std=c99 -Wall -O2 -D_REENTRANT
-LIBS := -lpthread -lm -lssl -lcrypto
+CFLAGS += -std=c99 -Wall -D_REENTRANT
+LIBS := -lm -lssl -lcrypto
TARGET := $(shell uname -s | tr '[A-Z]' '[a-z]' 2>/dev/null || echo unknown)
@@ -31,7 +31,7 @@
LDFLAGS += -L$(ODIR)/lib
ifneq ($(WITH_LUAJIT),)
- CFLAGS += -I$(WITH_LUAJIT)/include
+ CFLAGS += -I$(WITH_LUAJIT)/include/luajit-2.1
LDFLAGS += -L$(WITH_LUAJIT)/lib
else
CFLAGS += -I$(ODIR)/include/luajit-2.1
@@ -61,7 +61,7 @@
$(ODIR)/bytecode.o: src/wrk.lua
@echo LUAJIT $<
- @$(SHELL) -c 'PATH=obj/bin:$(PATH) luajit -b $(CURDIR)/$< $(CURDIR)/$@'
+ @$(SHELL) -c 'PATH=obj/bin:$(PATH) luajit -b -a $(_ARCH) $(CURDIR)/$< $(CURDIR)/$@'
$(ODIR)/version.o:
@echo 'const char *VERSION="$(VER)";' | $(CC) -xc -c -o $@ -

29
packages/wrk/build.sh Normal file
View File

@ -0,0 +1,29 @@
TERMUX_PKG_HOMEPAGE=https://github.com/wg/wrk
TERMUX_PKG_DESCRIPTION="Modern HTTP benchmarking tool"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_VERSION=4.1.0
TERMUX_PKG_SRCURL=https://github.com/wg/wrk/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=6fa1020494de8c337913fd139d7aa1acb9a020de6f7eb9190753aa4b1e74271e
TERMUX_PKG_DEPENDS="openssl, luajit"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_make() {
local _ARCH
if [ "$TERMUX_ARCH" = "i686" ]; then
_ARCH="x86"
elif [ "$TERMUX_ARCH" = "x86_64" ]; then
_ARCH="x64"
elif [ "$TERMUX_ARCH" = "aarch64" ]; then
_ARCH="arm64"
else
_ARCH=$TERMUX_ARCH
fi
make WITH_OPENSSL=$TERMUX_PREFIX WITH_LUAJIT=$TERMUX_PREFIX _ARCH=$_ARCH
}
termux_step_make_install() {
install -Dm700 -t "$TERMUX_PREFIX"/bin wrk
install -Dm600 -t "$TERMUX_PREFIX"/share/doc/wrk/examples scripts/*.lua
}

View File

@ -114,6 +114,9 @@ PACKAGES+=" clang-9"
PACKAGES+=" libtinfo5"
PACKAGES+=" lld"
# Needed by wrk.
PACKAGES+=" luajit"
# Needed by gitea.
PACKAGES+=" npm"