dev-util/pkgconf: Bump to version 1.7.1
[gentoo.git] / dev-util / pkgconf / pkgconf-1.7.0.ebuild
1 # Copyright 2012-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit multilib-minimal
7
8 if [[ ${PV} == "9999" ]] ; then
9         inherit autotools git-r3
10         EGIT_REPO_URI="https://git.sr.ht/~kaniini/pkgconf"
11 else
12         SRC_URI="http://distfiles.dereferenced.org/${PN}/${P}.tar.xz"
13         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
14 fi
15
16 DESCRIPTION="pkg-config compatible replacement with no dependencies other than ANSI C89"
17 HOMEPAGE="https://git.sr.ht/~kaniini/pkgconf"
18
19 LICENSE="ISC"
20 SLOT="0/3"
21 IUSE="+pkg-config test"
22
23 # tests require 'kyua'
24 RESTRICT="!test? ( test )"
25
26 BDEPEND="
27         test? (
28                 dev-libs/atf
29                 dev-util/kyua
30         )
31 "
32 RDEPEND="
33         pkg-config? (
34                 !dev-util/pkgconfig
35                 !dev-util/pkg-config-lite
36                 !dev-util/pkgconfig-openbsd[pkg-config]
37         )
38 "
39
40 MULTILIB_CHOST_TOOLS=(
41         /usr/bin/pkgconf
42 )
43
44 src_prepare() {
45         default
46
47         [[ ${PV} == "9999" ]] && eautoreconf
48         if use pkg-config; then
49                 MULTILIB_CHOST_TOOLS+=(
50                         /usr/bin/pkg-config
51                 )
52         fi
53 }
54
55 multilib_src_configure() {
56         local ECONF_SOURCE="${S}"
57         econf --disable-static
58 }
59
60 multilib_src_test() {
61         unset PKG_CONFIG_LIBDIR PKG_CONFIG_PATH
62         default
63 }
64
65 multilib_src_install() {
66         default
67
68         if use pkg-config; then
69                 dosym pkgconf /usr/bin/pkg-config
70                 dosym pkgconf.1 /usr/share/man/man1/pkg-config.1
71         else
72                 rm "${ED}"/usr/share/aclocal/pkg.m4 || die
73                 rmdir "${ED}"/usr/share/aclocal || die
74                 rm "${ED}"/usr/share/man/man7/pkg.m4.7 || die
75                 rmdir "${ED}"/usr/share/man/man7 || die
76         fi
77 }
78
79 multilib_src_install_all() {
80         einstalldocs
81         find "${ED}" -type f -name '*.la' -delete || die
82 }