diff --git a/sysutils/fsearch/Makefile b/sysutils/fsearch/Makefile index 5fa28938669b..f6f1c398af83 100644 --- a/sysutils/fsearch/Makefile +++ b/sysutils/fsearch/Makefile @@ -1,32 +1,25 @@ PORTNAME= fsearch -PORTVERSION= 0.1.4 +PORTVERSION= 0.2.1 CATEGORIES= sysutils -PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ -PATCHFILES= 7f602118e0de9f524e71.diff:-p1 f0ee01b40156ddb36651.diff:-p1 - MAINTAINER= danfe@FreeBSD.org COMMENT= Fast file search utility for Unix-like systems LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/License -BUILD_DEPENDS= ${LOCALBASE}/share/aclocal/ax_check_compile_flag.m4:devel/autoconf-archive LIB_DEPENDS= libicuuc.so:devel/icu \ - libpcre.so:devel/pcre + libpcre2-8.so:devel/pcre2 USE_GITHUB= yes GH_ACCOUNT= cboxdoerfer -USES= autoreconf compiler:c++11-lang gettext gmake gnome pkgconfig -GNU_CONFIGURE= yes -USE_GNOME= cairo gdkpixbuf2 gtk30 intltool +USES= meson gettext-tools gnome pkgconfig +USE_GNOME= cairo gdkpixbuf2 gtk30 post-patch: - @${REINPLACE_CMD} -e 's,v=UNKNOWN,v=${DISTVERSION},' \ - ${WRKSRC}/build-aux/git-version-gen @${PRINTF} '\n%s\n%s;\n' int \ 'strverscmp(const char *, const char *)' \ >> ${WRKSRC}/src/fsearch_string_utils.h .include diff --git a/sysutils/fsearch/distinfo b/sysutils/fsearch/distinfo index ad28d7c70e39..cb27f4cf38d2 100644 --- a/sysutils/fsearch/distinfo +++ b/sysutils/fsearch/distinfo @@ -1,7 +1,3 @@ -TIMESTAMP = 1657035129 -SHA256 (cboxdoerfer-fsearch-0.1.4_GH0.tar.gz) = 289c19136f89712100ff8f6ad4e7cbbdfbd2938a7c076c85c45658f5c36fc7fd -SIZE (cboxdoerfer-fsearch-0.1.4_GH0.tar.gz) = 506441 -SHA256 (7f602118e0de9f524e71.diff) = e8450734c460fc837dbde12e15f97dcb4fb4af376516acbae9cf7874bc07f531 -SIZE (7f602118e0de9f524e71.diff) = 695 -SHA256 (f0ee01b40156ddb36651.diff) = ce12c4b2212189abe2d8a8839c81d3105be71781aa7fce30851dcac7f9ef9beb -SIZE (f0ee01b40156ddb36651.diff) = 1747 +TIMESTAMP = 1660758625 +SHA256 (cboxdoerfer-fsearch-0.2.1_GH0.tar.gz) = 5fb8f8280ea4417d949b055bbd576161a42d360727abea3d7e9c9300c978a650 +SIZE (cboxdoerfer-fsearch-0.2.1_GH0.tar.gz) = 675832 diff --git a/sysutils/fsearch/files/patch-src_fsearch__string__utils.c b/sysutils/fsearch/files/patch-src_fsearch__string__utils.c index 6f847df9fe24..3c61ea1ee27f 100644 --- a/sysutils/fsearch/files/patch-src_fsearch__string__utils.c +++ b/sysutils/fsearch/files/patch-src_fsearch__string__utils.c @@ -1,94 +1,94 @@ ---- src/fsearch_string_utils.c.orig 2022-01-29 18:56:49 UTC +--- src/fsearch_string_utils.c.orig 2022-08-17 17:50:25 UTC +++ src/fsearch_string_utils.c -@@ -214,3 +214,91 @@ fs_str_split(const char *src) { - - return (char **)g_ptr_array_free(new, FALSE); +@@ -164,3 +164,91 @@ fsearch_string_starts_with_interval(char *str, char ** + *end_ptr = str; + return false; } + +/* Compare strings while treating digits characters numerically. + Copyright (C) 1997-2022 Free Software Foundation, Inc. + Contributed by Jean-François Bignolles , + 1997. */ + +#include + +/* states: S_N: normal, S_I: comparing integral part, S_F: comparing + fractional parts, S_Z: idem but with leading Zeroes only */ +#define S_N 0x0 +#define S_I 0x3 +#define S_F 0x6 +#define S_Z 0x9 + +/* result_type: CMP: return diff; LEN: compare using len_diff/diff */ +#define CMP 2 +#define LEN 3 + +/* Compare S1 and S2 as strings holding indices/version numbers, + returning less than, equal to, or greater than zero if S1 is less + than, equal to, or greater than S2. */ + +int +strverscmp (const char *s1, const char *s2) +{ + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + + /* Symbol(s) 0 [1-9] others + Transition (10) 0 (01) d (00) x */ + static const uint_least8_t next_state[] = + { + /* state x d 0 */ + /* S_N */ S_N, S_I, S_Z, + /* S_I */ S_N, S_I, S_I, + /* S_F */ S_N, S_F, S_F, + /* S_Z */ S_N, S_F, S_Z + }; + + static const int_least8_t result_type[] = + { + /* state x/x x/d x/0 d/x d/d d/0 0/x 0/d 0/0 */ + + /* S_N */ CMP, CMP, CMP, CMP, LEN, CMP, CMP, CMP, CMP, + /* S_I */ CMP, -1, -1, +1, LEN, LEN, +1, LEN, LEN, + /* S_F */ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_Z */ CMP, +1, +1, -1, CMP, CMP, -1, CMP, CMP + }; + + if (p1 == p2) + return 0; + + unsigned char c1 = *p1++; + unsigned char c2 = *p2++; + /* Hint: '0' is a digit too. */ + int state = S_N + ((c1 == '0') + (isdigit (c1) != 0)); + + int diff; + while ((diff = c1 - c2) == 0) + { + if (c1 == '\0') + return diff; + + state = next_state[state]; + c1 = *p1++; + c2 = *p2++; + state += (c1 == '0') + (isdigit (c1) != 0); + } + + state = result_type[state * 3 + (((c2 == '0') + (isdigit (c2) != 0)))]; + + switch (state) + { + case CMP: + return diff; + + case LEN: + while (isdigit (*p1++)) + if (!isdigit (*p2++)) + return 1; + + return isdigit (*p2) ? -1 : diff; + + default: + return state; + } +} diff --git a/sysutils/fsearch/pkg-plist b/sysutils/fsearch/pkg-plist index 7ab0d448348f..bb3e8b172687 100644 --- a/sysutils/fsearch/pkg-plist +++ b/sysutils/fsearch/pkg-plist @@ -1,36 +1,39 @@ bin/fsearch man/man1/fsearch.1.gz -share/applications/fsearch.desktop +share/applications/io.github.cboxdoerfer.FSearch.desktop share/icons/hicolor/scalable/apps/io.github.cboxdoerfer.FSearch.svg share/locale/ar/LC_MESSAGES/fsearch.mo share/locale/ber/LC_MESSAGES/fsearch.mo share/locale/bg/LC_MESSAGES/fsearch.mo share/locale/ca/LC_MESSAGES/fsearch.mo share/locale/de/LC_MESSAGES/fsearch.mo share/locale/el/LC_MESSAGES/fsearch.mo share/locale/en_GB/LC_MESSAGES/fsearch.mo share/locale/es/LC_MESSAGES/fsearch.mo +share/locale/eu/LC_MESSAGES/fsearch.mo share/locale/fi/LC_MESSAGES/fsearch.mo share/locale/fr/LC_MESSAGES/fsearch.mo share/locale/gl/LC_MESSAGES/fsearch.mo share/locale/he/LC_MESSAGES/fsearch.mo share/locale/hu/LC_MESSAGES/fsearch.mo share/locale/id/LC_MESSAGES/fsearch.mo share/locale/ie/LC_MESSAGES/fsearch.mo share/locale/it/LC_MESSAGES/fsearch.mo share/locale/ja/LC_MESSAGES/fsearch.mo share/locale/ko/LC_MESSAGES/fsearch.mo share/locale/lt/LC_MESSAGES/fsearch.mo +share/locale/mr/LC_MESSAGES/fsearch.mo share/locale/nb_NO/LC_MESSAGES/fsearch.mo share/locale/nl/LC_MESSAGES/fsearch.mo share/locale/pl/LC_MESSAGES/fsearch.mo share/locale/pt/LC_MESSAGES/fsearch.mo share/locale/pt_BR/LC_MESSAGES/fsearch.mo share/locale/ru/LC_MESSAGES/fsearch.mo share/locale/sk/LC_MESSAGES/fsearch.mo share/locale/sv/LC_MESSAGES/fsearch.mo share/locale/te/LC_MESSAGES/fsearch.mo share/locale/tr/LC_MESSAGES/fsearch.mo share/locale/tzm/LC_MESSAGES/fsearch.mo share/locale/uk/LC_MESSAGES/fsearch.mo share/locale/zh_CN/LC_MESSAGES/fsearch.mo +share/metainfo/io.github.cboxdoerfer.FSearch.appdata.xml