commit:     6229346e306f1a8cef07bcf6edbb9b761fa1ed8e
Author:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 20 16:11:51 2016 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Wed Apr 20 16:13:08 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6229346e

dev-util/pkgconfig-openbsd: backport patch from upstream solving build failure 
in various consumers

Use of $_ produces warnings which can cause build failures in certain consumers.

Backported from revision 1.4 upstream 
(http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/pkg-config/OpenBSD/PkgConfig.pm).

Gentoo-bug: 538012
Gentoo-bug: 545314
Gentoo-bug: 545322
Gentoo-bug: 545962

Package-Manager: portage-2.2.28

 .../pkgconfig-openbsd-20130507-zap-warning.patch   | 19 ++++++
 .../pkgconfig-openbsd-20130507-r2.ebuild           | 73 ++++++++++++++++++++++
 2 files changed, 92 insertions(+)

diff --git 
a/dev-util/pkgconfig-openbsd/files/pkgconfig-openbsd-20130507-zap-warning.patch 
b/dev-util/pkgconfig-openbsd/files/pkgconfig-openbsd-20130507-zap-warning.patch
new file mode 100644
index 0000000..41784c9
--- /dev/null
+++ 
b/dev-util/pkgconfig-openbsd/files/pkgconfig-openbsd-20130507-zap-warning.patch
@@ -0,0 +1,19 @@
+Use of $_ produces warnings which can cause build failures in certain 
consumers.
+
+Backported from revision 1.4 upstream 
(http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/pkg-config/OpenBSD/PkgConfig.pm).
+
+Gentoo-bug: 538012
+Gentoo-bug: 545314
+Gentoo-bug: 545322
+Gentoo-bug: 545962
+
+--- a/src/usr.bin/pkg-config/OpenBSD/PkgConfig.pm
++++ b/src/usr.bin/pkg-config/OpenBSD/PkgConfig.pm
+@@ -91,7 +91,6 @@
+ {
+       my ($class, $fh, $name) = @_;
+       my $cfg = $class->new;
+-      my $_;
+ 
+       $name = '' if !defined $name;
+       while (<$fh>) {

diff --git a/dev-util/pkgconfig-openbsd/pkgconfig-openbsd-20130507-r2.ebuild 
b/dev-util/pkgconfig-openbsd/pkgconfig-openbsd-20130507-r2.ebuild
new file mode 100644
index 0000000..052af6e
--- /dev/null
+++ b/dev-util/pkgconfig-openbsd/pkgconfig-openbsd-20130507-r2.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PERL_EXPORT_PHASE_FUNCTIONS=no
+inherit eutils multilib perl-module multilib-minimal
+
+# cvs -d [email protected]:/cvs get src/usr.bin/pkg-config
+
+PKG_M4_VERSION=0.28
+
+DESCRIPTION="A perl based version of pkg-config from OpenBSD"
+HOMEPAGE="http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/pkg-config/";
+SRC_URI="https://dev.gentoo.org/~ssuominen/${P}.tar.xz
+       pkg-config? ( 
http://pkgconfig.freedesktop.org/releases/pkg-config-${PKG_M4_VERSION}.tar.gz )"
+
+LICENSE="ISC"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pkg-config"
+
+RDEPEND="virtual/perl-Getopt-Long
+       pkg-config? (
+               !dev-util/pkgconfig
+               !dev-util/pkgconf[pkg-config]
+       )"
+
+S=${WORKDIR}/src
+
+src_prepare() {
+       epatch_user
+       ecvs_clean
+
+       epatch "${FILESDIR}/${P}-zap-warning.patch"
+
+       # Config.pm from dev-lang/perl doesn't set ARCH, only archname
+       sed -i -e '/Config/s:ARCH:archname:' usr.bin/pkg-config/pkg-config || 
die
+
+       if use pkg-config; then
+               MULTILIB_CHOST_TOOLS=( /usr/bin/pkg-config )
+       else
+               MULTILIB_CHOST_TOOLS=( /usr/bin/pkg-config-openbsd )
+       fi
+}
+
+multilib_src_install() {
+       local pc_bin=pkg-config
+       use pkg-config || pc_bin+=-openbsd
+
+       newbin "${S}"/usr.bin/pkg-config/pkg-config ${pc_bin}
+       newman "${S}"/usr.bin/pkg-config/pkg-config.1 ${pc_bin}.1
+
+       # insert proper paths
+       local pc_paths=(
+               /usr/$(get_libdir)/pkgconfig
+               /usr/share/pkgconfig
+       )
+       sed -i -e "/my @PKGPATH/,/;/{s@(.*@( ${pc_paths[*]} );@p;d}" \
+               "${ED%/}/usr/bin/${pc_bin}" || die
+}
+
+multilib_src_install_all() {
+       if use pkg-config; then
+               insinto /usr/share/aclocal
+               doins "${WORKDIR}"/pkg-config-*/pkg.m4
+       fi
+
+       perl_set_version
+       insinto "${VENDOR_LIB}"
+       doins -r "${S}"/usr.bin/pkg-config/OpenBSD
+}

Reply via email to