dev-util/ccls: Version bump to 0.20190823.6
[gentoo.git] / dev-util / pkgconfig / pkgconfig-0.29.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 # Do not inherit autotools in non-live ebuild - causes circular dependency, bug #550856
7 inherit eutils flag-o-matic libtool multilib multilib-minimal
8
9 MY_P=pkg-config-${PV}
10
11 if [[ ${PV} == *9999* ]]; then
12         # 1.12 is only needed for tests due to some am__check_pre / LOG_DRIVER
13         # weirdness with "/bin/bash /bin/sh" in arguments chain with >=1.13
14         WANT_AUTOMAKE=1.12
15         EGIT_REPO_URI="https://anongit.freedesktop.org/git/pkg-config.git"
16         EGIT_CHECKOUT_DIR=${WORKDIR}/${MY_P}
17         inherit autotools git-r3
18 else
19         KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
20         SRC_URI="https://pkgconfig.freedesktop.org/releases/${MY_P}.tar.gz"
21 fi
22
23 DESCRIPTION="Package config system that manages compile/link flags"
24 HOMEPAGE="https://pkgconfig.freedesktop.org/wiki/"
25
26 LICENSE="GPL-2"
27 SLOT="0"
28 IUSE="elibc_FreeBSD elibc_glibc hardened internal-glib"
29
30 RDEPEND="!internal-glib? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] )
31         !dev-util/pkgconf[pkg-config]
32         !dev-util/pkg-config-lite
33         !dev-util/pkgconfig-openbsd[pkg-config]
34         virtual/libintl"
35 DEPEND="${RDEPEND}"
36
37 S=${WORKDIR}/${MY_P}
38
39 DOCS=( AUTHORS NEWS README )
40
41 src_prepare() {
42         sed -i -e "s|^prefix=/usr\$|prefix=${EPREFIX}/usr|" check/simple.pc || die #434320
43
44         eapply_user
45
46         if [[ ${PV} == *9999* ]]; then
47                 eautoreconf
48         else
49                 elibtoolize # Required for FreeMiNT wrt #333429
50         fi
51
52         if [[ ${CHOST} == *-solaris* ]] ; then
53                 # fix standards conflicts
54                 sed -i -e 's/\(_XOPEN_SOURCE\(_EXTENDED\)\?\|__EXTENSIONS__\)/  \1_DISABLED/' \
55                         glib/configure || die
56                 sed -i -e '/#define\s\+_POSIX_SOURCE/d' \
57                         glib/glib/giounix.c || die
58         fi
59 }
60
61 multilib_src_configure() {
62         local myconf
63
64         if use internal-glib; then
65                 myconf+=' --with-internal-glib'
66                 # non-glibc platforms use GNU libiconv, but configure needs to
67                 # know about that not to get confused when it finds something
68                 # outside the prefix too
69                 if use prefix && use !elibc_glibc ; then
70                         myconf+=" --with-libiconv=gnu"
71                         # add the libdir for libtool, otherwise it'll make love with system
72                         # installed libiconv
73                         append-ldflags "-L${EPREFIX}/usr/$(get_libdir)"
74                         # the glib objects reference symbols from these frameworks,
75                         # not good, esp. since Carbon should be deprecated
76                         [[ ${CHOST} == *-darwin* ]] && \
77                                 append-ldflags -framework CoreFoundation -framework Carbon
78                         if [[ ${CHOST} == *-solaris* ]] ; then
79                                 # required due to __EXTENSIONS__
80                                 append-cppflags -DENABLE_NLS
81                                 # similar to Darwin
82                                 append-ldflags -lintl
83                         fi
84                 fi
85         else
86                 if ! has_version --host-root dev-util/pkgconfig; then
87                         export GLIB_CFLAGS="-I${EPREFIX}/usr/include/glib-2.0 -I${EPREFIX}/usr/$(get_libdir)/glib-2.0/include"
88                         export GLIB_LIBS="-lglib-2.0"
89                 fi
90         fi
91
92         use ppc64 && use hardened && replace-flags -O[2-3] -O1
93
94         # Force using all the requirements when linking, so that needed -pthread
95         # lines are inherited between libraries
96         use elibc_FreeBSD && myconf+=' --enable-indirect-deps'
97
98         [[ ${PV} == *9999* ]] && myconf+=' --enable-maintainer-mode'
99
100         ECONF_SOURCE=${S} \
101         econf \
102                 --docdir="${EPREFIX}"/usr/share/doc/${PF}/html \
103                 --with-system-include-path="${EPREFIX}"/usr/include \
104                 --with-system-library-path="${EPREFIX}"/usr/$(get_libdir) \
105                 ${myconf}
106 }
107
108 multilib_src_install() {
109         emake DESTDIR="${D}" install
110
111         if use prefix; then
112                 # Add an explicit reference to $EPREFIX to PKG_CONFIG_PATH to
113                 # simplify cross-prefix builds
114                 echo "PKG_CONFIG_PATH=${EPREFIX}/usr/$(get_libdir)/pkgconfig:${EPREFIX}/usr/share/pkgconfig" >> "${T}"/99${PN}
115                 doenvd "${T}"/99${PN}
116         fi
117 }