Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Allan W. Nielsen <a@awn.dk>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands
Date: Tue, 10 May 2011 08:17:04 +0200	[thread overview]
Message-ID: <1305008226-8906-2-git-send-email-a@awn.dk> (raw)
In-Reply-To: <1305008226-8906-1-git-send-email-a@awn.dk>

When using GENTARGETS (or macroes depending on it), there is no way of
specifying a custom extraction procedure. When using the patch one can
simply define $(PACKAGE_NAME)_EXTRACT_CMDS which will override the
default. If non is defined it will fall back to the default extract
procedure.

An example could look like this:

--- PACKAGE BEGIN ---
FGLRX_VERSION=11-3
FGLRX_SOURCE:=ati-driver-installer-$(FGLRX_VERSION)-x86.x86_64.run
FGLRX_SITE:=http://www2.ati.com/drivers/linux/

define FGLRX_EXTRACT_CMDS
	sh $(DL_DIR)/$(FGLRX_SOURCE) --extract $(@D)
endef

$(eval $(call GENTARGETS,package,fglrx))
--- PACKAGE END ---

Signed-off-by: Allan W. Nielsen <a@awn.dk>
---
 package/Makefile.package.in |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index bf4e1b4..e5dafd1 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -239,9 +239,17 @@ ifeq ($(DL_MODE),DOWNLOAD)
 	$(Q)touch $@
 endif
 
-# Unpack the archive
+# Unpack the archive using custom commands
+$(BUILD_DIR)/%/.stamp_custom_extracted:
+	@$(call MESSAGE,"Extracting - custom")
+	$(Q)mkdir -p $(@D)
+	$($(PKG)_EXTRACT_CMDS)
+	$(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
+	$(Q)touch $@
+
+# Unpack the archive using default commands
 $(BUILD_DIR)/%/.stamp_extracted:
-	@$(call MESSAGE,"Extracting")
+	@$(call MESSAGE,"Extracting - default")
 	$(Q)mkdir -p $(@D)
 	$(Q)$(if $($(PKG)_SOURCE),$(INFLATE$(suffix $($(PKG)_SOURCE))) $(DL_DIR)/$($(PKG)_SOURCE) | \
 	$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -)
@@ -419,7 +427,13 @@ $(2)_TARGET_INSTALL_HOST =      $$($(2)_DIR)/.stamp_host_installed
 $(2)_TARGET_BUILD =		$$($(2)_DIR)/.stamp_built
 $(2)_TARGET_CONFIGURE =		$$($(2)_DIR)/.stamp_configured
 $(2)_TARGET_PATCH =		$$($(2)_DIR)/.stamp_patched
+
+ifdef $(2)_EXTRACT_CMDS
+$(2)_TARGET_EXTRACT =		$$($(2)_DIR)/.stamp_custom_extracted
+else
 $(2)_TARGET_EXTRACT =		$$($(2)_DIR)/.stamp_extracted
+endif
+
 $(2)_TARGET_SOURCE =		$$($(2)_DIR)/.stamp_downloaded
 $(2)_TARGET_UNINSTALL =		$$($(2)_DIR)/.stamp_uninstalled
 $(2)_TARGET_CLEAN =		$$($(2)_DIR)/.stamp_cleaned
-- 
1.7.3.4

  reply	other threads:[~2011-05-10  6:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10  6:17 [Buildroot] Minor updates to Makefile.package.in Allan W. Nielsen
2011-05-10  6:17 ` Allan W. Nielsen [this message]
2011-05-10  7:08   ` [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands Daniel Nyström
2011-05-10  7:16   ` Thomas Petazzoni
     [not found]     ` <BANLkTi=HirqhyL4uuuBWnUoKu36xGE+V2g@mail.gmail.com>
2011-05-10  9:03       ` Thomas Petazzoni
2011-05-10  6:17 ` [Buildroot] [PATCH 2/3] Makefile.package.in: Added LZMA as compression type Allan W. Nielsen
2011-05-10  6:52   ` Thomas Petazzoni
2011-07-12 21:15   ` Peter Korsgaard
2011-05-10  6:17 ` [Buildroot] [PATCH 3/3] Makefile.package.in: Fixing git download method Allan W. Nielsen
2011-05-10  6:53   ` Thomas Petazzoni
     [not found]     ` <BANLkTinQcHkTmHoq9ci_QYgaj8vAqZ07yQ@mail.gmail.com>
2011-05-10  7:36       ` Thomas Petazzoni

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=1305008226-8906-2-git-send-email-a@awn.dk \
    --to=a@awn.dk \
    --cc=buildroot@busybox.net \
    /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