* [gentoo-commits] repo/gentoo:master commit in: sys-apps/the_silver_searcher/, sys-apps/the_silver_searcher/files/
@ 2016-12-04 0:32 Tim Harder
0 siblings, 0 replies; 6+ messages in thread
From: Tim Harder @ 2016-12-04 0:32 UTC (permalink / raw
To: gentoo-commits
commit: 65c48de84e88951210cc36db7c54a21bd47f0d7d
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 4 00:31:24 2016 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sun Dec 4 00:32:30 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65c48de8
sys-apps/the_silver_searcher: version bump to 1.0.1
sys-apps/the_silver_searcher/Manifest | 1 +
.../files/the_silver_searcher-1.0.1-tests.patch | 17 ++++++++
.../the_silver_searcher-1.0.1.ebuild | 48 ++++++++++++++++++++++
3 files changed, 66 insertions(+)
diff --git a/sys-apps/the_silver_searcher/Manifest b/sys-apps/the_silver_searcher/Manifest
index e572b91..47c7392 100644
--- a/sys-apps/the_silver_searcher/Manifest
+++ b/sys-apps/the_silver_searcher/Manifest
@@ -1,2 +1,3 @@
DIST the_silver_searcher-0.32.0.tar.gz 152041 SHA256 c5b208572e5cfc8a3cf366e8eb337b0c673c2ffa90c1ad90dfdcbe78251ba4cc SHA512 c5664205844f17d7739742949524d42f7ff403884a1bb13b32c9a14bde76d5129259d26a782057adf340ea1afc0caa6bd7b51d59caf795937389ff88f3a373bc WHIRLPOOL 85b284bf928a4cf5e28014678f01450c1083f15b08837069c4d4097122c84122a558f6175789131198fb003715b7dc030b48957d76cb7e00624d499812ce065f
DIST the_silver_searcher-0.33.0.tar.gz 153459 SHA256 351ab79ada811fd08f81296de10a7498ea3c46b681d73696d5a2911edbdc19db SHA512 7ce2eb32f2ed1f49c53de13f9edb755c43b8915424039c242b4ce947ac9c54094f285fd1018386bdb6bcf3dd088f9d943e0c4d22d82b9b2387a9664fc20a6ca3 WHIRLPOOL f93bbf2dd7f2ddae4e8aaad37ad0994585e3dfcbdaa1df57a225b9af2aa4232f8b45d1c5a1f28c47333097fe16350d0f1b1dffade3371a47f049e4d0517e4848
+DIST the_silver_searcher-1.0.1.tar.gz 156764 SHA256 a79e6b024c6c756589b0d5ffbffe65983c750a07099d28aa5036d47a9feec86b SHA512 4d9d7f32a8268112636d9aac33f9b7fb3e2730cec1db70ffe246f2feb7d5c66150d44862f71e3ab02d35b9f0748db09c3e69c9769cda37a2a431af808dbb50c8 WHIRLPOOL 888d06fb25b5ffde2289a2e91f7dcc1c97dd2bafdd67dbb32baa84f51178211fa2c3fb07da94b89ed5cbdb412954b62b2e6de2efd5c4ac8fac6b9a7c348a2b76
diff --git a/sys-apps/the_silver_searcher/files/the_silver_searcher-1.0.1-tests.patch b/sys-apps/the_silver_searcher/files/the_silver_searcher-1.0.1-tests.patch
new file mode 100644
index 00000000..b281594
--- /dev/null
+++ b/sys-apps/the_silver_searcher/files/the_silver_searcher-1.0.1-tests.patch
@@ -0,0 +1,17 @@
+Drop the last test since it has file sorting issues.
+
+--- the_silver_searcher-1.0.1/tests/empty_match.t
++++ the_silver_searcher-1.0.1/tests/empty_match.t
+@@ -11,12 +11,3 @@
+ A genuine zero-length match should succeed:
+ $ ag "^" nonempty.txt
+ 1:foo
+-
+-Empty files should be listed with --unrestricted --files-with-matches (-ul)
+- $ ag -lu --stats | sed '$d' # Remove the last line about timing which will differ
+- empty.txt
+- nonempty.txt
+- 2 matches
+- 2 files contained matches
+- 2 files searched
+- 4 bytes searched
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-1.0.1.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-1.0.1.ebuild
new file mode 100644
index 00000000..a5255e1
--- /dev/null
+++ b/sys-apps/the_silver_searcher/the_silver_searcher-1.0.1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit autotools bash-completion-r1
+
+DESCRIPTION="A code-searching tool similar to ack, but faster"
+HOMEPAGE="https://github.com/ggreer/the_silver_searcher"
+SRC_URI="https://github.com/ggreer/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="lzma test zlib"
+
+RDEPEND="dev-libs/libpcre
+ lzma? ( app-arch/xz-utils )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-util/cram )"
+
+DOCS="README.md"
+
+PATCHES=( "${FILESDIR}"/${P}-tests.patch )
+
+src_prepare() {
+ sed '/^dist_bashcomp/d' -i Makefile.am || die
+
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable lzma) \
+ $(use_enable zlib)
+}
+
+src_test() {
+ cram -v tests/*.t || die "tests failed"
+}
+
+src_install() {
+ default
+ newbashcomp ag.bashcomp.sh ag
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/the_silver_searcher/, sys-apps/the_silver_searcher/files/
@ 2017-08-31 15:39 Tim Harder
0 siblings, 0 replies; 6+ messages in thread
From: Tim Harder @ 2017-08-31 15:39 UTC (permalink / raw
To: gentoo-commits
commit: 65044f36470c4c310972c72520a7c3250266acfa
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 31 15:38:25 2017 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Thu Aug 31 15:39:05 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65044f36
sys-apps/the_silver_searcher: remove old
sys-apps/the_silver_searcher/Manifest | 2 -
.../files/the_silver_searcher-1.0.1-tests.patch | 17 --------
.../the_silver_searcher-1.0.2.ebuild | 47 ----------------------
.../the_silver_searcher-1.0.3.ebuild | 45 ---------------------
4 files changed, 111 deletions(-)
diff --git a/sys-apps/the_silver_searcher/Manifest b/sys-apps/the_silver_searcher/Manifest
index b534e29a933..58ba191ec75 100644
--- a/sys-apps/the_silver_searcher/Manifest
+++ b/sys-apps/the_silver_searcher/Manifest
@@ -1,4 +1,2 @@
-DIST the_silver_searcher-1.0.2.tar.gz 156870 SHA256 4cb73a4436fccf2c2cae91479a0167bacaa968a4deca28f3ff9d5abd98f01009 SHA512 58f06133907cf7d7f229b5153bef96b5e76ae6cbbcdaf7d00b52bd9d6595c006417365c2b8535254f943c2fd5559792953e14cc9ba1041d5dfbe0d5b4a3ba2c5 WHIRLPOOL 441613aebcbcf7119506d04020b7f9dd3c46b69e68868ea8db2c29267f4c2b678a0a26a62e55acb5bf3cf4836ef40220e1a3f24fca7fa494ffca1d7b42989bd4
-DIST the_silver_searcher-1.0.3.tar.gz 157093 SHA256 ce45de7412ee0ae6f22d72e17b81425666e6130da8cb434d5ca8ea42185e514e SHA512 15d6898c43a144289892d41d7c207bb16224d9f9f05bd237b803160aa04eb89f44239a0ee6ff7e955533ef5f6e11b73d13c1ec07e11ae2a5b3c44e3d5b53f137 WHIRLPOOL ef0ac9b69867afc1423e121d05af1acd8a0de6e57a8f03557d173bbc9d39f82fd978c6d3e5b23e04478c2d37e203eb8eb25f4d17d7a8bed2d0717d8fe7b5ceb2
DIST the_silver_searcher-2.0.0.tar.gz 160093 SHA256 ff7243863f22ed73eeab6f7a6d17cfff585a7eaa41d5ab3ae4f5d6db97701d5f SHA512 2587b9958fadcf5d95bc472f901904edb0d3d9bbc652dc6bb3801b77e7dfa744a97869bed4699776cc3fdcd7b0319fcecbe4b08ccfda617d1c2aa4ea8e9f990d WHIRLPOOL 4c2ca9594d4d7d0cff4141e4bc76c6d150ff58ed301269a7b6348616c75ae33c525eb5ec2534af21e1cf07da5f12d0c121802d0c1a97dce6621e53f90d8508cf
DIST the_silver_searcher-2.1.0.tar.gz 163139 SHA256 cb416a0da7fe354a009c482ae709692ed567f8e7d2dad4d242e726dd7ca202f0 SHA512 9b49b1666bbb915b122eae45dbe5dbdba18539257b59f1dee9ba9ec86dbe73c7c8ecde1eff9d3e06951295685161fc4594fcdbfa5d19d7b466f2a7f95021e631 WHIRLPOOL 374ce8e15e4e9eee2175390d9af3d53d88528ee31c57cb97e33b7624bb6c8e344c213ab1dec69228501f1feec10fbd18e28ebb5ee78d95d1b660cf1bd997642f
diff --git a/sys-apps/the_silver_searcher/files/the_silver_searcher-1.0.1-tests.patch b/sys-apps/the_silver_searcher/files/the_silver_searcher-1.0.1-tests.patch
deleted file mode 100644
index b281594732e..00000000000
--- a/sys-apps/the_silver_searcher/files/the_silver_searcher-1.0.1-tests.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Drop the last test since it has file sorting issues.
-
---- the_silver_searcher-1.0.1/tests/empty_match.t
-+++ the_silver_searcher-1.0.1/tests/empty_match.t
-@@ -11,12 +11,3 @@
- A genuine zero-length match should succeed:
- $ ag "^" nonempty.txt
- 1:foo
--
--Empty files should be listed with --unrestricted --files-with-matches (-ul)
-- $ ag -lu --stats | sed '$d' # Remove the last line about timing which will differ
-- empty.txt
-- nonempty.txt
-- 2 matches
-- 2 files contained matches
-- 2 files searched
-- 4 bytes searched
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-1.0.2.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-1.0.2.ebuild
deleted file mode 100644
index 9df59dc5451..00000000000
--- a/sys-apps/the_silver_searcher/the_silver_searcher-1.0.2.ebuild
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit autotools bash-completion-r1
-
-DESCRIPTION="A code-searching tool similar to ack, but faster"
-HOMEPAGE="https://github.com/ggreer/the_silver_searcher"
-SRC_URI="https://github.com/ggreer/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~hppa ~mips ~ppc ~ppc64 x86 ~amd64-fbsd ~x86-fbsd"
-IUSE="lzma test zlib"
-
-RDEPEND="dev-libs/libpcre
- lzma? ( app-arch/xz-utils )
- zlib? ( sys-libs/zlib )"
-DEPEND="${RDEPEND}
- virtual/pkgconfig
- test? ( dev-util/cram )"
-
-DOCS="README.md"
-
-PATCHES=( "${FILESDIR}"/${PN}-1.0.1-tests.patch )
-
-src_prepare() {
- sed '/^dist_bashcomp/d' -i Makefile.am || die
-
- default
- eautoreconf
-}
-
-src_configure() {
- econf \
- $(use_enable lzma) \
- $(use_enable zlib)
-}
-
-src_test() {
- cram -v tests/*.t || die "tests failed"
-}
-
-src_install() {
- default
- newbashcomp ag.bashcomp.sh ag
-}
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-1.0.3.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-1.0.3.ebuild
deleted file mode 100644
index 3f4a2aae03c..00000000000
--- a/sys-apps/the_silver_searcher/the_silver_searcher-1.0.3.ebuild
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit autotools bash-completion-r1
-
-DESCRIPTION="A code-searching tool similar to ack, but faster"
-HOMEPAGE="https://github.com/ggreer/the_silver_searcher"
-SRC_URI="https://github.com/ggreer/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd"
-IUSE="lzma test zlib"
-
-RDEPEND="dev-libs/libpcre
- lzma? ( app-arch/xz-utils )
- zlib? ( sys-libs/zlib )"
-DEPEND="${RDEPEND}
- virtual/pkgconfig
- test? ( dev-util/cram )"
-
-DOCS="README.md"
-
-src_prepare() {
- sed '/^dist_bashcomp/d' -i Makefile.am || die
-
- default
- eautoreconf
-}
-
-src_configure() {
- econf \
- $(use_enable lzma) \
- $(use_enable zlib)
-}
-
-src_test() {
- cram -v tests/*.t || die "tests failed"
-}
-
-src_install() {
- default
- newbashcomp ag.bashcomp.sh ag
-}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/the_silver_searcher/, sys-apps/the_silver_searcher/files/
@ 2018-01-13 3:55 Benda XU
0 siblings, 0 replies; 6+ messages in thread
From: Benda XU @ 2018-01-13 3:55 UTC (permalink / raw
To: gentoo-commits
commit: 0e097638d594a9296c20670f63de9e0b4d0906b6
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 13 03:54:49 2018 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sat Jan 13 03:55:03 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e097638
sys-apps/the_silver_searcher: fix build when USE=-lzma
Suggested-By: Oleg, Nicolas Porcel
Closes: https://bugs.gentoo.org/629488
Package-Manager: Portage-2.3.19, Repoman-2.3.6
.../files/the_silver_searcher-2.1.0-lzma.patch | 491 +++++++++++++++++++++
.../the_silver_searcher-2.1.0.ebuild | 4 +-
2 files changed, 494 insertions(+), 1 deletion(-)
diff --git a/sys-apps/the_silver_searcher/files/the_silver_searcher-2.1.0-lzma.patch b/sys-apps/the_silver_searcher/files/the_silver_searcher-2.1.0-lzma.patch
new file mode 100644
index 00000000000..21eb7118b20
--- /dev/null
+++ b/sys-apps/the_silver_searcher/files/the_silver_searcher-2.1.0-lzma.patch
@@ -0,0 +1,491 @@
+From 24995eb239799e52ae09d47b7520d50a3b8b606c Mon Sep 17 00:00:00 2001
+From: Allen Wild <allenwild93@gmail.com>
+Date: Tue, 5 Sep 2017 19:48:49 -0400
+Subject: [PATCH] zfile: fix build when zlib and/or lzma are excluded
+
+Currently, zfile won't build if either zlib.h or lzma.h are missing
+
+ * Add several inline wrapper functions which check cookie->ctype and
+ call an inline zlib or lzma implementation function.
+ - This cleans up zfile_read at the expense of growing the file and
+ adding 2 layers of function calls. Everything is static and inline
+ so the compiler should be able to optimize sufficiently.
+ * Stub functions are #define'd for the unsupported compression method
+ (if applicable)
+ * Use an Automake conditional to only build zfile.c if either
+ zlib.h or lzma.h are available, define the symbol USE_FOPENCOOKIE if
+ this is the case and check it instead of HAVE_FOPENCOOKIE
+ * Replace tabs in zfile.c with spaces for consistency with the rest of
+ the codebase
+
+Fixes: #1147
+---
+ Makefile.am | 6 +-
+ configure.ac | 5 +
+ src/decompress.h | 2 +-
+ src/search.c | 2 +-
+ src/zfile.c | 301 ++++++++++++++++++++++++++++++++++++++++---------------
+ 5 files changed, 232 insertions(+), 84 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 3931c3a7..4d85f54f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,9 +1,13 @@
+ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
+
+ bin_PROGRAMS = ag
+-ag_SOURCES = src/ignore.c src/ignore.h src/log.c src/log.h src/options.c src/options.h src/print.c src/print_w32.c src/print.h src/scandir.c src/scandir.h src/search.c src/search.h src/lang.c src/lang.h src/util.c src/util.h src/decompress.c src/decompress.h src/uthash.h src/main.c src/zfile.c
++ag_SOURCES = src/ignore.c src/ignore.h src/log.c src/log.h src/options.c src/options.h src/print.c src/print_w32.c src/print.h src/scandir.c src/scandir.h src/search.c src/search.h src/lang.c src/lang.h src/util.c src/util.h src/decompress.c src/decompress.h src/uthash.h src/main.c
+ ag_LDADD = ${PCRE_LIBS} ${LZMA_LIBS} ${ZLIB_LIBS} $(PTHREAD_LIBS)
+
++if USE_FOPENCOOKIE
++ag_SOURCES += src/zfile.c src/zfile.h
++endif
++
+ dist_man_MANS = doc/ag.1
+
+ bashcompdir = $(pkgdatadir)/completions
+diff --git a/configure.ac b/configure.ac
+index 982cc3b2..5917ecc1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -66,6 +66,11 @@ AC_CHECK_MEMBER([struct dirent.d_namlen], [AC_DEFINE([HAVE_DIRENT_DNAMLEN], [],
+
+ AC_CHECK_FUNCS(fgetln fopencookie getline realpath strlcpy strndup vasprintf madvise posix_fadvise pthread_setaffinity_np pledge)
+
++# Only build zfile.c if we need it
++AM_CONDITIONAL([USE_FOPENCOOKIE], [(test "$ac_cv_func_fopencookie" = "yes") &&
++ (test "$ac_cv_header_zlib_h" = "yes" || test "$ac_cv_header_lzma_h" = "yes")])
++AM_COND_IF([USE_FOPENCOOKIE], [AC_DEFINE([USE_FOPENCOOKIE], [], [Use fopencookie streaming in zfile.c])])
++
+ AC_CONFIG_FILES([Makefile the_silver_searcher.spec])
+ AC_CONFIG_HEADERS([src/config.h])
+
+diff --git a/src/decompress.h b/src/decompress.h
+index 9c5592cf..d5c3d582 100644
+--- a/src/decompress.h
++++ b/src/decompress.h
+@@ -19,7 +19,7 @@ ag_compression_type is_zipped(const void *buf, const int buf_len);
+
+ void *decompress(const ag_compression_type zip_type, const void *buf, const int buf_len, const char *dir_full_path, int *new_buf_len);
+
+-#if HAVE_FOPENCOOKIE
++#ifdef USE_FOPENCOOKIE
+ FILE *decompress_open(int fd, const char *mode, ag_compression_type ctype);
+ #endif
+
+diff --git a/src/search.c b/src/search.c
+index 14e9d415..84d9423f 100644
+--- a/src/search.c
++++ b/src/search.c
+@@ -357,7 +357,7 @@ void search_file(const char *file_full_path) {
+ if (opts.search_zip_files) {
+ ag_compression_type zip_type = is_zipped(buf, f_len);
+ if (zip_type != AG_NO_COMPRESSION) {
+-#if HAVE_FOPENCOOKIE
++#ifdef USE_FOPENCOOKIE
+ log_debug("%s is a compressed file. stream searching", file_full_path);
+ fp = decompress_open(fd, "r", zip_type);
+ search_stream(fp, file_full_path);
+diff --git a/src/zfile.c b/src/zfile.c
+index e4b75662..74de37e6 100644
+--- a/src/zfile.c
++++ b/src/zfile.c
+@@ -33,10 +33,10 @@ typedef _off64_t off64_t;
+
+ #if HAVE_FOPENCOOKIE
+
+-#define min(a, b) ({ \
+- __typeof (a) _a = (a); \
+- __typeof (b) _b = (b); \
+- _a < _b ? _a : _b; })
++#define min(a, b) ({ \
++ __typeof (a) _a = (a); \
++ __typeof (b) _b = (b); \
++ _a < _b ? _a : _b; })
+
+ static cookie_read_function_t zfile_read;
+ static cookie_seek_function_t zfile_seek;
+@@ -60,23 +60,217 @@ struct zfile {
+ ag_compression_type ctype;
+
+ union {
++#ifdef HAVE_ZLIB_H
+ z_stream gz;
++#endif
++#ifdef HAVE_LZMA_H
+ lzma_stream lzma;
++#endif
+ } stream;
+
+ uint8_t inbuf[32 * KB];
+ uint8_t outbuf[256 * KB];
+ bool eof;
++ bool eof_next;
+ };
+
+-#define CAVAIL_IN(c) ((c)->ctype == AG_GZIP ? (c)->stream.gz.avail_in : (c)->stream.lzma.avail_in)
+-#define CNEXT_OUT(c) ((c)->ctype == AG_GZIP ? (c)->stream.gz.next_out : (c)->stream.lzma.next_out)
++#ifdef HAVE_ZLIB_H
++/***************** zlib functions ********************************/
++static int zfile_zlib_cookie_init(struct zfile *cookie) {
++ int rc;
++
++ memset(&cookie->stream.gz, 0, sizeof(cookie->stream.gz));
++ rc = inflateInit2(&cookie->stream.gz, 32 + 15);
++ if (rc != Z_OK) {
++ log_err("Unable to initialize zlib: %s", zError(rc));
++ return EIO;
++ }
++ cookie->stream.gz.next_in = NULL;
++ cookie->stream.gz.avail_in = 0;
++ cookie->stream.gz.next_out = cookie->outbuf;
++ cookie->stream.gz.avail_out = sizeof cookie->outbuf;
++ return 0;
++}
++
++static inline size_t zfile_zlib_cavail_in(struct zfile *cookie) {
++ return (size_t)cookie->stream.gz.avail_in;
++}
++
++static inline uint8_t *zfile_zlib_cnext_out(struct zfile *cookie) {
++ return (uint8_t *)cookie->stream.gz.next_out;
++}
++
++static inline int zfile_zlib_is_stream_end(int ret) {
++ return ret == Z_STREAM_END;
++}
++
++static inline void zfile_zlib_set_next_in(struct zfile *cookie, size_t nb) {
++ cookie->stream.gz.avail_in = nb;
++ cookie->stream.gz.next_in = cookie->inbuf;
++}
++
++static inline void zfile_zlib_set_next_out(struct zfile *cookie) {
++ cookie->stream.gz.next_out = cookie->outbuf;
++ cookie->stream.gz.avail_out = sizeof(cookie->outbuf);
++}
++
++static inline int zfile_zlib_inflate(struct zfile *cookie) {
++ int ret = inflate(&cookie->stream.gz, Z_NO_FLUSH);
++ if (ret == Z_STREAM_END) {
++ cookie->eof_next = true;
++ return 0;
++ }
++ return ret == Z_OK ? 0 : -1;
++}
++
++#else
++/***************** zlib stubs ********************************/
++#define zfile_zlib_cookie_init(c) EINVAL
++#define zfile_zlib_cavail_in(c) 0
++#define zfile_zlib_cnext_out(c) 0
++#define zfile_zlib_is_stream_end(r) 1
++#define zfile_zlib_set_next_in(c, n) (void)0
++#define zfile_zlib_set_next_out(c) (void)0
++#define zfile_zlib_inflate(c) -1
++#endif
+
+-static int
+-zfile_cookie_init(struct zfile *cookie) {
+ #ifdef HAVE_LZMA_H
++/***************** lzma functions ********************************/
++static int zfile_lzma_cookie_init(struct zfile *cookie) {
+ lzma_ret lzrc;
++ cookie->stream.lzma = (lzma_stream)LZMA_STREAM_INIT;
++ lzrc = lzma_auto_decoder(&cookie->stream.lzma, -1, 0);
++ if (lzrc != LZMA_OK) {
++ log_err("Unable to initialize lzma_auto_decoder: %d", lzrc);
++ return EIO;
++ }
++ cookie->stream.lzma.next_in = NULL;
++ cookie->stream.lzma.avail_in = 0;
++ cookie->stream.lzma.next_out = cookie->outbuf;
++ cookie->stream.lzma.avail_out = sizeof(cookie->outbuf);
++ return 0;
++}
++
++static inline size_t zfile_lzma_cavail_in(struct zfile *cookie) {
++ return cookie->stream.lzma.avail_in;
++}
++
++static inline uint8_t *zfile_lzma_cnext_out(struct zfile *cookie) {
++ return cookie->stream.lzma.next_out;
++}
++
++static inline int zfile_lzma_is_stream_end(int ret) {
++ return (lzma_ret)ret == LZMA_STREAM_END;
++}
++
++static inline void zfile_lzma_set_next_in(struct zfile *cookie, size_t nb) {
++ cookie->stream.lzma.avail_in = nb;
++ cookie->stream.lzma.next_in = cookie->inbuf;
++}
++
++static inline void zfile_lzma_set_next_out(struct zfile *cookie) {
++ cookie->stream.lzma.next_out = cookie->outbuf;
++ cookie->stream.lzma.avail_out = sizeof(cookie->outbuf);
++}
++
++static inline int zfile_lzma_inflate(struct zfile *cookie) {
++ lzma_ret ret = lzma_code(&cookie->stream.lzma, LZMA_RUN);
++ if (ret == LZMA_STREAM_END) {
++ cookie->eof_next = true;
++ return 0;
++ }
++ return ret == LZMA_OK ? 0 : -1;
++}
++
++#else
++/***************** lzma stubs ********************************/
++#define zfile_lzma_cookie_init(c) EINVAL
++#define zfile_lzma_cavail_in(c) 0
++#define zfile_lzma_cnext_out(c) 0
++#define zfile_lzma_is_stream_end(r) 1
++#define zfile_lzma_set_next_in(c, n) (void)0
++#define zfile_lzma_set_next_out(c) (void)0
++#define zfile_lzma_inflate(c) -1
+ #endif
++
++static inline size_t zfile_cavail_in(struct zfile *cookie) {
++ switch (cookie->ctype) {
++ case AG_GZIP:
++ return zfile_zlib_cavail_in(cookie);
++ break;
++ case AG_XZ:
++ return zfile_lzma_cavail_in(cookie);
++ break;
++ default:
++ return 0;
++ }
++}
++
++static inline uint8_t *zfile_cnext_out(struct zfile *cookie) {
++ switch (cookie->ctype) {
++ case AG_GZIP:
++ return zfile_zlib_cnext_out(cookie);
++ break;
++ case AG_XZ:
++ return zfile_lzma_cnext_out(cookie);
++ break;
++ default:
++ return NULL;
++ }
++}
++
++static inline int zfile_is_stream_end(struct zfile *cookie, int ret) {
++ switch (cookie->ctype) {
++ case AG_GZIP:
++ return zfile_zlib_is_stream_end(ret);
++ case AG_XZ:
++ return zfile_lzma_is_stream_end(ret);
++ default:
++ return 1;
++ }
++}
++
++static inline void zfile_set_next_in(struct zfile *cookie, size_t nb) {
++ switch (cookie->ctype) {
++ case AG_GZIP:
++ zfile_zlib_set_next_in(cookie, nb);
++ break;
++ case AG_XZ:
++ zfile_lzma_set_next_in(cookie, nb);
++ break;
++ default:
++ break;
++ }
++}
++
++static inline void zfile_set_next_out(struct zfile *cookie) {
++ switch (cookie->ctype) {
++ case AG_GZIP:
++ zfile_zlib_set_next_out(cookie);
++ break;
++ case AG_XZ:
++ zfile_lzma_set_next_out(cookie);
++ break;
++ default:
++ break;
++ }
++}
++
++static inline int zfile_inflate(struct zfile *cookie) {
++ switch (cookie->ctype) {
++ case AG_GZIP:
++ return zfile_zlib_inflate(cookie);
++ break;
++ case AG_XZ:
++ return zfile_lzma_inflate(cookie);
++ break;
++ default:
++ return -1;
++ }
++}
++
++static int
++zfile_cookie_init(struct zfile *cookie) {
+ int rc;
+
+ assert(cookie->logic_offset == 0);
+@@ -85,39 +279,18 @@ zfile_cookie_init(struct zfile *cookie) {
+ cookie->actual_len = 0;
+
+ switch (cookie->ctype) {
+-#ifdef HAVE_ZLIB_H
+ case AG_GZIP:
+- memset(&cookie->stream.gz, 0, sizeof cookie->stream.gz);
+- rc = inflateInit2(&cookie->stream.gz, 32 + 15);
+- if (rc != Z_OK) {
+- log_err("Unable to initialize zlib: %s", zError(rc));
+- return EIO;
+- }
+- cookie->stream.gz.next_in = NULL;
+- cookie->stream.gz.avail_in = 0;
+- cookie->stream.gz.next_out = cookie->outbuf;
+- cookie->stream.gz.avail_out = sizeof cookie->outbuf;
++ rc = zfile_zlib_cookie_init(cookie);
+ break;
+-#endif
+-#ifdef HAVE_LZMA_H
+ case AG_XZ:
+- cookie->stream.lzma = (lzma_stream)LZMA_STREAM_INIT;
+- lzrc = lzma_auto_decoder(&cookie->stream.lzma, -1, 0);
+- if (lzrc != LZMA_OK) {
+- log_err("Unable to initialize lzma_auto_decoder: %d", lzrc);
+- return EIO;
+- }
+- cookie->stream.lzma.next_in = NULL;
+- cookie->stream.lzma.avail_in = 0;
+- cookie->stream.lzma.next_out = cookie->outbuf;
+- cookie->stream.lzma.avail_out = sizeof cookie->outbuf;
++ rc = zfile_lzma_cookie_init(cookie);
+ break;
+-#endif
+ default:
+ log_err("Unsupported compression type: %d", cookie->ctype);
+ return EINVAL;
+ }
+-
++ if (rc)
++ return rc;
+
+ cookie->outbuf_start = 0;
+ cookie->eof = false;
+@@ -165,10 +338,10 @@ decompress_open(int fd, const char *mode, ag_compression_type ctype) {
+ goto out;
+
+ /*
+- * No validation of compression type is done -- file is assumed to
+- * match input. In Ag, the compression type is already detected, so
+- * that's ok.
+- */
++ * No validation of compression type is done -- file is assumed to
++ * match input. In Ag, the compression type is already detected, so
++ * that's ok.
++ */
+ cookie = malloc(sizeof *cookie);
+ if (cookie == NULL) {
+ errno = ENOMEM;
+@@ -207,8 +380,6 @@ zfile_read(void *cookie_, char *buf, size_t size) {
+ struct zfile *cookie = cookie_;
+ size_t nb, ignorebytes;
+ ssize_t total = 0;
+- lzma_ret lzret;
+- int ret;
+
+ assert(size <= SSIZE_MAX);
+
+@@ -218,9 +389,6 @@ zfile_read(void *cookie_, char *buf, size_t size) {
+ if (cookie->eof)
+ return 0;
+
+- ret = Z_OK;
+- lzret = LZMA_OK;
+-
+ ignorebytes = cookie->logic_offset - cookie->decode_offset;
+ assert(ignorebytes == 0);
+
+@@ -228,9 +396,9 @@ zfile_read(void *cookie_, char *buf, size_t size) {
+ size_t inflated;
+
+ /* Drain output buffer first */
+- while (CNEXT_OUT(cookie) >
++ while (zfile_cnext_out(cookie) >
+ &cookie->outbuf[cookie->outbuf_start]) {
+- size_t left = CNEXT_OUT(cookie) -
++ size_t left = zfile_cnext_out(cookie) -
+ &cookie->outbuf[cookie->outbuf_start];
+ size_t ignoreskip = min(ignorebytes, left);
+ size_t toread;
+@@ -265,21 +433,13 @@ zfile_read(void *cookie_, char *buf, size_t size) {
+ if (size == 0)
+ break;
+
+- /*
+- * If we have not satisfied read, the output buffer must be
+- * empty.
+- */
+- assert(cookie->stream.gz.next_out ==
+- &cookie->outbuf[cookie->outbuf_start]);
+-
+- if ((cookie->ctype == AG_XZ && lzret == LZMA_STREAM_END) ||
+- (cookie->ctype == AG_GZIP && ret == Z_STREAM_END)) {
++ if (cookie->eof_next) {
+ cookie->eof = true;
+ break;
+ }
+
+ /* Read more input if empty */
+- if (CAVAIL_IN(cookie) == 0) {
++ if (zfile_cavail_in(cookie) == 0) {
+ nb = fread(cookie->inbuf, 1, sizeof cookie->inbuf,
+ cookie->in);
+ if (ferror(cookie->in)) {
+@@ -290,39 +450,18 @@ zfile_read(void *cookie_, char *buf, size_t size) {
+ warn("truncated file");
+ exit(1);
+ }
+- if (cookie->ctype == AG_XZ) {
+- cookie->stream.lzma.avail_in = nb;
+- cookie->stream.lzma.next_in = cookie->inbuf;
+- } else {
+- cookie->stream.gz.avail_in = nb;
+- cookie->stream.gz.next_in = cookie->inbuf;
+- }
++ zfile_set_next_in(cookie, nb);
+ }
+
+ /* Reset stream state to beginning of output buffer */
+- if (cookie->ctype == AG_XZ) {
+- cookie->stream.lzma.next_out = cookie->outbuf;
+- cookie->stream.lzma.avail_out = sizeof cookie->outbuf;
+- } else {
+- cookie->stream.gz.next_out = cookie->outbuf;
+- cookie->stream.gz.avail_out = sizeof cookie->outbuf;
+- }
++ zfile_set_next_out(cookie);
+ cookie->outbuf_start = 0;
+
+- if (cookie->ctype == AG_GZIP) {
+- ret = inflate(&cookie->stream.gz, Z_NO_FLUSH);
+- if (ret != Z_OK && ret != Z_STREAM_END) {
+- log_err("Found mem/data error while decompressing zlib stream: %s", zError(ret));
+- return -1;
+- }
+- } else {
+- lzret = lzma_code(&cookie->stream.lzma, LZMA_RUN);
+- if (lzret != LZMA_OK && lzret != LZMA_STREAM_END) {
+- log_err("Found mem/data error while decompressing xz/lzma stream: %d", lzret);
+- return -1;
+- }
++ if (zfile_inflate(cookie)) {
++ log_err("Found mem/data error while decompressing stream");
++ return -1;
+ }
+- inflated = CNEXT_OUT(cookie) - &cookie->outbuf[0];
++ inflated = zfile_cnext_out(cookie) - &cookie->outbuf[0];
+ cookie->actual_len += inflated;
+ } while (!ferror(cookie->in) && size > 0);
+
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-2.1.0.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-2.1.0.ebuild
index 3f4a2aae03c..454efcca106 100644
--- a/sys-apps/the_silver_searcher/the_silver_searcher-2.1.0.ebuild
+++ b/sys-apps/the_silver_searcher/the_silver_searcher-2.1.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -22,6 +22,8 @@ DEPEND="${RDEPEND}
DOCS="README.md"
+PATCHES=( "${FILESDIR}"/${PN}-2.1.0-lzma.patch )
+
src_prepare() {
sed '/^dist_bashcomp/d' -i Makefile.am || die
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/the_silver_searcher/, sys-apps/the_silver_searcher/files/
@ 2020-07-12 10:24 Sam Jorna
0 siblings, 0 replies; 6+ messages in thread
From: Sam Jorna @ 2020-07-12 10:24 UTC (permalink / raw
To: gentoo-commits
commit: 4174b1f2bba16be562beadb8926b26fce40a41d1
Author: Sam Jorna <wraeth <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 12 10:19:27 2020 +0000
Commit: Sam Jorna <wraeth <AT> gentoo <DOT> org>
CommitDate: Sun Jul 12 10:23:55 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4174b1f2
sys-apps/the_silver_searcher: fix fno-common
Closes: https://bugs.gentoo.org/708532
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Sam Jorna <wraeth <AT> gentoo.org>
.../files/the_silver_searcher-fno-common.patch | 164 +++++++++++++++++++++
.../the_silver_searcher-2.0.0.ebuild | 4 +-
.../the_silver_searcher-2.1.0.ebuild | 7 +-
.../the_silver_searcher-2.2.0.ebuild | 7 +-
4 files changed, 177 insertions(+), 5 deletions(-)
diff --git a/sys-apps/the_silver_searcher/files/the_silver_searcher-fno-common.patch b/sys-apps/the_silver_searcher/files/the_silver_searcher-fno-common.patch
new file mode 100644
index 00000000000..49861018e3a
--- /dev/null
+++ b/sys-apps/the_silver_searcher/files/the_silver_searcher-fno-common.patch
@@ -0,0 +1,164 @@
+--- a/src/search.h
++++ b/src/search.h
+@@ -31,9 +31,9 @@
+ #include "uthash.h"
+ #include "util.h"
+
+-size_t alpha_skip_lookup[256];
+-size_t *find_skip_lookup;
+-uint8_t h_table[H_SIZE] __attribute__((aligned(64)));
++extern size_t alpha_skip_lookup[256];
++extern size_t *find_skip_lookup;
++extern uint8_t h_table[H_SIZE] __attribute__((aligned(64)));
+
+ struct work_queue_t {
+ char *path;
+@@ -41,12 +41,12 @@
+ };
+ typedef struct work_queue_t work_queue_t;
+
+-work_queue_t *work_queue;
+-work_queue_t *work_queue_tail;
+-int done_adding_files;
+-pthread_cond_t files_ready;
+-pthread_mutex_t stats_mtx;
+-pthread_mutex_t work_queue_mtx;
++extern work_queue_t *work_queue;
++extern work_queue_t *work_queue_tail;
++extern int done_adding_files;
++extern pthread_cond_t files_ready;
++extern pthread_mutex_t stats_mtx;
++extern pthread_mutex_t work_queue_mtx;
+
+
+ /* For symlink loop detection */
+@@ -64,7 +64,7 @@
+ UT_hash_handle hh;
+ } symdir_t;
+
+-symdir_t *symhash;
++extern symdir_t *symhash;
+
+ void search_buf(const char *buf, const size_t buf_len,
+ const char *dir_full_path);
+--- a/src/search.c
++++ b/src/search.c
+@@ -2,6 +2,19 @@
+ #include "print.h"
+ #include "scandir.h"
+
++ size_t alpha_skip_lookup[256];
++ size_t *find_skip_lookup;
++ uint8_t h_table[H_SIZE] __attribute__((aligned(64)));
++
++ work_queue_t *work_queue;
++ work_queue_t *work_queue_tail;
++ int done_adding_files;
++ pthread_cond_t files_ready;
++ pthread_mutex_t stats_mtx;
++ pthread_mutex_t work_queue_mtx;
++
++ symdir_t *symhash;
++
+ void search_buf(const char *buf, const size_t buf_len,
+ const char *dir_full_path) {
+ int binary = -1; /* 1 = yes, 0 = no, -1 = don't know */
+--- a/src/log.c
++++ b/src/log.c
+@@ -4,6 +4,8 @@
+ #include "log.h"
+ #include "util.h"
+
++pthread_mutex_t print_mtx;
++
+ static enum log_level log_threshold = LOG_LEVEL_ERR;
+
+ void set_log_level(enum log_level threshold) {
+--- a/src/log.h
++++ b/src/log.h
+@@ -9,7 +9,7 @@
+ #include <pthread.h>
+ #endif
+
+-pthread_mutex_t print_mtx;
++extern pthread_mutex_t print_mtx;
+
+ enum log_level {
+ LOG_LEVEL_DEBUG = 10,
+--- a/src/options.h
++++ b/src/options.h
+@@ -91,7 +91,7 @@
+ } cli_options;
+
+ /* global options. parse_options gives it sane values, everything else reads from it */
+-cli_options opts;
++extern cli_options opts;
+
+ typedef struct option option_t;
+
+--- a/src/options.c
++++ b/src/options.c
+@@ -16,6 +16,8 @@
+ #include "print.h"
+ #include "util.h"
+
++cli_options opts;
++
+ const char *color_line_number = "\033[1;33m"; /* bold yellow */
+ const char *color_match = "\033[30;43m"; /* black with yellow background */
+ const char *color_path = "\033[1;32m"; /* bold green */
+--- a/src/util.h
++++ b/src/util.h
+@@ -12,7 +12,7 @@
+ #include "log.h"
+ #include "options.h"
+
+-FILE *out_fd;
++extern FILE *out_fd;
+
+ #ifndef TRUE
+ #define TRUE 1
+@@ -51,7 +51,7 @@
+ } ag_stats;
+
+
+-ag_stats stats;
++extern ag_stats stats;
+
+ /* Union to translate between chars and words without violating strict aliasing */
+ typedef union {
+--- a/src/util.c
++++ b/src/util.c
+@@ -15,6 +15,10 @@
+ #define getc_unlocked(x) getc(x)
+ #endif
+
++FILE *out_fd;
++
++ag_stats stats;
++
+ #define CHECK_AND_RETURN(ptr) \
+ if (ptr == NULL) { \
+ die("Memory allocation failed."); \
+--- a/src/ignore.c
++++ b/src/ignore.c
+@@ -22,6 +22,8 @@
+
+ /* TODO: build a huge-ass list of files we want to ignore by default (build cache stuff, pyc files, etc) */
+
++ignores *root_ignores;
++
+ const char *evil_hardcoded_ignore_files[] = {
+ ".",
+ "..",
+--- a/src/ignore.h
++++ b/src/ignore.h
+@@ -29,7 +29,7 @@
+ };
+ typedef struct ignores ignores;
+
+-ignores *root_ignores;
++extern ignores *root_ignores;
+
+ extern const char *evil_hardcoded_ignore_files[];
+ extern const char *ignore_pattern_files[];
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-2.0.0.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-2.0.0.ebuild
index d993a7bb70b..6e62890da07 100644
--- a/sys-apps/the_silver_searcher/the_silver_searcher-2.0.0.ebuild
+++ b/sys-apps/the_silver_searcher/the_silver_searcher-2.0.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -26,6 +26,8 @@ DEPEND="${RDEPEND}
DOCS="README.md"
+PATCHES=( "${FILESDIR}"/${PN}-fno-common.patch )
+
src_prepare() {
sed '/^dist_bashcomp/d' -i Makefile.am || die
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-2.1.0.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-2.1.0.ebuild
index f6cfa25db0a..9643faccd4a 100644
--- a/sys-apps/the_silver_searcher/the_silver_searcher-2.1.0.ebuild
+++ b/sys-apps/the_silver_searcher/the_silver_searcher-2.1.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -26,7 +26,10 @@ DEPEND="${RDEPEND}
DOCS="README.md"
-PATCHES=( "${FILESDIR}"/${PN}-2.1.0-lzma.patch )
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.1.0-lzma.patch
+ "${FILESDIR}"/${PN}-fno-common.patch
+)
src_prepare() {
sed '/^dist_bashcomp/d' -i Makefile.am || die
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0.ebuild
index f6cfa25db0a..9643faccd4a 100644
--- a/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0.ebuild
+++ b/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -26,7 +26,10 @@ DEPEND="${RDEPEND}
DOCS="README.md"
-PATCHES=( "${FILESDIR}"/${PN}-2.1.0-lzma.patch )
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.1.0-lzma.patch
+ "${FILESDIR}"/${PN}-fno-common.patch
+)
src_prepare() {
sed '/^dist_bashcomp/d' -i Makefile.am || die
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/the_silver_searcher/, sys-apps/the_silver_searcher/files/
@ 2024-04-05 22:31 Marek Szuba
0 siblings, 0 replies; 6+ messages in thread
From: Marek Szuba @ 2024-04-05 22:31 UTC (permalink / raw
To: gentoo-commits
commit: b448e9d8d8a7fa8333d04f16429862b99f61e912
Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 5 22:26:19 2024 +0000
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Fri Apr 5 22:26:19 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b448e9d8
sys-apps/the_silver_searcher: fix the no-LFS64 patch
According to the documentation glibc still defaults to 32-bit file
offsets on 32-bit arches, therefore tell autoconf to check if it needs
to explicitly set this to 64.
Straight-to-stable revbump on the off chance someone has emerged the
ebuild using the previous version of the patch on a 32-bit system. And
that's enough of messing with this without the usual ~arch revisions.
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
.../files/the_silver_searcher-2.2.0-no_lfs64.patch | 11 +++++++++++
...1.ebuild => the_silver_searcher-2.2.0_p20201217-r2.ebuild} | 0
2 files changed, 11 insertions(+)
diff --git a/sys-apps/the_silver_searcher/files/the_silver_searcher-2.2.0-no_lfs64.patch b/sys-apps/the_silver_searcher/files/the_silver_searcher-2.2.0-no_lfs64.patch
index 62925a7fb1f0..7468a47a0568 100644
--- a/sys-apps/the_silver_searcher/files/the_silver_searcher-2.2.0-no_lfs64.patch
+++ b/sys-apps/the_silver_searcher/files/the_silver_searcher-2.2.0-no_lfs64.patch
@@ -1,6 +1,17 @@
LFS64 interfaces are now generally considered deprecated, and are no longer
available in MUSL since version 1.2.4.
+--- a/configure.ac
++++ b/configure.ac
+@@ -12,6 +12,8 @@
+ AC_PREREQ([2.59])
+ AC_PROG_GREP
+
++AC_SYS_LARGEFILE
++
+ m4_ifdef(
+ [AM_SILENT_RULES],
+ [AM_SILENT_RULES([yes])])
--- a/src/zfile.c
+++ b/src/zfile.c
@@ -4,7 +4,7 @@
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r1.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r2.ebuild
similarity index 100%
rename from sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r1.ebuild
rename to sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r2.ebuild
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/the_silver_searcher/, sys-apps/the_silver_searcher/files/
@ 2024-06-17 1:47 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2024-06-17 1:47 UTC (permalink / raw
To: gentoo-commits
commit: 4aaecc02ba23581ee2fdb50d3f8b9d2480da5f6e
Author: Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Sun Jun 16 19:41:07 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 17 01:46:48 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4aaecc02
sys-apps/the_silver_searcher: fix compatibility with bash-completion 2.12
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../0001-bash-completion-port-to-v2-API.patch | 58 ++++++++++++++++++++
.../the_silver_searcher-2.2.0_p20201217-r3.ebuild | 63 ++++++++++++++++++++++
2 files changed, 121 insertions(+)
diff --git a/sys-apps/the_silver_searcher/files/0001-bash-completion-port-to-v2-API.patch b/sys-apps/the_silver_searcher/files/0001-bash-completion-port-to-v2-API.patch
new file mode 100644
index 000000000000..151e8a1274b4
--- /dev/null
+++ b/sys-apps/the_silver_searcher/files/0001-bash-completion-port-to-v2-API.patch
@@ -0,0 +1,58 @@
+From eca81ee573f30f8eb790d33db1c86d2970f7fc4a Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Sun, 16 Jun 2024 15:35:30 -0400
+Subject: [PATCH] bash-completion: port to v2 API
+
+Fixes: #1537
+Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
+---
+ ag.bashcomp.sh | 16 +++++++---------
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/ag.bashcomp.sh b/ag.bashcomp.sh
+index 5637ce4..e03f580 100644
+--- a/ag.bashcomp.sh
++++ b/ag.bashcomp.sh
+@@ -1,11 +1,9 @@
+ _ag() {
+- local lngopt shtopt split=false
+- local cur prev
++ local cur prev words cword split
++ local lngopt shtopt
+
+ COMPREPLY=()
+- cur=$(_get_cword "=")
+- prev="${COMP_WORDS[COMP_CWORD-1]}"
+-
++ _init_completion -s || return 0
+ _expand || return 0
+
+ lngopt='
+@@ -96,12 +94,10 @@ _ag() {
+ types=$(ag --list-file-types |grep -- '--')
+
+ # these options require an argument
+- if [[ "${prev}" == -[ABCGgm] ]] ; then
++ if [[ "${prev}" = -[ABCGgm] ]] ; then
+ return 0
+ fi
+
+- _split_longopt && split=true
+-
+ case "${prev}" in
+ --ignore-dir) # directory completion
+ _filedir -d
+@@ -117,7 +113,9 @@ _ag() {
+ return 0;;
+ esac
+
+- $split && return 0
++ if [[ ${split} = true ]]; then
++ return 0
++ fi
+
+ case "${cur}" in
+ -*)
+--
+2.44.2
+
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r3.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r3.ebuild
new file mode 100644
index 000000000000..93ac9f8cc8f8
--- /dev/null
+++ b/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r3.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools bash-completion-r1 flag-o-matic vcs-snapshot
+
+COMMIT="a61f1780b64266587e7bc30f0f5f71c6cca97c0f"
+
+DESCRIPTION="A code-searching tool similar to ack, but faster"
+HOMEPAGE="https://github.com/ggreer/the_silver_searcher"
+SRC_URI="https://github.com/ggreer/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos"
+IUSE="lzma test zlib"
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-libs/libpcre
+ lzma? ( app-arch/xz-utils )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? (
+ dev-util/cram
+ dev-vcs/git
+ )"
+
+DOCS="README.md"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.1.0-lzma.patch
+ "${FILESDIR}"/${PN}-2.2.0-no_lfs64.patch
+ # https://github.com/ggreer/the_silver_searcher/issues/1537
+ # broken with >=app-shells/bash-completion-2.12
+ "${FILESDIR}"/0001-bash-completion-port-to-v2-API.patch
+)
+
+src_prepare() {
+ sed '/^dist_bashcomp/d' -i Makefile.am || die
+
+ default
+ eautoreconf
+}
+
+src_configure() {
+ # false positive TEXTRELs on riscv
+ # https://bugs.gentoo.org/797355
+ append-flags -fPIC
+
+ econf \
+ $(use_enable lzma) \
+ $(use_enable zlib)
+}
+
+src_test() {
+ cram -v tests/*.t || die "tests failed"
+}
+
+src_install() {
+ default
+ newbashcomp ag.bashcomp.sh ag
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-06-17 1:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-13 3:55 [gentoo-commits] repo/gentoo:master commit in: sys-apps/the_silver_searcher/, sys-apps/the_silver_searcher/files/ Benda XU
-- strict thread matches above, loose matches on Subject: below --
2024-06-17 1:47 Sam James
2024-04-05 22:31 Marek Szuba
2020-07-12 10:24 Sam Jorna
2017-08-31 15:39 Tim Harder
2016-12-04 0:32 Tim Harder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox