79fbd64961f9971383da72a444e9f4d2bd202b7f
[gentoo.git] / sys-apps / findutils / findutils-4.6.0-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 PYTHON_COMPAT=( python{3_6,3_7} )
7
8 inherit eutils flag-o-matic toolchain-funcs python-any-r1
9
10 DESCRIPTION="GNU utilities for finding files"
11 HOMEPAGE="https://www.gnu.org/software/findutils/"
12 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
13
14 LICENSE="GPL-3+"
15 SLOT="0"
16 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="nls selinux static test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="selinux? ( sys-libs/libselinux )
21         nls? ( virtual/libintl )"
22 DEPEND="${RDEPEND}
23         test? ( ${PYTHON_DEPS} )
24         nls? ( sys-devel/gettext )"
25
26 pkg_setup() {
27         use test && python-any-r1_pkg_setup
28 }
29
30 src_prepare() {
31         # Don't build or install locate because it conflicts with slocate,
32         # which is a secure version of locate.  See bug 18729
33         sed -i '/^SUBDIRS/s/locate//' Makefile.in
34
35         # Newer C libraries omit this include from sys/types.h.
36         # https://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00018.html
37         sed -i \
38                 '/include.*config.h/a#ifdef MAJOR_IN_SYSMACROS\n#include <sys/sysmacros.h>\n#endif\n' \
39                 gl/lib/mountlist.c || die
40
41         epatch "${FILESDIR}"/${P}-gnulib-mb.patch #576818
42         epatch "${FILESDIR}"/${P}-gnulib-S_MAGIC_NFS.patch #580032
43         epatch "${FILESDIR}"/${P}-glibc228.patch #663242
44         epatch_user
45 }
46
47 src_configure() {
48         use static && append-ldflags -static
49
50         program_prefix=$(usex userland_GNU '' g)
51         econf \
52                 --with-packager="Gentoo" \
53                 --with-packager-version="${PVR}" \
54                 --with-packager-bug-reports="https://bugs.gentoo.org/" \
55                 --program-prefix=${program_prefix} \
56                 $(use_enable nls) \
57                 $(use_with selinux) \
58                 --libexecdir='$(libdir)'/find
59 }
60
61 src_compile() {
62         # We don't build locate, but the docs want a file in there.
63         emake -C locate dblocation.texi
64         default
65 }