From a7ebaf2684065a20680d9842827def22037377fd Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 13 Jun 2016 00:21:42 +0100 Subject: [PATCH] Add support for the nopython build profile, disabling the linux-perf package Currently we build-depend on the native python (via asciidoc), and on the host python (via python-dev). As these are not coinstallable it is impossible to perform a complete cross-build. Until that's resolved, this will allow cross-building of most of the package with the combination of the 'cross' and 'nopython' profiles. (This also sidesteps the issue of perf wanting a multilib compiler.) --- debian/README.source | 2 ++ debian/changelog | 1 + debian/rules.d/tools/perf/Makefile | 4 ++++ debian/rules.real | 4 +++- debian/templates/control.source.in | 24 ++++++++++++------------ debian/templates/control.tools.in | 2 +- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/debian/README.source b/debian/README.source index 17b4366c6..92225ca1e 100644 --- a/debian/README.source +++ b/debian/README.source @@ -236,3 +236,5 @@ Several build profiles are understood and supported: - cross: Needed when cross-building. Currently this must be used together with pkg.linux.notools as not all the userland tools can be cross-built. +- nopython: Disable Python bindings. This currently disables building the + linux-perf- package, as the perf program embeds Python. diff --git a/debian/changelog b/debian/changelog index d27a266ef..16229b6ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,7 @@ linux (4.7~rc2-1~exp1) UNRELEASED; urgency=medium * linux-cpupower: Define PACKAGE_BUGREPORT to refer to reportbug, not upstream * debian/README.source: Document the supported build profiles * debian/control: Fix build-dependencies for cross-building + * Add support for the nopython build profile, disabling the linux-perf package -- Ben Hutchings Tue, 07 Jun 2016 19:37:55 +0100 diff --git a/debian/rules.d/tools/perf/Makefile b/debian/rules.d/tools/perf/Makefile index fc964144c..1bf415e08 100644 --- a/debian/rules.d/tools/perf/Makefile +++ b/debian/rules.d/tools/perf/Makefile @@ -1,5 +1,7 @@ include $(top_rulesdir)/Makefile.inc +ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),) + DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) ifeq ($(DEB_HOST_ARCH_CPU),alpha) @@ -74,3 +76,5 @@ endif rmdir --ignore-fail-on-non-empty $(DESTDIR)/etc # Check for unversioned files that are likely to result in file conflicts ! find $(DESTDIR) -name '*perf*' \! -path '*[_-]$(VERSION)*' | grep . + +endif # !nopython diff --git a/debian/rules.real b/debian/rules.real index f828d3c2c..f90edf703 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -75,7 +75,9 @@ ifneq ($(DO_TOOLS),False) build-arch-arch: $(STAMPS_DIR)/build-tools binary-arch-arch: install-kbuild install-usbip install-liblockdep install-cpupower ifneq ($(filter alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64,$(DEB_BUILD_ARCH)),) - binary-arch-arch: install-perf + ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),) + binary-arch-arch: install-perf + endif endif ifneq ($(filter i386 amd64 x32,$(DEB_BUILD_ARCH)),) binary-arch-arch: install-hyperv-daemons diff --git a/debian/templates/control.source.in b/debian/templates/control.source.in index cf4af3658..2fdb34e65 100644 --- a/debian/templates/control.source.in +++ b/debian/templates/control.source.in @@ -26,18 +26,18 @@ Build-Depends: asciidoc , xmlto , # used by upstream to build perf - bison , - flex:native , - gcc-multilib [amd64 ppc64 s390x sparc64] , - libaudit-dev , - libdw-dev , - libelf-dev , - libiberty-dev , - libnewt-dev , - libnuma-dev [amd64 arm64 hppa i386 mips mips64 mips64el mipsel mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el powerpc powerpcspe ppc64 ppc64el sparc x32] , - libperl-dev , - libunwind8-dev [amd64 armel armhf arm64 i386] , - python-dev , + bison , + flex:native , + gcc-multilib [amd64 ppc64 s390x sparc64] , + libaudit-dev , + libdw-dev , + libelf-dev , + libiberty-dev , + libnewt-dev , + libnuma-dev [amd64 arm64 hppa i386 mips mips64 mips64el mipsel mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el powerpc powerpcspe ppc64 ppc64el sparc x32] , + libperl-dev , + libunwind8-dev [amd64 armel armhf arm64 i386] , + python-dev , # used by upstream to build usbip autoconf , automake , diff --git a/debian/templates/control.tools.in b/debian/templates/control.tools.in index 2bc86b166..286b81f34 100644 --- a/debian/templates/control.tools.in +++ b/debian/templates/control.tools.in @@ -39,7 +39,7 @@ Description: CPU frequency and voltage scaling tools for Linux (development file This package contains the 'power/cpupower' headers and library shared objects. Package: linux-perf-@version@ -Build-Profiles: +Build-Profiles: Section: devel Architecture: alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64 Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, ${python:Depends}