commit: 3829c87802a63174acd5b7eb6dd27b7dc35784af Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Wed Jan 22 03:54:47 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Jan 22 03:54:47 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3829c878
sys-apps/the_silver_searcher: update EAPI 7 -> 8, fix broken LFS patch Fix broken LFS patch: we need to include config.h consistently and before any standard headers are included for AC_SYS_LARGEFILE to do its magic. Closes: https://bugs.gentoo.org/928924 Signed-off-by: Sam James <sam <AT> gentoo.org> ...he_silver_searcher-2.2.0-lfs-fixup-config.patch | 157 +++++++++++++++++++++ .../files/the_silver_searcher-2.2.0-no_lfs64.patch | 1 + .../the_silver_searcher-2.2.0_p20201217-r4.ebuild | 67 +++++++++ 3 files changed, 225 insertions(+) diff --git a/sys-apps/the_silver_searcher/files/the_silver_searcher-2.2.0-lfs-fixup-config.patch b/sys-apps/the_silver_searcher/files/the_silver_searcher-2.2.0-lfs-fixup-config.patch new file mode 100644 index 000000000000..cdbe82b88802 --- /dev/null +++ b/sys-apps/the_silver_searcher/files/the_silver_searcher-2.2.0-lfs-fixup-config.patch @@ -0,0 +1,157 @@ +https://bugs.gentoo.org/928924 + +Fixup on top of https://github.com/ggreer/the_silver_searcher/pull/1525 +diff --git a/src/decompress.c b/src/decompress.c +index f0bbb33..1680cd5 100644 +--- a/src/decompress.c ++++ b/src/decompress.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include <string.h> + #include <unistd.h> + +diff --git a/src/ignore.c b/src/ignore.c +index 88036ef..02b06f4 100644 +--- a/src/ignore.c ++++ b/src/ignore.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include <ctype.h> + #include <dirent.h> + #include <limits.h> +diff --git a/src/lang.c b/src/lang.c +index 6d62f72..1f2c020 100644 +--- a/src/lang.c ++++ b/src/lang.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include <stdlib.h> + #include <string.h> + +diff --git a/src/log.c b/src/log.c +index f6f4e9a..e6c56ea 100644 +--- a/src/log.c ++++ b/src/log.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include <stdarg.h> + #include <stdio.h> + +diff --git a/src/main.c b/src/main.c +index e116f70..3d3b565 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include <ctype.h> + #include <pcre.h> + #include <stdarg.h> +@@ -9,8 +11,6 @@ + #include <windows.h> + #endif + +-#include "config.h" +- + #ifdef HAVE_SYS_CPUSET_H + #include <sys/cpuset.h> + #endif +diff --git a/src/options.c b/src/options.c +index 2145b33..2bfac85 100644 +--- a/src/options.c ++++ b/src/options.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include <errno.h> + #include <limits.h> + #include <stdarg.h> +@@ -8,7 +10,6 @@ + #include <sys/stat.h> + #include <unistd.h> + +-#include "config.h" + #include "ignore.h" + #include "lang.h" + #include "log.h" +diff --git a/src/print.c b/src/print.c +index 34dbeff..5d825dd 100644 +--- a/src/print.c ++++ b/src/print.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include <limits.h> + #include <stdarg.h> + #include <stdio.h> +diff --git a/src/print_w32.c b/src/print_w32.c +index a1fd387..ca15da4 100644 +--- a/src/print_w32.c ++++ b/src/print_w32.c +@@ -1,5 +1,6 @@ + #ifdef _WIN32 + ++#include "config.h" + #include "print.h" + #include <io.h> + #include <stdarg.h> +diff --git a/src/scandir.c b/src/scandir.c +index 50cb595..425855a 100644 +--- a/src/scandir.c ++++ b/src/scandir.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include <dirent.h> + #include <stdlib.h> + +diff --git a/src/search.c b/src/search.c +index 40b5662..dc81b4c 100644 +--- a/src/search.c ++++ b/src/search.c +@@ -1,3 +1,4 @@ ++#include "config.h" + #include "search.h" + #include "print.h" + #include "scandir.h" +diff --git a/src/util.c b/src/util.c +index 90ffb6f..32e91f2 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include <ctype.h> + #include <stdarg.h> + #include <stdio.h> +@@ -5,7 +7,6 @@ + #include <string.h> + #include <sys/stat.h> + +-#include "config.h" + #include "util.h" + + #ifdef _WIN32 +diff --git a/src/zfile.c b/src/zfile.c +index 299a519..a8c1c73 100644 +--- a/src/zfile.c ++++ b/src/zfile.c +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #ifdef __FreeBSD__ + #include <sys/endian.h> + #endif +@@ -17,8 +19,6 @@ typedef _off64_t off_t; + #include <stdlib.h> + #include <string.h> + +-#include "config.h" +- + #ifdef HAVE_ERR_H + #include <err.h> + #endif 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 7468a47a0568..2bf7174015a0 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,7 @@ LFS64 interfaces are now generally considered deprecated, and are no longer available in MUSL since version 1.2.4. +https://github.com/ggreer/the_silver_searcher/pull/1525 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,8 @@ diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r4.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r4.ebuild new file mode 100644 index 000000000000..8a13a97175ba --- /dev/null +++ b/sys-apps/the_silver_searcher/the_silver_searcher-2.2.0_p20201217-r4.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +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}" +BDEPEND=" + virtual/pkgconfig + test? ( + dev-util/cram + dev-vcs/git + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.1.0-lzma.patch + "${FILESDIR}"/${PN}-2.2.0-no_lfs64.patch + "${FILESDIR}"/${PN}-2.2.0-lfs-fixup-config.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() { + default + + sed '/^dist_bashcomp/d' -i Makefile.am || die + + 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 +}
