commit:     0ab9661a7a83315fa95c0eedd7c4a225cfdab13c
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 18 23:03:02 2020 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Wed Nov 18 23:03:51 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ab9661a

app-benchmarks/wrk: migrate to slotted lua-single

Closes: https://bugs.gentoo.org/752525
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 .../wrk/files/wrk-4.1.0-r100-makefile.patch        | 64 ++++++++++++++++++++++
 app-benchmarks/wrk/wrk-4.1.0-r100.ebuild           | 51 +++++++++++++++++
 profiles/package.mask                              |  1 +
 3 files changed, 116 insertions(+)

diff --git a/app-benchmarks/wrk/files/wrk-4.1.0-r100-makefile.patch 
b/app-benchmarks/wrk/files/wrk-4.1.0-r100-makefile.patch
new file mode 100644
index 00000000000..d3c838d0800
--- /dev/null
+++ b/app-benchmarks/wrk/files/wrk-4.1.0-r100-makefile.patch
@@ -0,0 +1,64 @@
+--- a/Makefile
++++ b/Makefile
+@@ -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 -lpthread
+ 
+ TARGET  := $(shell uname -s | tr '[A-Z]' '[a-z]' 2>/dev/null || echo unknown)
+ 
+@@ -24,15 +24,13 @@
+ 
+ ODIR := obj
+ OBJ  := $(patsubst %.c,$(ODIR)/%.o,$(SRC)) $(ODIR)/bytecode.o 
$(ODIR)/version.o
+-LIBS := -lluajit-5.1 $(LIBS)
++LIBS := $(LUA_LIBS) $(LIBS)
+ 
+ DEPS    :=
+ CFLAGS  += -I$(ODIR)/include
+-LDFLAGS += -L$(ODIR)/lib
+ 
+ ifneq ($(WITH_LUAJIT),)
+-      CFLAGS  += -I$(WITH_LUAJIT)/include
+-      LDFLAGS += -L$(WITH_LUAJIT)/lib
++      CFLAGS  += $(WITH_LUAJIT)
+ else
+       CFLAGS  += -I$(ODIR)/include/luajit-2.1
+       DEPS    += $(ODIR)/lib/libluajit-5.1.a
+@@ -40,7 +38,6 @@
+ 
+ ifneq ($(WITH_OPENSSL),)
+       CFLAGS  += -I$(WITH_OPENSSL)/include
+-      LDFLAGS += -L$(WITH_OPENSSL)/lib
+ else
+       DEPS += $(ODIR)/lib/libssl.a
+ endif
+@@ -51,15 +48,14 @@
+       $(RM) -rf $(BIN) obj/*
+ 
+ $(BIN): $(OBJ)
+-      @echo LINK $(BIN)
+-      @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
++      $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+ 
+ $(OBJ): config.h Makefile $(DEPS) | $(ODIR)
+ 
+ $(ODIR):
+       @mkdir -p $@
+ 
+-$(ODIR)/bytecode.o: src/wrk.lua
++$(ODIR)/bytecode.c: src/wrk.lua
+       @echo LUAJIT $<
+       @$(SHELL) -c 'PATH=obj/bin:$(PATH) luajit -b $(CURDIR)/$< $(CURDIR)/$@'
+ 
+@@ -67,8 +63,7 @@
+       @echo 'const char *VERSION="$(VER)";' | $(CC) -xc -c -o $@ -
+ 
+ $(ODIR)/%.o : %.c
+-      @echo CC $<
+-      @$(CC) $(CFLAGS) -c -o $@ $<
++      $(CC) $(CFLAGS) -c -o $@ $<
+ 
+ # Dependencies
+ 

diff --git a/app-benchmarks/wrk/wrk-4.1.0-r100.ebuild 
b/app-benchmarks/wrk/wrk-4.1.0-r100.ebuild
new file mode 100644
index 00000000000..0d5fbb0e91f
--- /dev/null
+++ b/app-benchmarks/wrk/wrk-4.1.0-r100.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LUA_COMPAT=( lua5-1 luajit )
+
+inherit lua-single
+
+DESCRIPTION="A HTTP benchmarking tool"
+HOMEPAGE="https://www.github.com/wg/wrk";
+SRC_URI="https://www.github.com/wg/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+LICENSE="Apache-2.0 BSD MIT"
+SLOT="0"
+IUSE="libressl"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+RDEPEND="
+       libressl? ( dev-libs/libressl:0= )
+       !libressl? ( dev-libs/openssl:0= )
+       ${LUA_DEPS}
+"
+
+DEPEND="${RDEPEND}"
+
+DOCS=( "CHANGES" "NOTICE" "README.md" "SCRIPTING" )
+
+PATCHES=( "${FILESDIR}/${P}-r100-makefile.patch" )
+
+src_compile() {
+       myemakeargs=(
+               CC="$(tc-getCC)"
+               LUA_LIBS="$(lua_get_LIBS)"
+               VER="${PV}"
+               WITH_LUAJIT="$(lua_get_CFLAGS)"
+               WITH_OPENSSL="/usr"
+       )
+
+       emake "${myemakeargs[@]}"
+}
+
+src_install() {
+       dobin wrk
+
+       insinto /usr/share/wrk
+       doins -r scripts
+
+       einstalldocs
+}

diff --git a/profiles/package.mask b/profiles/package.mask
index d8ca75513a7..3508a666851 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -433,6 +433,7 @@ dev-lua/luacrypto
 # All these ebuilds require slotted Lua, which is still masked.
 # Ulrich Müller <[email protected]> (2020-11-06)
 # Added sci-visualization/gnuplot.
+>=app-benchmarks/wrk-4.1.0-r100
 >=app-misc/worker-3.8.3-r100
 =dev-libs/efl-1.25.1-r10
 >=dev-lua/lua-bit32-5.3.5-r100

Reply via email to