1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 # Do not inherit autotools in non-live ebuild - causes circular dependency, bug #550856
7 inherit eutils flag-o-matic libtool multilib multilib-minimal
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
15 EGIT_REPO_URI="https://anongit.freedesktop.org/git/pkg-config.git"
16 EGIT_CHECKOUT_DIR=${WORKDIR}/${MY_P}
17 inherit autotools git-r3
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"
23 DESCRIPTION="Package config system that manages compile/link flags"
24 HOMEPAGE="https://pkgconfig.freedesktop.org/wiki/"
28 IUSE="elibc_FreeBSD elibc_glibc hardened internal-glib"
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]
39 DOCS=( AUTHORS NEWS README )
42 sed -i -e "s|^prefix=/usr\$|prefix=${EPREFIX}/usr|" check/simple.pc || die #434320
46 if [[ ${PV} == *9999* ]]; then
49 elibtoolize # Required for FreeMiNT wrt #333429
52 if [[ ${CHOST} == *-solaris* ]] ; then
53 # fix standards conflicts
54 sed -i -e 's/\(_XOPEN_SOURCE\(_EXTENDED\)\?\|__EXTENSIONS__\)/ \1_DISABLED/' \
56 sed -i -e '/#define\s\+_POSIX_SOURCE/d' \
57 glib/glib/giounix.c || die
61 multilib_src_configure() {
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
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
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"
92 use ppc64 && use hardened && replace-flags -O[2-3] -O1
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'
98 [[ ${PV} == *9999* ]] && myconf+=' --enable-maintainer-mode'
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) \
108 multilib_src_install() {
109 emake DESTDIR="${D}" install
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}