Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/7] Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs
@ 2015-07-11 14:15 Luca Ceresoli
  2015-07-11 14:15 ` [Buildroot] [PATCH 2/7] docs/manual: document <PKG>_STRIP_COMPONENTS Luca Ceresoli
                   ` (9 more replies)
  0 siblings, 10 replies; 23+ messages in thread
From: Luca Ceresoli @ 2015-07-11 14:15 UTC (permalink / raw)
  To: buildroot

Usually package tarballs contain only a directory named
"<pkg-name>-<pkg-version>" which contains the actual source tree. To properly
extract the source files in $(BUILD_DIR), Buildroot passes the
--strip-components=1 option to tar.

Unfortunately a few packages ship in a non-standard way, with no root
directory or with more than one. In Buildroot these packages must be handled by
overriding the <PKG>_DOWNLOAD_CMDS.

As the number of such packages is growing, introduce a <PKG>_STRIP_COMPONENTS
variable for packages to request a number of components to strip different
from 1.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
 package/pkg-generic.mk | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 9fe01b8d4d12..8aad1b4acc23 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -322,6 +322,14 @@ ifndef $(2)_SUBDIR
  endif
 endif
 
+ifndef $(2)_STRIP_COMPONENTS
+ ifdef $(3)_STRIP_COMPONENTS
+  $(2)_STRIP_COMPONENTS = $$($(3)_STRIP_COMPONENTS)
+ else
+  $(2)_STRIP_COMPONENTS ?= 1
+ endif
+endif
+
 $(2)_SRCDIR		       = $$($(2)_DIR)/$$($(2)_SUBDIR)
 $(2)_BUILDDIR		       ?= $$($(2)_SRCDIR)
 
@@ -431,7 +439,7 @@ $(2)_TARGET_DIRCLEAN =		$$($(2)_DIR)/.stamp_dircleaned
 # default extract command
 $(2)_EXTRACT_CMDS ?= \
 	$$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \
-	$$(TAR) $$(TAR_STRIP_COMPONENTS)=1 -C $$($(2)_DIR) $$(TAR_OPTIONS) -)
+	$$(TAR) $$(TAR_STRIP_COMPONENTS)=$$($(2)_STRIP_COMPONENTS) -C $$($(2)_DIR) $$(TAR_OPTIONS) -)
 
 # pre/post-steps hooks
 $(2)_PRE_DOWNLOAD_HOOKS         ?=
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2015-07-12 14:26 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-11 14:15 [Buildroot] [PATCH 1/7] Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs Luca Ceresoli
2015-07-11 14:15 ` [Buildroot] [PATCH 2/7] docs/manual: document <PKG>_STRIP_COMPONENTS Luca Ceresoli
2015-07-11 22:29   ` Arnout Vandecappelle
2015-07-11 14:15 ` [Buildroot] [PATCH 3/7] intel-microcode: use <PKG>_STRIP_COMPONENTS Luca Ceresoli
2015-07-11 22:30   ` Arnout Vandecappelle
2015-07-11 14:15 ` [Buildroot] [PATCH 4/7] nanocom: " Luca Ceresoli
2015-07-11 22:30   ` Arnout Vandecappelle
2015-07-11 14:15 ` [Buildroot] [PATCH 5/7] tzdata: " Luca Ceresoli
2015-07-11 22:36   ` Arnout Vandecappelle
2015-07-12 12:22   ` Arnout Vandecappelle
2015-07-11 14:15 ` [Buildroot] [PATCH 6/7] zic: " Luca Ceresoli
2015-07-11 22:40   ` Arnout Vandecappelle
2015-07-11 14:15 ` [Buildroot] [PATCH 7/7] qpid-proton: new package Luca Ceresoli
2015-07-11 14:20   ` Luca Ceresoli
2015-07-11 23:22   ` Arnout Vandecappelle
2015-07-12 13:34     ` Luca Ceresoli
2015-07-12 12:41   ` Thomas Petazzoni
2015-07-11 22:28 ` [Buildroot] [PATCH 1/7] Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs Arnout Vandecappelle
2015-07-11 22:52 ` Thomas Petazzoni
2015-07-11 22:56 ` Arnout Vandecappelle
2015-07-12 14:26   ` Luca Ceresoli
2015-07-12 11:44 ` Thomas Petazzoni
2015-07-12 13:30   ` Luca Ceresoli

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