diff --git a/textproc/ugrep/Makefile b/textproc/ugrep/Makefile index 15eaa776c31c..48f8f6112550 100644 --- a/textproc/ugrep/Makefile +++ b/textproc/ugrep/Makefile @@ -1,64 +1,64 @@ PORTNAME= ugrep DISTVERSIONPREFIX= v DISTVERSION= 4.5.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= textproc MAINTAINER= ashish@FreeBSD.org COMMENT= NEW ultra fast grep with interactive query UI WWW= https://ugrep.com LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE.txt USES= compiler:c++11-lang gmake shebangfix USE_GITHUB= yes GH_ACCOUNT= Genivia OPTIONS_DEFINE= COLOR HIDDEN LZ4 MMAP PAGER PCRE2 PRETTY ZSTD BROTLI BZIP3 7ZIP OPTIONS_DEFINE_aarch64= NEON OPTIONS_DEFINE_amd64= AVX SSE2 OPTIONS_DEFAULT= COLOR HIDDEN LZ4 MMAP PAGER PCRE2 PRETTY ZSTD BROTLI BZIP3 7ZIP OPTIONS_DEFAULT_aarch64= NEON OPTIONS_DEFAULT_amd64= AVX SSE2 GNU_CONFIGURE= yes CONFIGURE_ARGS=--with-bash-completion-dir=${PREFIX}/etc/bash_completion.d \ --with-fish-completion-dir=${PREFIX}/share/fish/completions \ --with-zsh-completion-dir=${PREFIX}/share/zsh/site-functions SHEBANG_FILES= bin/ug+ bin/ugrep+ bash_CMD= ${SH} PCRE2_DESC= Use Perl Compatible Regular Expressions v2 PCRE2_CONFIGURE_WITH= pcre2=${LOCALBASE} PCRE2_LIB_DEPENDS= libpcre2-8.so:devel/pcre2 LZ4_CONFIGURE_WITH= lz4=${LOCALBASE} LZ4_LIB_DEPENDS= liblz4.so:archivers/liblz4 NEON_DESC= ARM NEON/AArch64 optimizations NEON_CONFIGURE_OFF= --disable-neon AVX_CONFIGURE_OFF= --disable-avx AVX_DESC= AVX optimizations SSE2_CONFIGURE_OFF= --disable-sse2 SSE2_DESC= SSE2 optimizations COLOR_DESC= Colorized output by default COLOR_CONFIGURE_OFF= --disable-auto-color PRETTY_DESC= Pretty output by default PRETTY_CONFIGURE_ENABLE= pretty PAGER_DESC= Pager enabled by default PAGER_CONFIGURE_ENABLE= pager HIDDEN_DESC= Search hidden files by default HIDDEN_CONFIGURE_ENABLE= hidden MMAP_DESC= Enable memory mapped files by default MMAP_CONFIGURE_ENABLE= mmap ZSTD_CONFIGURE_WITH= zstd=${LOCALBASE} ZSTD_LIB_DEPENDS= libzstd.so:archivers/zstd BROTLI_CONFIGURE_WITH= brotli=${LOCALBASE} BROTLI_LIB_DEPENDS= libbrotlidec.so:archivers/brotli BZIP3_DESC= bzip3 compression support BZIP3_CONFIGURE_WITH= bzip3=${LOCALBASE} BZIP3_LIB_DEPENDS= libbzip3.so:archivers/bzip3 7ZIP_DESC= 7zip support 7ZIP_CONFIGURE_ENABLE= 7zip .include diff --git a/textproc/ugrep/files/patch-lzma_C_CpuArch.c b/textproc/ugrep/files/patch-lzma_C_CpuArch.c index 11cb95f5d0a8..bad85faa10c3 100644 --- a/textproc/ugrep/files/patch-lzma_C_CpuArch.c +++ b/textproc/ugrep/files/patch-lzma_C_CpuArch.c @@ -1,15 +1,42 @@ ---- lzma/C/CpuArch.c.orig 2024-01-24 11:26:34 UTC +--- lzma/C/CpuArch.c.orig 2024-01-25 12:25:30 UTC +++ lzma/C/CpuArch.c -@@ -762,10 +762,11 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP +@@ -762,6 +762,31 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP #include -+#ifdef __linux__ - #define USE_HWCAP ++#if defined(__FreeBSD__) ++static unsigned long get_hwcap(int aux) { ++ unsigned long hwcap; ++ if (elf_aux_info(aux, &hwcap, sizeof hwcap) != 0) { ++ return 0; ++ } ++ return hwcap; ++} ++ ++#ifdef MY_CPU_ARM64 ++BoolInt CPU_IsSupported_CRC32(void) { return get_hwcap(AT_HWCAP) & HWCAP_CRC32; } ++BoolInt CPU_IsSupported_NEON(void) { return 1; } ++BoolInt CPU_IsSupported_SHA1(void){ return get_hwcap(AT_HWCAP) & HWCAP_SHA1; } ++BoolInt CPU_IsSupported_SHA2(void) { return get_hwcap(AT_HWCAP) & HWCAP_SHA2; } ++BoolInt CPU_IsSupported_AES(void) { return get_hwcap(AT_HWCAP) & HWCAP_AES; } ++#else /* MY_CPU_ARM */ ++BoolInt CPU_IsSupported_CRC32(void) { return get_hwcap(AT_HWCAP2) & HWCAP2_CRC32; } ++BoolInt CPU_IsSupported_NEON(void) { return get_hwcap(AT_HWCAP) & HWCAP_NEON; } ++BoolInt CPU_IsSupported_SHA1(void){ return get_hwcap(AT_HWCAP2) & HWCAP2_SHA1; } ++BoolInt CPU_IsSupported_SHA2(void) { return get_hwcap(AT_HWCAP2) & HWCAP2_SHA2; } ++BoolInt CPU_IsSupported_AES(void) { return get_hwcap(AT_HWCAP2) & HWCAP2_AES; } +#endif ++ ++#else // __FreeBSD__ ++ + #define USE_HWCAP #ifdef USE_HWCAP -- - #include +@@ -795,6 +820,7 @@ MY_HWCAP_CHECK_FUNC (AES) + MY_HWCAP_CHECK_FUNC (SHA2) + MY_HWCAP_CHECK_FUNC (AES) + ++#endif // FreeBSD + #endif // __APPLE__ + #endif // _WIN32 - #define MY_HWCAP_CHECK_FUNC_2(name1, name2) \