Merge pull request #754 from marineam/dev

crossdev: fix sysroot handling in pkg-config wrapper
This commit is contained in:
Michael Marineau 2014-07-19 13:57:59 -07:00
commit 6202ce1152
3 changed files with 98 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST crossdev-20140118.tar.xz 21384 SHA256 8ba9ddb74022d6e3d481db5b02db21ea545d046e33a47b44e92ae369b4c218ee SHA512 ee27fc55bd8892fa454f6482d1276e0c6520f7987629b92cc7b96572eca51bb752c119f4f818783a579706afe7c9eabdfb8f0536e87cd888f0f76510ae51939d WHIRLPOOL c2018dfb4ab21d4eadbc9f6e4dd0fb532a8b4ac4530821262f28b8b969e3a7d7c14cd83bbd05e2c93eb73928bb8a4dfd074134d3a93700fe937c0fd1c3ef0fbb

View File

@ -0,0 +1,41 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-devel/crossdev/crossdev-20140118.ebuild,v 1.1 2014/01/18 19:52:02 vapier Exp $
EAPI="5"
inherit eutils
if [[ ${PV} == "99999999" ]] ; then
EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/crossdev.git"
inherit git-2
SRC_URI=""
#KEYWORDS=""
else
SRC_URI="mirror://gentoo/${P}.tar.xz
http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
fi
DESCRIPTION="Gentoo Cross-toolchain generator"
HOMEPAGE="http://www.gentoo.org/"
LICENSE="GPL-2"
SLOT="0"
IUSE=""
RDEPEND=">=sys-apps/portage-2.1
app-shells/bash
!sys-devel/crossdev-wrappers"
DEPEND="app-arch/xz-utils"
src_prepare() {
epatch "${FILESDIR}"/*.patch
}
src_install() {
default
if [[ "${PV}" == "99999999" ]] ; then
sed -i "s:@CDEVPV@:${EGIT_VERSION}:" "${ED}"/usr/bin/crossdev || die
fi
}

View File

@ -0,0 +1,56 @@
From 18a89b529289474263c6dbf642b04e720b8f885b Mon Sep 17 00:00:00 2001
From: Michael Marineau <mike@marineau.org>
Date: Sat, 19 Jul 2014 12:02:52 -0700
Subject: [PATCH] cross-pkg-config: require 0.24 and use PKG_CONFIG_SYSROOT_DIR
The bug with PKG_CONFIG_SYSROOT_DIR was fixed long ago and the
replacement code doesn't translate paths outside of /usr, causing the
wrapper to abort when it looks up a library installed in /lib.
---
wrappers/cross-pkg-config | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/wrappers/cross-pkg-config b/wrappers/cross-pkg-config
index d124261..67acd9b 100755
--- a/wrappers/cross-pkg-config
+++ b/wrappers/cross-pkg-config
@@ -23,7 +23,7 @@ error() {
#
# Sanity/distro checks
#
-MIN_VER="0.20" # needs PKG_CONFIG_SYSROOT_DIR
+MIN_VER="0.24" # needs working PKG_CONFIG_SYSROOT_DIR
if ! pkg-config --atleast-pkgconfig-version ${MIN_VER} ; then
error pkg-config is too old ... upgrade to at least v${MIN_VER}
fi
@@ -81,12 +81,7 @@ export PKG_CONFIG_LIBDIR="${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/share/pkgc
if [ -n "${EXTRA_PKG_CONFIG_LIBDIR}" ] ; then
PKG_CONFIG_LIBDIR="${EXTRA_PKG_CONFIG_LIBDIR}:${PKG_CONFIG_LIBDIR}"
fi
-#
-# This guy is horribly broken in pkg-config <=0.23:
-# https://bugs.freedesktop.org/show_bug.cgi?id=16905
-#
-#export PKG_CONFIG_SYSROOT_DIR="${SYSROOT}"
-unset PKG_CONFIG_SYSROOT_DIR
+export PKG_CONFIG_SYSROOT_DIR="${SYSROOT}"
#
# Sanity check the output to catch common errors that do not
@@ -95,13 +90,6 @@ unset PKG_CONFIG_SYSROOT_DIR
output=$(pkg-config "$@")
ret=$?
-#
-# Inject PKG_CONFIG_SYSROOT_DIR ourselves until pkg-config is fixed.
-# We can't mung the .pc files as some of the vars are used at compile
-# time to encode runtime paths.
-#
-output=$(echo "${output}" | sed -e 's:\(-[IL][[:space:]]*\)\(/usr\):\1'"${SYSROOT}"'\2:g')
-
# We turn the output into a newline separate string of options, then use grep
# to look for bad -Is and -Ls. Bad -Is and -Ls are ones that point to things
# outside the ${SYSROOT}.
--
1.8.5.5