1 |
commit: 96f1d755b39e80fc469c6a74d8d2a025307f4840 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Mar 27 09:00:47 2018 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Mar 27 09:00:47 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96f1d755 |
7 |
|
8 |
sys-process/lsof: fix for Darwin, bug #648084 |
9 |
|
10 |
This is based on the work by jsteward in bug #648084. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/648084 |
13 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
14 |
|
15 |
sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch | 12 ++++++++++++ |
16 |
sys-process/lsof/lsof-4.90.ebuild | 12 +++++++++++- |
17 |
sys-process/lsof/lsof-4.91.ebuild | 12 +++++++++++- |
18 |
3 files changed, 34 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch b/sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..fcbfeba410a |
23 |
--- /dev/null |
24 |
+++ b/sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch |
25 |
@@ -0,0 +1,12 @@ |
26 |
+diff -Naur a/dialects/darwin/libproc/dfile.c b/dialects/darwin/libproc/dfile.c |
27 |
+--- a/dialects/darwin/libproc/dfile.c 2018-02-19 15:04:26.011578124 +0800 |
28 |
++++ b/dialects/darwin/libproc/dfile.c 2018-02-19 15:04:45.006502653 +0800 |
29 |
+@@ -43,7 +43,7 @@ |
30 |
+ #include "lsof.h" |
31 |
+ |
32 |
+ #if defined(PROC_FP_GUARDED) |
33 |
+-#extern struct pff_tab Pgf_tab[]; |
34 |
++extern struct pff_tab Pgf_tab[]; |
35 |
+ #endif /* defined(PROC_FP_GUARDED) */ |
36 |
+ |
37 |
+ |
38 |
|
39 |
diff --git a/sys-process/lsof/lsof-4.90.ebuild b/sys-process/lsof/lsof-4.90.ebuild |
40 |
index f22dd0eaae8..8a1faa697af 100644 |
41 |
--- a/sys-process/lsof/lsof-4.90.ebuild |
42 |
+++ b/sys-process/lsof/lsof-4.90.ebuild |
43 |
@@ -14,7 +14,7 @@ SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2 |
44 |
|
45 |
LICENSE="lsof" |
46 |
SLOT="0" |
47 |
-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" |
48 |
+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" |
49 |
IUSE="examples ipv6 rpc selinux static" |
50 |
|
51 |
RDEPEND="rpc? ( net-libs/libtirpc ) |
52 |
@@ -26,6 +26,7 @@ S="${WORKDIR}/${MY_P}/${MY_P}_src" |
53 |
|
54 |
PATCHES=( |
55 |
"${FILESDIR}"/${PN}-4.85-cross.patch #432120 |
56 |
+ "${FILESDIR}"/${PN}-4.90-darwin-cppfix.patch #648084 |
57 |
) |
58 |
|
59 |
src_unpack() { |
60 |
@@ -66,6 +67,15 @@ src_configure() { |
61 |
append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H") |
62 |
append-cppflags $(usex ipv6 -{D,U}HASIPv6) |
63 |
[[ ${CHOST} == *-solaris2.11 ]] && append-cppflags -DHAS_PAD_MUTEX |
64 |
+ if [[ ${CHOST} == *-darwin* ]] ; then |
65 |
+ # make sys/proc_info.h available in ${T} because of LSOF_INCLUDE |
66 |
+ # dummy location -- Darwin needs this for a Configure check to |
67 |
+ # succeed |
68 |
+ if [[ -e /usr/include/sys/proc_info.h ]] ; then |
69 |
+ mkdir -p "${T}"/sys || die |
70 |
+ ( cd "${T}"/sys && ln -s /usr/include/sys/proc_info.h ) || die |
71 |
+ fi |
72 |
+ fi |
73 |
|
74 |
export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \ |
75 |
$(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)" |
76 |
|
77 |
diff --git a/sys-process/lsof/lsof-4.91.ebuild b/sys-process/lsof/lsof-4.91.ebuild |
78 |
index f22dd0eaae8..8a1faa697af 100644 |
79 |
--- a/sys-process/lsof/lsof-4.91.ebuild |
80 |
+++ b/sys-process/lsof/lsof-4.91.ebuild |
81 |
@@ -14,7 +14,7 @@ SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2 |
82 |
|
83 |
LICENSE="lsof" |
84 |
SLOT="0" |
85 |
-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" |
86 |
+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" |
87 |
IUSE="examples ipv6 rpc selinux static" |
88 |
|
89 |
RDEPEND="rpc? ( net-libs/libtirpc ) |
90 |
@@ -26,6 +26,7 @@ S="${WORKDIR}/${MY_P}/${MY_P}_src" |
91 |
|
92 |
PATCHES=( |
93 |
"${FILESDIR}"/${PN}-4.85-cross.patch #432120 |
94 |
+ "${FILESDIR}"/${PN}-4.90-darwin-cppfix.patch #648084 |
95 |
) |
96 |
|
97 |
src_unpack() { |
98 |
@@ -66,6 +67,15 @@ src_configure() { |
99 |
append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H") |
100 |
append-cppflags $(usex ipv6 -{D,U}HASIPv6) |
101 |
[[ ${CHOST} == *-solaris2.11 ]] && append-cppflags -DHAS_PAD_MUTEX |
102 |
+ if [[ ${CHOST} == *-darwin* ]] ; then |
103 |
+ # make sys/proc_info.h available in ${T} because of LSOF_INCLUDE |
104 |
+ # dummy location -- Darwin needs this for a Configure check to |
105 |
+ # succeed |
106 |
+ if [[ -e /usr/include/sys/proc_info.h ]] ; then |
107 |
+ mkdir -p "${T}"/sys || die |
108 |
+ ( cd "${T}"/sys && ln -s /usr/include/sys/proc_info.h ) || die |
109 |
+ fi |
110 |
+ fi |
111 |
|
112 |
export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \ |
113 |
$(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)" |