public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/linux-misc-apps/
Date: Fri, 11 Mar 2016 00:46:28 +0000 (UTC)	[thread overview]
Message-ID: <1457657174.b7ab966eb928cdeb495174f9144069bec8a3d27f.robbat2@gentoo> (raw)

commit:     b7ab966eb928cdeb495174f9144069bec8a3d27f
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 11 00:46:14 2016 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Mar 11 00:46:14 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7ab966e

sys-apps/linux-misc-apps: re-add usbip per bug #395871.

Package-Manager: portage-2.2.27

 .../linux-misc-apps/linux-misc-apps-4.4-r1.ebuild  | 217 +++++++++++++++++++++
 sys-apps/linux-misc-apps/metadata.xml              |   3 +
 2 files changed, 220 insertions(+)

diff --git a/sys-apps/linux-misc-apps/linux-misc-apps-4.4-r1.ebuild b/sys-apps/linux-misc-apps/linux-misc-apps-4.4-r1.ebuild
new file mode 100644
index 0000000..227267e
--- /dev/null
+++ b/sys-apps/linux-misc-apps/linux-misc-apps-4.4-r1.ebuild
@@ -0,0 +1,217 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit versionator eutils toolchain-funcs linux-info autotools flag-o-matic
+
+DESCRIPTION="Misc tools bundled with kernel sources"
+HOMEPAGE="https://kernel.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="static-libs tcpd usbip"
+
+MY_PV="${PV/_/-}"
+MY_PV="${MY_PV/-pre/-git}"
+
+LINUX_V=$(get_version_component_range 1-2)
+
+if [ ${PV/_rc} != ${PV} ]; then
+	LINUX_VER=$(get_version_component_range 1-2).$(($(get_version_component_range 3)-1))
+	PATCH_VERSION=$(get_version_component_range 1-3)
+	LINUX_PATCH=patch-${PV//_/-}.xz
+	SRC_URI="mirror://kernel/linux/kernel/v3.x/testing/${LINUX_PATCH}
+		mirror://kernel/linux/kernel/v3.x/testing/v${PATCH_VERSION}/${LINUX_PATCH}"
+elif [ $(get_version_component_count) == 4 ]; then
+	# stable-release series
+	LINUX_VER=$(get_version_component_range 1-3)
+	LINUX_PATCH=patch-${PV}.xz
+	SRC_URI="mirror://kernel/linux/kernel/v3.x/${LINUX_PATCH}"
+else
+	LINUX_VER=${PV}
+fi
+
+LINUX_SOURCES=linux-${LINUX_VER}.tar.xz
+SRC_URI="${SRC_URI} mirror://kernel/linux/kernel/v3.x/${LINUX_SOURCES}"
+
+# pmtools also provides turbostat
+# usbip available in seperate package now
+RDEPEND="sys-apps/hwids
+		>=dev-libs/glib-2.6
+		>=sys-kernel/linux-headers-$(get_version_component_range 1-2)
+		usbip? (
+			!net-misc/usbip
+			tcpd? ( sys-apps/tcp-wrappers )
+			virtual/libudev
+		)
+		!sys-power/pmtools"
+DEPEND="${RDEPEND}
+		virtual/pkgconfig"
+
+S="${WORKDIR}/linux-${LINUX_VER}"
+
+# All of these are integrated with the kernel build system,
+# No make install, and ideally build with with the root Makefile
+TARGETS_SIMPLE=(
+	Documentation/accounting/getdelays.c
+	Documentation/laptops/dslm.c
+	Documentation/networking/timestamping/timestamping.c
+	Documentation/watchdog/src/watchdog-simple.c
+	tools/cgroup/cgroup_event_listener.c
+	tools/laptop/freefall/freefall.c
+	tools/vm/slabinfo.c
+	usr/gen_init_cpio.c
+	# Broken:
+	#tools/lguest/lguest.c # fails to compile
+	#tools/vm/page-types.c # page-types.c:(.text+0xe2b): undefined reference to `debugfs__mount', not defined anywhere
+	#tools/net/bpf_jit_disasm.c # /usr/include/x86_64-pc-linux-gnu/bfd.h:35:2: error: #error config.h must be included before this header
+)
+# tools/vm/page-types.c - broken, header path issue
+# tools/hv/hv_kvp_daemon.c - broken in 3.7 by missing linux/hyperv.h userspace
+# Documentation/networking/ifenslave.c - obsolete
+# Documentation/ptp/testptp.c - pending linux-headers-3.0
+
+# These have a broken make install, no DESTDIR
+TARGET_MAKE_SIMPLE=(
+	Documentation/misc-devices/mei:mei-amt-version
+	tools/firewire:nosy-dump
+	tools/iio:generic_buffer
+	tools/iio:iio_event_monitor
+	tools/iio:lsiio
+	tools/power/x86/turbostat:turbostat
+	tools/power/x86/x86_energy_perf_policy:x86_energy_perf_policy
+	tools/thermal/tmon:tmon
+)
+# tools/perf - covered by dev-utils/perf
+# tools/usb - testcases only
+# tools/virtio - testcaes only
+
+	#for _pattern in {Documentation,scripts,tools,usr,include,lib,"arch/*/include",Makefile,Kbuild,Kconfig}; do
+src_unpack() {
+	unpack ${LINUX_SOURCES}
+
+	MY_A=
+	for _AFILE in ${A}; do
+		[[ ${_AFILE} == ${LINUX_SOURCES} ]] && continue
+		[[ ${_AFILE} == ${LINUX_PATCH} ]] && continue
+		MY_A="${MY_A} ${_AFILE}"
+	done
+	[[ -n ${MY_A} ]] && unpack ${MY_A}
+}
+
+src_prepare() {
+	if [[ -n ${LINUX_PATCH} ]]; then
+		epatch "${DISTDIR}"/${LINUX_PATCH}
+	fi
+
+	pushd tools/usb/usbip/ >/dev/null &&
+	sed -i 's/-Werror[^ ]* //g' configure.ac &&
+	eautoreconf -i -f -v &&
+	popd >/dev/null || die "usbip"
+
+	sed -i \
+		-e '/^nosy-dump.*LDFLAGS/d' \
+		-e '/^nosy-dump.*CFLAGS/d' \
+		-e '/^nosy-dump.*CPPFLAGS/s,CPPFLAGS =,CPPFLAGS +=,g' \
+		"${S}"/tools/firewire/Makefile
+}
+
+kernel_asm_arch() {
+	a="${1:${ARCH}}"
+	case ${a} in
+		# Merged arches
+		x86|amd64) echo x86 ;;
+		ppc*) echo powerpc ;;
+		# Non-merged
+		alpha|arm|ia64|m68k|mips|sh|sparc*) echo ${1} ;;
+		*) die "TODO: Update the code for your asm-ARCH symlink" ;;
+	esac
+}
+
+src_configure() {
+	if use usbip; then
+		pushd tools/usb/usbip/ || die
+		econf \
+			$(use_enable static-libs static) \
+			$(use tcpd || echo --without-tcp-wrappers) \
+			--with-usbids-dir=/usr/share/misc
+		popd
+	fi
+}
+
+src_compile() {
+	local karch=$(kernel_asm_arch "${ARCH}")
+	# This is the minimal amount needed to start building host binaries.
+	#emake allmodconfig ARCH=${karch}
+	#emake prepare modules_prepare ARCH=${karch}
+	#touch Module.symvers
+
+	# Now we can start building
+	append-cflags -I./tools/lib
+	for s in ${TARGETS_SIMPLE[@]} ; do
+		dir=$(dirname $s) src=$(basename $s) bin=${src%.c}
+		einfo "Building $s => $bin"
+		emake -f /dev/null M=${dir} ARCH=${karch} ${s%.c}
+	done
+
+	for t in ${TARGET_MAKE_SIMPLE[@]} ; do
+		dir=${t/:*} target_binfile=${t#*:}
+		target=${target_binfile/:*} binfile=${target_binfile/*:}
+		[ -z "${binfile}" ] && binfile=$target
+		einfo "Building $dir => $binfile (via emake $target)"
+		emake -C $dir ARCH=${karch} $target
+	done
+
+	if use usbip; then
+		emake -C tools/usb/usbip
+	fi
+}
+
+src_install() {
+	into /usr
+	for s in ${TARGETS_SIMPLE[@]} ; do
+		dir=$(dirname $s) src=$(basename $s) bin=${src%.c}
+		einfo "Installing $s => $bin"
+		dosbin ${dir}/${bin}
+	done
+
+	for t in ${TARGET_MAKE_SIMPLE[@]} ; do
+		dir=${t/:*} target_binfile=${t#*:}
+		target=${target_binfile/:*} binfile=${target_binfile/*:}
+		[ -z "${binfile}" ] && binfile=$target
+		einfo "Installing $dir => $binfile"
+		dosbin ${dir}/${binfile}
+	done
+
+	if use usbip; then
+		pushd tools/usb/usbip/ >/dev/null || die "usbip"
+		emake DESTDIR="${D}" install
+		newdoc README README.usbip
+		newdoc AUTHORS AUTHORS.usbip
+		popd >/dev/null
+		dodoc drivers/usb/usbip/usbip_protocol.txt
+	fi
+
+	mv -f "${D}"/usr/sbin/{,iio_}generic_buffer
+
+	newconfd "${FILESDIR}"/freefall.confd freefall
+	newinitd "${FILESDIR}"/freefall.initd freefall
+	prune_libtool_files
+}
+
+pkg_postinst() {
+	echo
+	elog "The cpupower utility is maintained separately at sys-power/cpupower"
+	elog "The lguest utility no longer builds, and has been dropped."
+	elog "The hpfall tool has been renamed by upstream to freefall; update your config if needed"
+	if find /etc/runlevels/ -name hpfall ; then
+		ewarn "You must change hpfall to freefall in your runlevels!"
+	fi
+	if use usbip; then
+		elog "For using USB/IP you need to enable USBIP_VHCI_HCD in the client"
+		elog "machine's kernel config and USBIP_HOST on the server."
+	fi
+}

diff --git a/sys-apps/linux-misc-apps/metadata.xml b/sys-apps/linux-misc-apps/metadata.xml
index 79d462e..8ac62c3 100644
--- a/sys-apps/linux-misc-apps/metadata.xml
+++ b/sys-apps/linux-misc-apps/metadata.xml
@@ -4,4 +4,7 @@
 <maintainer type="person">
   <email>robbat2@gentoo.org</email>
 </maintainer>
+<use>
+  <flag name="usbip">Include USB/IP binaries to replace <pkg>net-misc/usbip</pkg></flag>
+</use>
 </pkgmetadata>


             reply	other threads:[~2016-03-11  0:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11  0:46 Robin H. Johnson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-28 20:08 [gentoo-commits] repo/gentoo:master commit in: sys-apps/linux-misc-apps/ Mike Gilbert
2021-04-07  5:24 Sam James
2021-04-03 15:44 Sam James
2021-03-09  9:44 Sam James
2021-03-03 17:40 Sam James
2021-03-03 17:40 Sam James
2020-09-24 20:22 Aaron Bauman
2020-09-24 19:31 Robin H. Johnson
2020-04-17 18:43 Robin H. Johnson
2020-04-17 17:26 Robin H. Johnson
2019-10-05 18:55 Michał Górny
2018-11-27 21:17 Robin H. Johnson
2018-10-31 22:21 Robin H. Johnson
2016-03-11  0:32 Robin H. Johnson
2016-03-10 16:11 Robin H. Johnson
2015-08-22 20:41 Robin H. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457657174.b7ab966eb928cdeb495174f9144069bec8a3d27f.robbat2@gentoo \
    --to=robbat2@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox