git: ddd386c470a1 - main - textproc/krep: [NEW PORT] High-performance string search utility
Date: Wed, 18 Feb 2026 20:00:17 UTC
The branch main has been updated by alven:
URL: https://cgit.FreeBSD.org/ports/commit/?id=ddd386c470a1018eb1c0ff0c624eb1b571c9a3be
commit ddd386c470a1018eb1c0ff0c624eb1b571c9a3be
Author: Älven <alven@FreeBSD.org>
AuthorDate: 2026-02-18 16:48:00 +0000
Commit: Älven <alven@FreeBSD.org>
CommitDate: 2026-02-18 19:57:50 +0000
textproc/krep: [NEW PORT] High-performance string search utility
krep is an optimized string search utility designed for maximum throughput and
efficiency when processing large files and directories. It is built with
performance in mind, offering multiple search algorithms and SIMD acceleration
when available.
Note: Krep is not intended to be a full replacement or direct competitor to
feature-rich tools like grep or ripgrep. Instead, it aims to be a minimal,
efficient, and pragmatic tool focused on speed and simplicity.
Krep provides the essential features needed for fast searching, without the
extensive options and complexity of more comprehensive search utilities. Its
design philosophy is to deliver the fastest possible search for the most common
use cases, with a clean and minimal interface.
WWW: https://github.com/davidesantangelo/krep/
Approved by: db@, yuri@ (Mentors, implicit)
Differential Revision: https://reviews.freebsd.org/D55357
---
textproc/Makefile | 1 +
textproc/krep/Makefile | 26 ++++++++++++++++++++++++++
textproc/krep/distinfo | 3 +++
textproc/krep/files/patch-Makefile | 34 ++++++++++++++++++++++++++++++++++
textproc/krep/pkg-descr | 13 +++++++++++++
5 files changed, 77 insertions(+)
diff --git a/textproc/Makefile b/textproc/Makefile
index bde3b9758358..e5e48ee77169 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -372,6 +372,7 @@
SUBDIR += kmflcomp
SUBDIR += kn-aspell
SUBDIR += kompare
+ SUBDIR += krep
SUBDIR += kreport
SUBDIR += ku-aspell
SUBDIR += ky-aspell
diff --git a/textproc/krep/Makefile b/textproc/krep/Makefile
new file mode 100644
index 000000000000..9b348d3c46d8
--- /dev/null
+++ b/textproc/krep/Makefile
@@ -0,0 +1,26 @@
+PORTNAME= krep
+DISTVERSIONPREFIX= v
+DISTVERSION= 2.2.0
+CATEGORIES= textproc
+
+MAINTAINER= alven@FreeBSD.org
+COMMENT= High-performance string search utility
+WWW= https://github.com/davidesantangelo/krep/
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USES= gmake
+
+USE_GITHUB= yes
+GH_ACCOUNT= davidesantangelo
+
+TEST_TARGET= test
+
+PLIST_FILES= bin/krep
+
+OPTIONS_DEFINE= SIMD
+
+SIMD_MAKE_ARGS= SIMD=1
+
+.include <bsd.port.mk>
diff --git a/textproc/krep/distinfo b/textproc/krep/distinfo
new file mode 100644
index 000000000000..e77a5d73b290
--- /dev/null
+++ b/textproc/krep/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1771430500
+SHA256 (davidesantangelo-krep-v2.2.0_GH0.tar.gz) = 9929a0b8a4d6502689e562657777f2ce47fc4e1d67ae81b6f1d2104ac1900b84
+SIZE (davidesantangelo-krep-v2.2.0_GH0.tar.gz) = 78896
diff --git a/textproc/krep/files/patch-Makefile b/textproc/krep/files/patch-Makefile
new file mode 100644
index 000000000000..fc763f843ff5
--- /dev/null
+++ b/textproc/krep/files/patch-Makefile
@@ -0,0 +1,34 @@
+--- Makefile.orig 2026-02-18 16:14:00 UTC
++++ Makefile
+@@ -5,10 +5,10 @@ BINDIR = $(PREFIX)/bin
+ PREFIX ?= /usr/local
+ BINDIR = $(PREFIX)/bin
+
+-CC = gcc
+-CFLAGS = -Wall -Wextra -O3 -ffast-math -std=c11 -pthread -D_GNU_SOURCE -D_DEFAULT_SOURCE \
++CC ?= gcc
++CFLAGS ?= -Wall -Wextra -O3 -ffast-math -std=c11 -pthread -D_GNU_SOURCE -D_DEFAULT_SOURCE \
+ -flto -funroll-loops -finline-functions
+-LDFLAGS = -pthread -flto
++LDFLAGS += -pthread -flto
+
+ # Build mode: set NATIVE=1 for maximum performance on local machine
+ # Example: make NATIVE=1
+@@ -19,6 +19,9 @@ ARCH := $(shell uname -m)
+ # Detect architecture for SIMD flags
+ ARCH := $(shell uname -m)
+
++# Build mode: set SIMD=1 for maximum performance using SIMD instructions
++# Example: make SIMD=1
++ifdef SIMD
+ ifeq ($(ARCH), x86_64)
+ # Check for AVX-512 support (Linux: /proc/cpuinfo, macOS: sysctl)
+ HAS_AVX512 := $(shell (grep -q avx512f /proc/cpuinfo 2>/dev/null && echo 1) || \
+@@ -46,6 +49,7 @@ else ifeq ($(ARCH), aarch64)
+ else ifeq ($(ARCH), aarch64)
+ # Enable NEON for aarch64 Linux
+ CFLAGS += -D__ARM_NEON
++endif
+ endif
+
+ # Source files
diff --git a/textproc/krep/pkg-descr b/textproc/krep/pkg-descr
new file mode 100644
index 000000000000..0fc2e01d096c
--- /dev/null
+++ b/textproc/krep/pkg-descr
@@ -0,0 +1,13 @@
+krep is an optimized string search utility designed for maximum throughput and
+efficiency when processing large files and directories. It is built with
+performance in mind, offering multiple search algorithms and SIMD acceleration
+when available.
+
+Note: Krep is not intended to be a full replacement or direct competitor to
+feature-rich tools like grep or ripgrep. Instead, it aims to be a minimal,
+efficient, and pragmatic tool focused on speed and simplicity.
+
+Krep provides the essential features needed for fast searching, without the
+extensive options and complexity of more comprehensive search utilities. Its
+design philosophy is to deliver the fastest possible search for the most common
+use cases, with a clean and minimal interface.