commit: da400dec15a2987751259860fea158bf252b3baa Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> AuthorDate: Tue Jan 3 22:13:18 2017 +0000 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> CommitDate: Tue Jan 3 22:13:18 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da400dec
sys-block/open-iscsi: use compat <linux/ethtool.h> to build on musl Package-Manager: portage-2.3.0 .../open-iscsi-2.0.874-musl-ethtool-compat.patch | 69 ++++++++++++++++++++++ sys-block/open-iscsi/open-iscsi-2.0.874.ebuild | 7 ++- 2 files changed, 73 insertions(+), 3 deletions(-) diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.874-musl-ethtool-compat.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.874-musl-ethtool-compat.patch new file mode 100644 index 00000000..12b82c7 --- /dev/null +++ b/sys-block/open-iscsi/files/open-iscsi-2.0.874-musl-ethtool-compat.patch @@ -0,0 +1,69 @@ +From: Anthony G. Basiel <bluen...@gentoo.org> + +diff -Naur open-iscsi-2.0.874.orig/iscsiuio/src/unix/libs/bnx2x.c open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2x.c +--- open-iscsi-2.0.874.orig/iscsiuio/src/unix/libs/bnx2x.c 2016-09-29 18:33:24.000000000 +0000 ++++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2x.c 2017-01-03 21:45:47.504035833 +0000 +@@ -42,7 +42,7 @@ + #include <arpa/inet.h> + #include <linux/types.h> /* Needed for linux/ethtool.h on RHEL 5.x */ + #include <linux/sockios.h> +-#include <linux/ethtool.h> ++#include "ethtool-compat.h" + #include <sys/mman.h> + #include <sys/ioctl.h> + #include <sys/types.h> +diff -Naur open-iscsi-2.0.874.orig/iscsiuio/src/unix/libs/ethtool-compat.h open-iscsi-2.0.874/iscsiuio/src/unix/libs/ethtool-compat.h +--- open-iscsi-2.0.874.orig/iscsiuio/src/unix/libs/ethtool-compat.h 1970-01-01 00:00:00.000000000 +0000 ++++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/ethtool-compat.h 2017-01-03 21:45:23.016034980 +0000 +@@ -0,0 +1,51 @@ ++/* ++ * ethtool-compat.h: adopted from ++ # ethtool.h: Defines for Linux ethtool. ++ * ++ * Copyright (C) 1998 David S. Miller (da...@redhat.com) ++ * Copyright 2001 Jeff Garzik <jgar...@pobox.com> ++ * Portions Copyright 2001 Sun Microsystems (thoc...@sun.com) ++ * Portions Copyright 2002 Intel (eli.kuperm...@intel.com, ++ * christopher.le...@intel.com, ++ * scott.feld...@intel.com) ++ * Portions Copyright (C) Sun Microsystems 2008 ++ */ ++ ++#include <linux/types.h> ++#include <netinet/if_ether.h> ++ ++#define ETHTOOL_FWVERS_LEN 32 ++#define ETHTOOL_BUSINFO_LEN 32 ++#define ETHTOOL_EROMVERS_LEN 32 ++ ++struct ethtool_drvinfo { ++ __u32 cmd; ++ char driver[32]; ++ char version[32]; ++ char fw_version[ETHTOOL_FWVERS_LEN]; ++ char bus_info[ETHTOOL_BUSINFO_LEN]; ++ char erom_version[ETHTOOL_EROMVERS_LEN]; ++ char reserved2[12]; ++ __u32 n_priv_flags; ++ __u32 n_stats; ++ __u32 testinfo_len; ++ __u32 eedump_len; ++ __u32 regdump_len; ++}; ++ ++struct ethtool_tcpip4_spec { ++ __be32 ip4src; ++ __be32 ip4dst; ++ __be16 psrc; ++ __be16 pdst; ++ __u8 tos; ++}; ++ ++struct ethtool_ah_espip4_spec { ++ __be32 ip4src; ++ __be32 ip4dst; ++ __be32 spi; ++ __u8 tos; ++}; ++ ++#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */ diff --git a/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild b/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild index 61e16f0..5aea512 100644 --- a/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild +++ b/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild @@ -4,7 +4,7 @@ EAPI=6 -inherit versionator linux-info eutils flag-o-matic toolchain-funcs udev +inherit versionator linux-info flag-o-matic toolchain-funcs udev DESCRIPTION="A performant, transport independent, multi-platform implementation of RFC3720" HOMEPAGE="http://www.open-iscsi.org/" @@ -59,8 +59,9 @@ pkg_setup() { } src_prepare() { - epatch "${FILESDIR}"/${P}-Makefiles.patch - epatch "${FILESDIR}"/${P}-musl-fixes.patch + eapply "${FILESDIR}"/${P}-Makefiles.patch + eapply "${FILESDIR}"/${P}-musl-fixes.patch + eapply "${FILESDIR}"/${P}-musl-ethtool-compat.patch eapply_user sed -i -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' etc/iscsid.conf || die