From nobody Mon Mar 07 18:15:52 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BB86D19F8E5A; Mon, 7 Mar 2022 18:15:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KC68S4vCvz3HJk; Mon, 7 Mar 2022 18:15:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646676952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2lJs1mxzoK+PPPSBvYaAUHo8tYWY/mTSPUQNhkCJLcU=; b=roh8IuclgCXwtJE7EY6a+2Rx1n7IrtURKL3bs2ysQh3b8lbunuh7F/eYnqkV7cmnR3K7BE ldYoKmZvUZhfQSyqsrqO5gue89TxYWAqdJ9z9cwzPATXAOti/ich5D+gszMq8U/R+QGmRJ Ppq3PRsI/4Ylk2S/651Ez+3v12jgHRDFUDHMg5IOtPGyhENC2NMSW8i4qRNs2uo4zggS1o ONbBjNKIJhiAzHY/BTYdl62O1SLIbO8im06LEMZiJ3T7+wJc68Ha7qBAtNGNEy3G7vIncK pA0xr44VALkaJPbiQBJN6J2Y07XbJyiPJe5ChAQwxNqEndeJjPBuBMfpmJ3lnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87AC253CC; Mon, 7 Mar 2022 18:15:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 227IFqM6058312; Mon, 7 Mar 2022 18:15:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 227IFqmY058311; Mon, 7 Mar 2022 18:15:52 GMT (envelope-from git) Date: Mon, 7 Mar 2022 18:15:52 GMT Message-Id: <202203071815.227IFqmY058311@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: b16f47812788 - main - devel/libac: Add libac g20190308 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b16f478127888cd34bf49b4db4537015432cef48 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646676952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2lJs1mxzoK+PPPSBvYaAUHo8tYWY/mTSPUQNhkCJLcU=; b=fdGdvw4Rww95ERoqa3MJL2USl1U4rlMXpNvcwUPt12bHyK0eBA3DddWKxEdtWuuOmyPNzN lN3Cf+EFRyJO12IAsrnHApWJ5h5Wwmkq57xRPwW2TvxLj3OuElUf2iEnl6MySLAbSe73Jj BwLO5Pi4hQBypFefUjTWTmDaBE37qIvHqrmB8jnTN1DfNVETx9Mll38DaMKRpshadp2wVb 3QfW3x0gIuHX3Z2wAcFAEI0G3bBeMMpW0nr8s03KukQLWb6bFBRvckibpE1Tqwxd+nBS3Z gf/6zr9ByjD/kZppzslXU0H1NmLKMBEIbbXvD9bpbCrUrctJJqGmGrBJ5eaQXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646676952; a=rsa-sha256; cv=none; b=jbC5FCyIR4jL4AsaobVrRlpDb5YHPxLIQM+DXBPccgo3JvkJeUe0azrRu2TrZay0/1qmPB pl9e8bX3h+SD3sCSDP3/r9eSunKOh3BffluoJgYdICAkD6dubHomla2Oq8O7KebtSkOQ/n gxcCXEWKh+2bgPUJj0lC2DcYEcN1WOEMps4nUhTfWCrC3Oll/LmfU42vm1ho5UqsqAVXfV ZsBwZ8FggOyNoKLh1dWy1eQVORGbZZJ1qMM22U8LJhOA8ZnSYiPSlHzlCXQJAsHGVfnl8L hXuA5wsYEfYixXCOzmjyJlmVReRoEdjrPtoReT4xV6+8Eg0biBwF9tVTZZ+1vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=b16f478127888cd34bf49b4db4537015432cef48 commit b16f478127888cd34bf49b4db4537015432cef48 Author: Po-Chuan Hsieh AuthorDate: 2022-03-07 17:46:36 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-03-07 18:10:49 +0000 devel/libac: Add libac g20190308 This port is the C++ implementation of the Aho-Corasick (AC) string matching algorithm. The upstream began with pure Lua implementation and realize the performance is not satisfactory. So they switch to C/C++ implementation. There are two shared objects provided by this package: libac.so and ahocorasick.so The former is a regular shared object which can be directly used by C/C++ application, or by Lua via FFI; and the later is a Lua module. WWW: https://github.com/cloudflare/lua-aho-corasick --- devel/Makefile | 1 + devel/libac/Makefile | 27 +++++++++++++ devel/libac/distinfo | 3 ++ devel/libac/files/patch-Makefile | 84 ++++++++++++++++++++++++++++++++++++++++ devel/libac/pkg-descr | 11 ++++++ 5 files changed, 126 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 4c82798904cb..9425dafd70f5 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -1142,6 +1142,7 @@ SUBDIR += libIDL SUBDIR += libPropList SUBDIR += libabigail + SUBDIR += libac SUBDIR += libafterbase SUBDIR += liballium SUBDIR += libantlr3c diff --git a/devel/libac/Makefile b/devel/libac/Makefile new file mode 100644 index 000000000000..4da94966dfa0 --- /dev/null +++ b/devel/libac/Makefile @@ -0,0 +1,27 @@ +# Created by: Po-Chuan Hsieh + +PORTNAME= libac +PORTVERSION= g20190308 +CATEGORIES= devel + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= C++ implementation of the Aho-Corasick (AC) string matching algorithm + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= gmake + +PLIST_FILES= lib/libac.a \ + lib/libac.so + +USE_GITHUB= yes +GH_ACCOUNT= cloudflare +GH_PROJECT= lua-aho-corasick +GH_TAGNAME= ca6043c + +do-install: + ${INSTALL_DATA} ${WRKSRC}/libac.a ${STAGEDIR}${PREFIX}/lib/libac.a + ${INSTALL_LIB} ${WRKSRC}/libac.so ${STAGEDIR}${PREFIX}/lib/libac.so + +.include diff --git a/devel/libac/distinfo b/devel/libac/distinfo new file mode 100644 index 000000000000..49c5e80f8000 --- /dev/null +++ b/devel/libac/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1646057840 +SHA256 (cloudflare-lua-aho-corasick-g20190308-ca6043c_GH0.tar.gz) = 20d3238f1be3b3df866adf0c9943b82517130c1cde80cd6fb2ab3ffc1bc73265 +SIZE (cloudflare-lua-aho-corasick-g20190308-ca6043c_GH0.tar.gz) = 26262 diff --git a/devel/libac/files/patch-Makefile b/devel/libac/files/patch-Makefile new file mode 100644 index 000000000000..7e93ed796a8c --- /dev/null +++ b/devel/libac/files/patch-Makefile @@ -0,0 +1,84 @@ +--- Makefile.orig 2019-03-08 12:57:59 UTC ++++ Makefile +@@ -13,7 +13,6 @@ endif + ############################################################################# + # + C_SO_NAME = libac.$(SO_EXT) +-LUA_SO_NAME = ahocorasick.$(SO_EXT) + AR_NAME = libac.a + + ############################################################################# +@@ -22,10 +21,7 @@ AR_NAME = libac.a + # + ############################################################################# + PREFIX ?= /usr/local +-LUA_VERSION := 5.1 +-LUA_INCLUDE_DIR := $(PREFIX)/include/lua$(LUA_VERSION) +-SO_TARGET_DIR := $(PREFIX)/lib/lua/$(LUA_VERSION) +-LUA_TARGET_DIR := $(PREFIX)/share/lua/$(LUA_VERSION) ++SO_TARGET_DIR := $(PREFIX)/lib + + # Available directives: + # -DDEBUG : Turn on debugging support +@@ -57,7 +53,6 @@ AR_FLAGS = cru + # + SRC_COMMON := ac_fast.cxx ac_slow.cxx + LIBAC_SO_SRC := $(SRC_COMMON) ac.cxx # source for libac.so +-LUA_SO_SRC := $(SRC_COMMON) ac_lua.cxx # source for ahocorasick.so + LIBAC_A_SRC := $(LIBAC_SO_SRC) # source for libac.a + + ############################################################################# +@@ -67,10 +62,9 @@ LIBAC_A_SRC := $(LIBAC_SO_SRC) # source for l + ############################################################################# + # + .PHONY = all clean test benchmark prepare +-all : $(C_SO_NAME) $(LUA_SO_NAME) $(AR_NAME) ++all : $(C_SO_NAME) $(AR_NAME) + + -include c_so_dep.txt +--include lua_so_dep.txt + -include ar_dep.txt + + BUILD_SO_DIR := build_so +@@ -80,28 +74,19 @@ $(BUILD_SO_DIR) :; mkdir $@ + $(BUILD_AR_DIR) :; mkdir $@ + + $(BUILD_SO_DIR)/%.o : %.cxx | $(BUILD_SO_DIR) +- $(CXX) $< -c $(SO_CXXFLAGS) -I$(LUA_INCLUDE_DIR) -MMD -o $@ ++ $(CXX) $< -c $(SO_CXXFLAGS) -MMD -o $@ + + $(BUILD_AR_DIR)/%.o : %.cxx | $(BUILD_AR_DIR) +- $(CXX) $< -c $(AR_CXXFLAGS) -I$(LUA_INCLUDE_DIR) -MMD -o $@ ++ $(CXX) $< -c $(AR_CXXFLAGS) -MMD -o $@ + + ifneq ($(OS), Darwin) + $(C_SO_NAME) : $(addprefix $(BUILD_SO_DIR)/, ${LIBAC_SO_SRC:.cxx=.o}) + $(CXX) $+ -shared -Wl,-soname=$(C_SO_NAME) $(SO_LFLAGS) -o $@ + cat $(addprefix $(BUILD_SO_DIR)/, ${LIBAC_SO_SRC:.cxx=.d}) > c_so_dep.txt +- +-$(LUA_SO_NAME) : $(addprefix $(BUILD_SO_DIR)/, ${LUA_SO_SRC:.cxx=.o}) +- $(CXX) $+ -shared -Wl,-soname=$(LUA_SO_NAME) $(SO_LFLAGS) -o $@ +- cat $(addprefix $(BUILD_SO_DIR)/, ${LUA_SO_SRC:.cxx=.d}) > lua_so_dep.txt +- + else + $(C_SO_NAME) : $(addprefix $(BUILD_SO_DIR)/, ${LIBAC_SO_SRC:.cxx=.o}) + $(CXX) $+ -shared $(SO_LFLAGS) -o $@ + cat $(addprefix $(BUILD_SO_DIR)/, ${LIBAC_SO_SRC:.cxx=.d}) > c_so_dep.txt +- +-$(LUA_SO_NAME) : $(addprefix $(BUILD_SO_DIR)/, ${LUA_SO_SRC:.cxx=.o}) +- $(CXX) $+ -shared $(SO_LFLAGS) -o $@ -Wl,-undefined,dynamic_lookup +- cat $(addprefix $(BUILD_SO_DIR)/, ${LUA_SO_SRC:.cxx=.d}) > lua_so_dep.txt + endif + + $(AR_NAME) : $(addprefix $(BUILD_AR_DIR)/, ${LIBAC_A_SRC:.cxx=.o}) +@@ -115,9 +100,7 @@ $(AR_NAME) : $(addprefix $(BUILD_AR_DIR)/, ${LIBAC_A_S + ############################################################################# + # + test : $(C_SO_NAME) +- $(MAKE) -C tests && \ +- luajit tests/lua_test.lua && \ +- luajit tests/load_ac_test.lua ++ $(MAKE) -C tests && + + benchmark: $(C_SO_NAME) + $(MAKE) benchmark -C tests diff --git a/devel/libac/pkg-descr b/devel/libac/pkg-descr new file mode 100644 index 000000000000..8384e6d377cf --- /dev/null +++ b/devel/libac/pkg-descr @@ -0,0 +1,11 @@ +This port is the C++ implementation of the Aho-Corasick (AC) string matching +algorithm. + +The upstream began with pure Lua implementation and realize the performance is +not satisfactory. So they switch to C/C++ implementation. + +There are two shared objects provided by this package: libac.so and +ahocorasick.so The former is a regular shared object which can be directly used +by C/C++ application, or by Lua via FFI; and the later is a Lua module. + +WWW: https://github.com/cloudflare/lua-aho-corasick