commit:     3066e312d61ea915d131290aca54cea4d6496a20
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 19 07:10:47 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Apr 19 07:10:47 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3066e312

sys-fs/lsscsi: fix build w/newer glibc #580494

 sys-fs/lsscsi/files/lsscsi-0.28-sysmacros.patch | 37 +++++++++++++++++++++++++
 sys-fs/lsscsi/lsscsi-0.28.ebuild                |  6 ++++
 2 files changed, 43 insertions(+)

diff --git a/sys-fs/lsscsi/files/lsscsi-0.28-sysmacros.patch 
b/sys-fs/lsscsi/files/lsscsi-0.28-sysmacros.patch
new file mode 100644
index 0000000..099256f
--- /dev/null
+++ b/sys-fs/lsscsi/files/lsscsi-0.28-sysmacros.patch
@@ -0,0 +1,37 @@
+https://bugs.gentoo.org/580494
+
+From 5f1d6f46c8c1ac134841cfcce22dc7639598e032 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <[email protected]>
+Date: Tue, 19 Apr 2016 03:07:23 -0400
+Subject: [PATCH] include sys/sysmacros.h for major/minor
+
+These funcs are defined in sys/sysmacros.h, so include it to avoid:
+lsscsi.c: In function 'collect_dev_nodes':
+lsscsi.c:961:32: warning: implicit declaration of function 'major' 
[-Wimplicit-function-declaration]
+                 cur_ent->maj = major(stats.st_rdev);
+                                ^
+lsscsi.c:962:32: warning: implicit declaration of function 'minor' 
[-Wimplicit-function-declaration]
+                 cur_ent->min = minor(stats.st_rdev);
+                                ^
+lsscsi.o: In function 'get_dev_node':
+lsscsi.c:(.text+0x10f0): undefined reference to 'major'
+lsscsi.c:(.text+0x1117): undefined reference to 'minor'
+---
+ src/lsscsi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lsscsi.c b/src/lsscsi.c
+index e494169..61cfebd 100644
+--- a/src/lsscsi.c
++++ b/src/lsscsi.c
+@@ -23,6 +23,7 @@
+ #include <unistd.h>
+ #include <getopt.h>
+ #include <fcntl.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <dirent.h>
+-- 
+2.7.4
+

diff --git a/sys-fs/lsscsi/lsscsi-0.28.ebuild b/sys-fs/lsscsi/lsscsi-0.28.ebuild
index e370095..f11c947 100644
--- a/sys-fs/lsscsi/lsscsi-0.28.ebuild
+++ b/sys-fs/lsscsi/lsscsi-0.28.ebuild
@@ -4,6 +4,8 @@
 
 EAPI=5
 
+inherit eutils
+
 DESCRIPTION="SCSI sysfs query tool"
 HOMEPAGE="http://sg.danny.cz/scsi/lsscsi.html";
 SRC_URI="http://sg.danny.cz/scsi/${P}.tgz";
@@ -11,3 +13,7 @@ SRC_URI="http://sg.danny.cz/scsi/${P}.tgz";
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-sysmacros.patch #580494
+}

Reply via email to