From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1012811-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 1584F1382C5
	for <garchives@archives.gentoo.org>; Tue, 27 Mar 2018 09:01:03 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 0DD61E087C;
	Tue, 27 Mar 2018 09:01:02 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id C3ABAE087C
	for <gentoo-commits@lists.gentoo.org>; Tue, 27 Mar 2018 09:01:00 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id A2C8C335C51
	for <gentoo-commits@lists.gentoo.org>; Tue, 27 Mar 2018 09:00:58 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id BFD7A25C
	for <gentoo-commits@lists.gentoo.org>; Tue, 27 Mar 2018 09:00:56 +0000 (UTC)
From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" <grobian@gentoo.org>
Message-ID: <1522141247.96f1d755b39e80fc469c6a74d8d2a025307f4840.grobian@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/lsof/, sys-process/lsof/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch sys-process/lsof/lsof-4.90.ebuild sys-process/lsof/lsof-4.91.ebuild
X-VCS-Directories: sys-process/lsof/files/ sys-process/lsof/
X-VCS-Committer: grobian
X-VCS-Committer-Name: Fabian Groffen
X-VCS-Revision: 96f1d755b39e80fc469c6a74d8d2a025307f4840
X-VCS-Branch: master
Date: Tue, 27 Mar 2018 09:00:56 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 8d970934-7757-4e90-98e1-43ec0727141c
X-Archives-Hash: 9f3565cc7b7364da678c188a8a8043b7

commit:     96f1d755b39e80fc469c6a74d8d2a025307f4840
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 27 09:00:47 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Mar 27 09:00:47 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96f1d755

sys-process/lsof: fix for Darwin, bug #648084

This is based on the work by jsteward in bug #648084.

Closes: https://bugs.gentoo.org/648084
Package-Manager: Portage-2.3.24, Repoman-2.3.6

 sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch | 12 ++++++++++++
 sys-process/lsof/lsof-4.90.ebuild                    | 12 +++++++++++-
 sys-process/lsof/lsof-4.91.ebuild                    | 12 +++++++++++-
 3 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch b/sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch
new file mode 100644
index 00000000000..fcbfeba410a
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch
@@ -0,0 +1,12 @@
+diff -Naur a/dialects/darwin/libproc/dfile.c b/dialects/darwin/libproc/dfile.c
+--- a/dialects/darwin/libproc/dfile.c	2018-02-19 15:04:26.011578124 +0800
++++ b/dialects/darwin/libproc/dfile.c	2018-02-19 15:04:45.006502653 +0800
+@@ -43,7 +43,7 @@
+ #include "lsof.h"
+ 
+ #if	defined(PROC_FP_GUARDED)
+-#extern	struct pff_tab	Pgf_tab[];
++extern	struct pff_tab	Pgf_tab[];
+ #endif	/* defined(PROC_FP_GUARDED) */
+ 
+ 

diff --git a/sys-process/lsof/lsof-4.90.ebuild b/sys-process/lsof/lsof-4.90.ebuild
index f22dd0eaae8..8a1faa697af 100644
--- a/sys-process/lsof/lsof-4.90.ebuild
+++ b/sys-process/lsof/lsof-4.90.ebuild
@@ -14,7 +14,7 @@ SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
 
 LICENSE="lsof"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
 IUSE="examples ipv6 rpc selinux static"
 
 RDEPEND="rpc? ( net-libs/libtirpc )
@@ -26,6 +26,7 @@ S="${WORKDIR}/${MY_P}/${MY_P}_src"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-4.85-cross.patch #432120
+	"${FILESDIR}"/${PN}-4.90-darwin-cppfix.patch #648084
 )
 
 src_unpack() {
@@ -66,6 +67,15 @@ src_configure() {
 	append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H")
 	append-cppflags $(usex ipv6 -{D,U}HASIPv6)
 	[[ ${CHOST} == *-solaris2.11 ]] && append-cppflags -DHAS_PAD_MUTEX
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		# make sys/proc_info.h available in ${T} because of LSOF_INCLUDE
+		# dummy location -- Darwin needs this for a Configure check to
+		# succeed
+		if [[ -e /usr/include/sys/proc_info.h ]] ; then
+			mkdir -p "${T}"/sys || die
+			( cd "${T}"/sys && ln -s /usr/include/sys/proc_info.h ) || die
+		fi
+	fi
 
 	export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \
 		$(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)"

diff --git a/sys-process/lsof/lsof-4.91.ebuild b/sys-process/lsof/lsof-4.91.ebuild
index f22dd0eaae8..8a1faa697af 100644
--- a/sys-process/lsof/lsof-4.91.ebuild
+++ b/sys-process/lsof/lsof-4.91.ebuild
@@ -14,7 +14,7 @@ SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
 
 LICENSE="lsof"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
 IUSE="examples ipv6 rpc selinux static"
 
 RDEPEND="rpc? ( net-libs/libtirpc )
@@ -26,6 +26,7 @@ S="${WORKDIR}/${MY_P}/${MY_P}_src"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-4.85-cross.patch #432120
+	"${FILESDIR}"/${PN}-4.90-darwin-cppfix.patch #648084
 )
 
 src_unpack() {
@@ -66,6 +67,15 @@ src_configure() {
 	append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H")
 	append-cppflags $(usex ipv6 -{D,U}HASIPv6)
 	[[ ${CHOST} == *-solaris2.11 ]] && append-cppflags -DHAS_PAD_MUTEX
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		# make sys/proc_info.h available in ${T} because of LSOF_INCLUDE
+		# dummy location -- Darwin needs this for a Configure check to
+		# succeed
+		if [[ -e /usr/include/sys/proc_info.h ]] ; then
+			mkdir -p "${T}"/sys || die
+			( cd "${T}"/sys && ln -s /usr/include/sys/proc_info.h ) || die
+		fi
+	fi
 
 	export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \
 		$(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)"