public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/musl:master commit in: dev-libs/libnl/, dev-libs/libnl/files/
@ 2017-03-09  4:16 Aric Belsito
  0 siblings, 0 replies; only message in thread
From: Aric Belsito @ 2017-03-09  4:16 UTC (permalink / raw
  To: gentoo-commits

commit:     48d2a28710ae40877fd3e178ead1fb1bb0baa62c
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Thu Mar  9 04:15:13 2017 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Thu Mar  9 04:15:13 2017 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=48d2a287

dev-libs/libnl: add 3.3.0_rc1

Use a modified version of the linux-headers-4.4 patch on their
internally-shipped linux-headers, because otherwise we get fun symbol
redefinition errors depending on what musl/linux-headers version we're using.

Close #32

 dev-libs/libnl/Manifest                         |   4 +
 dev-libs/libnl/files/libnl-3.3.0_rc1-musl.patch | 103 ++++++++++++++++++++++
 dev-libs/libnl/libnl-3.3.0_rc1.ebuild           | 108 ++++++++++++++++++++++++
 dev-libs/libnl/metadata.xml                     |  15 ++++
 4 files changed, 230 insertions(+)

diff --git a/dev-libs/libnl/Manifest b/dev-libs/libnl/Manifest
new file mode 100644
index 0000000..895e9b6
--- /dev/null
+++ b/dev-libs/libnl/Manifest
@@ -0,0 +1,4 @@
+AUX libnl-3.3.0_rc1-musl.patch 3539 SHA256 8e0a4d1da3ddc8cfbe81b5d9440458b6bbebce101aeaaff4085c2ba857d208de SHA512 a31ec4b76d2fc472072f2d770cb3f5819a6477230a97603a476ce175c0c94d25e74eff8dc0ce2e6baa96f0e450b82db508a152f418bdd72919cbd5521d5f82fd WHIRLPOOL 6678b618dea03c1dc51c506e3f81ec770c5ab1ee1fd3931e7b52fa2e217a6cdccdf465f4ee979ecba2c4dee55e132057e55e065eaabd1c576b219d8bc0ef8305
+DIST libnl-3.3.0-rc1.tar.gz 933271 SHA256 426f69373191760174cb40cb1f9a811248a56f8962fe66cf22156a71685fd110 SHA512 8084a54efac0256f6badd438fb79512cc53ee5f6635c4f301d1f7b3cfdf326387176949ac368903109dda02f55589ed09cb8f3218ebac973457c6f2740951488 WHIRLPOOL b8db1d4f589d32f0da830dc934765c67087665ac58366265fc2f5d649178c161cfc41e2faf139859c9547c5b20f28bfff5875db9c51cbfe93df3ecc01c3d7f3e
+EBUILD libnl-3.3.0_rc1.ebuild 2519 SHA256 be1f7386c1add9df900a97726b94a27d2b646fdca9fb3f3615a9e1055304d92f SHA512 7a53ceea365a4e4fc4ee5c079be1fe7afda32b091a6f4f6949ff5c5be6a84902a5e8d07a37b2b761591698c002cb851a0f5b0fe76b2f9e0b36c09294ef93dbb5 WHIRLPOOL 4bbecddb5f6514edce41334c43bcd543acb6fd382561396fd80931a7ca981579eac3069fbd6674128be15b81cb06dc826e9459bcc641b8397bdb026d81ccbae0
+MISC metadata.xml 584 SHA256 b4a1c62be473810a9e60ab6c043c14ea56dd7ffbdfc47639a30e84b4c31119e9 SHA512 0e8731a9aafb77b313583babfb2786c4fcbe655f3fcebe93fee90b2ea4c7f03a6ed559a253cb63f5f3a5eb9fd841babcbb5c85c4c93e51a670abe605e9d22a9c WHIRLPOOL 841629b52e45cd949bde7aae4ce9a62d274f69a124ba90cc33d75191a0b7cf11f7b0fa6c8af996af476e4164562cdc6d92d33ea93c9d1405da64844dace77ec1

diff --git a/dev-libs/libnl/files/libnl-3.3.0_rc1-musl.patch b/dev-libs/libnl/files/libnl-3.3.0_rc1-musl.patch
new file mode 100644
index 0000000..e62653a
--- /dev/null
+++ b/dev-libs/libnl/files/libnl-3.3.0_rc1-musl.patch
@@ -0,0 +1,103 @@
+diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/if_ether.h libnl-3.3.0_rc1/include/linux-private/linux/if_ether.h
+--- libnl-3.3.0_rc1.orig/include/linux-private/linux/if_ether.h	2017-03-08 19:56:31.824516933 -0800
++++ libnl-3.3.0_rc1/include/linux-private/linux/if_ether.h	2017-03-08 20:07:01.938237767 -0800
+@@ -22,6 +22,7 @@
+ #define _LINUX_IF_ETHER_H
+ 
+ #include <linux/types.h>
++#include <linux/libc-compat.h>
+ 
+ /*
+  *	IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
+@@ -117,10 +118,12 @@
+  *	This is an Ethernet frame header.
+  */
+ 
++#if __UAPI_DEF_ETHHDR
+ struct ethhdr {
+ 	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
+ 	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
+ 	__be16		h_proto;		/* packet type ID field	*/
+ } __attribute__((packed));
++#endif
+ 
+ #endif	/* _LINUX_IF_ETHER_H */
+diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/libc-compat.h libnl-3.3.0_rc1/include/linux-private/linux/libc-compat.h
+--- libnl-3.3.0_rc1.orig/include/linux-private/linux/libc-compat.h	2017-03-08 19:56:31.823516923 -0800
++++ libnl-3.3.0_rc1/include/linux-private/linux/libc-compat.h	2017-03-08 20:12:30.376843489 -0800
+@@ -48,10 +48,18 @@
+ #ifndef _LIBC_COMPAT_H
+ #define _LIBC_COMPAT_H
+ 
+-/* We have included glibc headers... */
+-#if defined(__GLIBC__)
++/* We're used from userspace... */
++#if !defined(__KERNEL__)
+ 
+-/* Coordinate with glibc netinet/in.h header. */
++/* Coordinate with libc netinet/if_ether.h */
++#ifdef _NETINET_IF_ETHER_H /* musl */
++#define __UAPI_DEF_ETHHDR 0
++#else
++/* glibc uses __NETINET_IF_ETHER_H, and uses the uapi header. */
++#define __UAPI_DEF_ETHHDR 1
++#endif
++
++/* Coordinate with libc netinet/in.h header. */
+ #if defined(_NETINET_IN_H)
+ 
+ /* GLIBC headers included first so don't define anything
+@@ -64,15 +72,7 @@
+ #define __UAPI_DEF_IN_CLASS		0
+ 
+ #define __UAPI_DEF_IN6_ADDR		0
+-/* The exception is the in6_addr macros which must be defined
+- * if the glibc code didn't define them. This guard matches
+- * the guard in glibc/inet/netinet/in.h which defines the
+- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
+-#if defined(__USE_MISC) || defined (__USE_GNU)
+ #define __UAPI_DEF_IN6_ADDR_ALT		0
+-#else
+-#define __UAPI_DEF_IN6_ADDR_ALT		1
+-#endif
+ #define __UAPI_DEF_SOCKADDR_IN6		0
+ #define __UAPI_DEF_IPV6_MREQ		0
+ #define __UAPI_DEF_IPPROTO_V6		0
+@@ -83,7 +83,7 @@
+ #else
+ 
+ /* Linux headers included first, and we must define everything
+- * we need. The expectation is that glibc will check the
++ * we need. The expectation is that libc will check the
+  * __UAPI_DEF_* defines and adjust appropriately. */
+ #define __UAPI_DEF_IN_ADDR		1
+ #define __UAPI_DEF_IN_IPPROTO		1
+@@ -93,7 +93,7 @@
+ #define __UAPI_DEF_IN_CLASS		1
+ 
+ #define __UAPI_DEF_IN6_ADDR		1
+-/* We unconditionally define the in6_addr macros and glibc must
++/* We unconditionally define the in6_addr macros and libc must
+  * coordinate. */
+ #define __UAPI_DEF_IN6_ADDR_ALT		1
+ #define __UAPI_DEF_SOCKADDR_IN6		1
+@@ -115,7 +115,10 @@
+ /* If we did not see any headers from any supported C libraries,
+  * or we are being included in the kernel, then define everything
+  * that we need. */
+-#else /* !defined(__GLIBC__) */
++#else /* defined(__KERNEL__) */
++
++/* Definitions for if/ether.h */
++#define  __UAPI_DEF_ETHHDR		1
+ 
+ /* Definitions for in.h */
+ #define __UAPI_DEF_IN_ADDR		1
+@@ -138,6 +141,6 @@
+ /* Definitions for xattr.h */
+ #define __UAPI_DEF_XATTR		1
+ 
+-#endif /* __GLIBC__ */
++#endif /* defined(__KERNEL__) */
+ 
+ #endif /* _LIBC_COMPAT_H */

diff --git a/dev-libs/libnl/libnl-3.3.0_rc1.ebuild b/dev-libs/libnl/libnl-3.3.0_rc1.ebuild
new file mode 100644
index 0000000..9667b46
--- /dev/null
+++ b/dev-libs/libnl/libnl-3.3.0_rc1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5} )
+DISTUTILS_OPTIONAL=1
+inherit distutils-r1 eutils libtool multilib multilib-minimal
+
+LIBNL_P=${P/_/-}
+LIBNL_DIR=${PV/_/}
+LIBNL_DIR=${LIBNL_DIR//./_}
+
+DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
+HOMEPAGE="http://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl"
+SRC_URI="
+	https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz
+"
+LICENSE="LGPL-2.1 utils? ( GPL-2 )"
+SLOT="3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="static-libs python utils"
+
+RDEPEND="
+	python? ( ${PYTHON_DEPS} )
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140508-r5
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)
+"
+DEPEND="
+	${RDEPEND}
+	python? ( dev-lang/swig )
+	sys-devel/bison
+	sys-devel/flex
+"
+REQUIRED_USE="
+	python? ( ${PYTHON_REQUIRED_USE} )
+"
+DOCS=(
+	ChangeLog
+)
+
+PATCHES=( "${FILESDIR}"/${P}-musl.patch )
+
+S=${WORKDIR}/${LIBNL_P}
+
+MULTILIB_WRAPPED_HEADERS=(
+	# we do not install CLI stuff for non-native
+	/usr/include/libnl3/netlink/cli/addr.h
+	/usr/include/libnl3/netlink/cli/class.h
+	/usr/include/libnl3/netlink/cli/cls.h
+	/usr/include/libnl3/netlink/cli/ct.h
+	/usr/include/libnl3/netlink/cli/exp.h
+	/usr/include/libnl3/netlink/cli/link.h
+	/usr/include/libnl3/netlink/cli/neigh.h
+	/usr/include/libnl3/netlink/cli/qdisc.h
+	/usr/include/libnl3/netlink/cli/route.h
+	/usr/include/libnl3/netlink/cli/rule.h
+	/usr/include/libnl3/netlink/cli/tc.h
+	/usr/include/libnl3/netlink/cli/utils.h
+)
+
+src_prepare() {
+	default
+
+	elibtoolize
+
+	if use python; then
+		cd "${S}"/python || die
+		distutils-r1_src_prepare
+	fi
+
+	# out-of-source build broken
+	# https://github.com/thom311/libnl/pull/58
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	econf \
+		--disable-silent-rules \
+		$(use_enable static-libs static) \
+		$(multilib_native_use_enable utils cli)
+}
+
+multilib_src_compile() {
+	default
+
+	if multilib_is_native_abi && use python; then
+		cd python || die
+		distutils-r1_src_compile
+	fi
+}
+
+multilib_src_install() {
+	emake DESTDIR="${D}" install
+
+	if multilib_is_native_abi && use python; then
+		# Unset DOCS= since distutils-r1.eclass interferes
+		local DOCS=()
+		cd python || die
+		distutils-r1_src_install
+	fi
+}
+
+multilib_src_install_all() {
+	einstalldocs
+	prune_libtool_files --modules
+}

diff --git a/dev-libs/libnl/metadata.xml b/dev-libs/libnl/metadata.xml
new file mode 100644
index 0000000..ec36f8d
--- /dev/null
+++ b/dev-libs/libnl/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>netmon@gentoo.org</email>
+		<name>Gentoo network monitoring and analysis project</name>
+	</maintainer>
+	<use>
+		<flag name="python">Install experimental <pkg>dev-lang/python</pkg> bindings</flag>
+		<flag name="utils">Install command line interface utils</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">thom311/libnl</remote-id>
+	</upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-09  4:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-09  4:16 [gentoo-commits] proj/musl:master commit in: dev-libs/libnl/, dev-libs/libnl/files/ Aric Belsito

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox