All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
@ 2011-05-19  6:25 a at awn.dk
  0 siblings, 0 replies; 10+ messages in thread
From: a at awn.dk @ 2011-05-19  6:25 UTC (permalink / raw)
  To: buildroot

From: Allan W. Nielsen <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:

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))

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

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index bf4e1b4..16981b7 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -243,8 +243,7 @@ endif
 $(BUILD_DIR)/%/.stamp_extracted:
 	@$(call MESSAGE,"Extracting")
 	$(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) -)
+	$($(PKG)_EXTRACT_CMDS)
 # some packages have messed up permissions inside
 	$(Q)chmod -R ug+rw $(@D)
 	$(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
@@ -425,6 +424,10 @@ $(2)_TARGET_UNINSTALL =		$$($(2)_DIR)/.stamp_uninstalled
 $(2)_TARGET_CLEAN =		$$($(2)_DIR)/.stamp_cleaned
 $(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) -)
+
 # post-steps hooks
 $(2)_POST_EXTRACT_HOOKS         ?=
 $(2)_POST_PATCH_HOOKS           ?=
-- 
1.7.3.4

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

* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
  2011-05-18 15:27         ` Thomas Petazzoni
@ 2011-05-18 16:05           ` Allan Nielsen
  0 siblings, 0 replies; 10+ messages in thread
From: Allan Nielsen @ 2011-05-18 16:05 UTC (permalink / raw)
  To: buildroot

Hi

> I'm fine with your existing proposal. Could you repost a proper patch
> with the quoting fixes, so that I can give it a test, and send my
> Acked-by ?

Sure

> Note however that we are pretty close to the 2011.05 release, so it is
> quite likely that Peter will delay such infrastructure changes until
> after the release. But that doesn't prevent us from making progress on
> it, getting my Acked-by, and therefore be on track to merge it
> post-2011.05.

No problem

--
Allan W. Nielsen

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

* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
  2011-05-18 14:39       ` Allan Nielsen
@ 2011-05-18 15:27         ` Thomas Petazzoni
  2011-05-18 16:05           ` Allan Nielsen
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2011-05-18 15:27 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 18 May 2011 16:39:42 +0200
Allan Nielsen <a@awn.dk> wrote:

> Hi Thomas
> 
> Sorry for not replaying the last couple of days, but I have been busy
> with some other concerns.
> 
> However, when I did a rebuild I did also realize the problems with the
> solution I suggested. Since then I changed the extract_cmd statement
> to also the same as you have suggested:
> 
> 430 $(2)_EXTRACT_CMDS ?= $(if $$($(2)_SOURCE),$$(INFLATE$$(suffix
> $$($(2)_SOURCE))) $(DL_DIR)/$$($(2)_SOURCE) | \
> 431 ????????$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $$($(2)_DIR)
> $(TAR_OPTIONS) -)
> 
> This solution has been working fine for me, (and it should make no
> difference if I changes it to your suggestion).

Ok.

> Anyways, I would like to know where you stand on this, do you think
> this solution to be included in buildroot or would you prefer to wait
> for a better suggestion?

I'm fine with your existing proposal. Could you repost a proper patch
with the quoting fixes, so that I can give it a test, and send my
Acked-by ?

Note however that we are pretty close to the 2011.05 release, so it is
quite likely that Peter will delay such infrastructure changes until
after the release. But that doesn't prevent us from making progress on
it, getting my Acked-by, and therefore be on track to merge it
post-2011.05.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
  2011-05-16 19:52     ` Thomas Petazzoni
@ 2011-05-18 14:39       ` Allan Nielsen
  2011-05-18 15:27         ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Allan Nielsen @ 2011-05-18 14:39 UTC (permalink / raw)
  To: buildroot

Hi Thomas

Sorry for not replaying the last couple of days, but I have been busy
with some other concerns.

However, when I did a rebuild I did also realize the problems with the
solution I suggested. Since then I changed the extract_cmd statement
to also the same as you have suggested:

430 $(2)_EXTRACT_CMDS ?= $(if $$($(2)_SOURCE),$$(INFLATE$$(suffix
$$($(2)_SOURCE))) $(DL_DIR)/$$($(2)_SOURCE) | \
431 ????????$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $$($(2)_DIR) $(TAR_OPTIONS) -)

This solution has been working fine for me, (and it should make no
difference if I changes it to your suggestion).

Anyways, I would like to know where you stand on this, do you think
this solution to be included in buildroot or would you prefer to wait
for a better suggestion?

Regards


On Mon, May 16, 2011 at 9:52 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello Allan,
>
> On Tue, 10 May 2011 20:43:32 +0200
> Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
>
>> > +# 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) -)
>>
>> Hm, this is not some nice. I'm currently testing your patch, I'll see
>> if I find a better way of writing this.
>
> I haven't really searched a better way of writing this, but I've used
> your patch and found some problem with it. It does not quote
> sufficiently the variables, so things break with host packages.
>
> I have been able to get things working with:
>
> diff --git a/package/Makefile.package.in b/package/Makefile.package.in
> index 9949b58..0a4c220 100644
> --- a/package/Makefile.package.in
> +++ b/package/Makefile.package.in
> @@ -425,7 +425,8 @@ $(2)_TARGET_CLEAN = ? ? ? ? $$($(2)_DIR)/.stamp_cleaned
> ?$(2)_TARGET_DIRCLEAN = ? ? ? ? $$($(2)_DIR)/.stamp_dircleaned
>
> ?# default extract command
> -$(2)_EXTRACT_CMDS ?= $(if $($(2)_SOURCE),$(INFLATE$(suffix $($(2)_SOURCE))) $(DL_DIR)/$($(2)_SOURCE) | \
> +$(2)_EXTRACT_CMDS ?= \
> + ? ? ? $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $(DL_DIR)/$$($(2)_SOURCE) | \
> ? ? ? ?$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $$($(2)_DIR) $(TAR_OPTIONS)
> ? ? ? ?-)
>
> On top of what you did.
>
> Regards,
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>

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

* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
  2011-05-10 18:43   ` Thomas Petazzoni
@ 2011-05-16 19:52     ` Thomas Petazzoni
  2011-05-18 14:39       ` Allan Nielsen
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2011-05-16 19:52 UTC (permalink / raw)
  To: buildroot

Hello Allan,

On Tue, 10 May 2011 20:43:32 +0200
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> > +# 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) -)
> 
> Hm, this is not some nice. I'm currently testing your patch, I'll see
> if I find a better way of writing this.

I haven't really searched a better way of writing this, but I've used
your patch and found some problem with it. It does not quote
sufficiently the variables, so things break with host packages.

I have been able to get things working with:

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index 9949b58..0a4c220 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -425,7 +425,8 @@ $(2)_TARGET_CLEAN =         $$($(2)_DIR)/.stamp_cleaned
 $(2)_TARGET_DIRCLEAN =         $$($(2)_DIR)/.stamp_dircleaned
 
 # default extract command
-$(2)_EXTRACT_CMDS ?= $(if $($(2)_SOURCE),$(INFLATE$(suffix $($(2)_SOURCE))) $(DL_DIR)/$($(2)_SOURCE) | \
+$(2)_EXTRACT_CMDS ?= \
+       $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $(DL_DIR)/$$($(2)_SOURCE) | \
        $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $$($(2)_DIR) $(TAR_OPTIONS)
        -)

On top of what you did.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
  2011-05-10 11:34 ` [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
@ 2011-05-10 18:43   ` Thomas Petazzoni
  2011-05-16 19:52     ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2011-05-10 18:43 UTC (permalink / raw)
  To: buildroot

Hello Allan,

On Tue, 10 May 2011 13:34:14 +0200
"Allan W. Nielsen" <a@awn.dk> wrote:

> --- PACKAGE BEGIN ---

Please don't use --- at the beginning of a line in your commit message.
Git believes that the rest of the message shouldn't be included in the
commit message when applying your patch.

> +# 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) -)

Hm, this is not some nice. I'm currently testing your patch, I'll see
if I find a better way of writing this.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
  2011-05-10 11:34 [Buildroot] Custom extract command agian agian Allan W. Nielsen
@ 2011-05-10 11:34 ` Allan W. Nielsen
  2011-05-10 18:43   ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Allan W. Nielsen @ 2011-05-10 11:34 UTC (permalink / raw)
  To: buildroot

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 |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index bf4e1b4..9949b58 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -243,8 +243,7 @@ endif
 $(BUILD_DIR)/%/.stamp_extracted:
 	@$(call MESSAGE,"Extracting")
 	$(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) -)
+	$($(PKG)_EXTRACT_CMDS)
 # some packages have messed up permissions inside
 	$(Q)chmod -R ug+rw $(@D)
 	$(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
@@ -425,6 +424,10 @@ $(2)_TARGET_UNINSTALL =		$$($(2)_DIR)/.stamp_uninstalled
 $(2)_TARGET_CLEAN =		$$($(2)_DIR)/.stamp_cleaned
 $(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) -)
+
 # post-steps hooks
 $(2)_POST_EXTRACT_HOOKS         ?=
 $(2)_POST_PATCH_HOOKS           ?=
-- 
1.7.3.4

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

* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
  2011-05-10  9:58 [Buildroot] Custom extract command again Allan W. Nielsen
@ 2011-05-10  9:58 ` Allan W. Nielsen
  0 siblings, 0 replies; 10+ messages in thread
From: Allan W. Nielsen @ 2011-05-10  9:58 UTC (permalink / raw)
  To: buildroot

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 |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index bf4e1b4..d308c33 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -84,6 +84,12 @@ ifeq ($(DL_DIR),)
 DL_DIR:=$(TOPDIR)/dl
 endif
 
+# Default extract command to be used
+define DEFAULT_EXTRACT_COMMENT
+	$(Q)$(if $($(PKG)_SOURCE),$(INFLATE$(suffix $($(PKG)_SOURCE))) $(DL_DIR)/$($(PKG)_SOURCE) | \
+	$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -)
+endef
+
 ################################################################################
 # The DOWNLOAD_{GIT,SVN,BZR} helpers are in charge of getting a
 # working copy of the source repository for their corresponding SCM,
@@ -243,8 +249,7 @@ endif
 $(BUILD_DIR)/%/.stamp_extracted:
 	@$(call MESSAGE,"Extracting")
 	$(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) -)
+	$($(PKG)_EXTRACT_CMDS)
 # some packages have messed up permissions inside
 	$(Q)chmod -R ug+rw $(@D)
 	$(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
@@ -425,6 +430,9 @@ $(2)_TARGET_UNINSTALL =		$$($(2)_DIR)/.stamp_uninstalled
 $(2)_TARGET_CLEAN =		$$($(2)_DIR)/.stamp_cleaned
 $(2)_TARGET_DIRCLEAN =		$$($(2)_DIR)/.stamp_dircleaned
 
+# default extract command
+$(2)_EXTRACT_CMDS ?= DEFAULT_EXTRACT_COMMENT
+
 # post-steps hooks
 $(2)_POST_EXTRACT_HOOKS         ?=
 $(2)_POST_PATCH_HOOKS           ?=
-- 
1.7.3.4

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

* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
  2011-05-10  9:55 [Buildroot] Custom extract command again Allan W. Nielsen
@ 2011-05-10  9:55 ` Allan W. Nielsen
  0 siblings, 0 replies; 10+ messages in thread
From: Allan W. Nielsen @ 2011-05-10  9:55 UTC (permalink / raw)
  To: buildroot

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 |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index bf4e1b4..d308c33 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -84,6 +84,12 @@ ifeq ($(DL_DIR),)
 DL_DIR:=$(TOPDIR)/dl
 endif
 
+# Default extract command to be used
+define DEFAULT_EXTRACT_COMMENT
+	$(Q)$(if $($(PKG)_SOURCE),$(INFLATE$(suffix $($(PKG)_SOURCE))) $(DL_DIR)/$($(PKG)_SOURCE) | \
+	$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -)
+endef
+
 ################################################################################
 # The DOWNLOAD_{GIT,SVN,BZR} helpers are in charge of getting a
 # working copy of the source repository for their corresponding SCM,
@@ -243,8 +249,7 @@ endif
 $(BUILD_DIR)/%/.stamp_extracted:
 	@$(call MESSAGE,"Extracting")
 	$(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) -)
+	$($(PKG)_EXTRACT_CMDS)
 # some packages have messed up permissions inside
 	$(Q)chmod -R ug+rw $(@D)
 	$(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
@@ -425,6 +430,9 @@ $(2)_TARGET_UNINSTALL =		$$($(2)_DIR)/.stamp_uninstalled
 $(2)_TARGET_CLEAN =		$$($(2)_DIR)/.stamp_cleaned
 $(2)_TARGET_DIRCLEAN =		$$($(2)_DIR)/.stamp_dircleaned
 
+# default extract command
+$(2)_EXTRACT_CMDS ?= DEFAULT_EXTRACT_COMMENT
+
 # post-steps hooks
 $(2)_POST_EXTRACT_HOOKS         ?=
 $(2)_POST_PATCH_HOOKS           ?=
-- 
1.7.3.4

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

* [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands
  2011-04-11 11:08 [Buildroot] New version of patch to provide custom extract procedures Allan W. Nielsen
@ 2011-04-11 11:08 ` Allan W. Nielsen
  0 siblings, 0 replies; 10+ messages in thread
From: Allan W. Nielsen @ 2011-04-11 11:08 UTC (permalink / raw)
  To: buildroot

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

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

end of thread, other threads:[~2011-05-19  6:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-19  6:25 [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands a at awn.dk
  -- strict thread matches above, loose matches on Subject: below --
2011-05-10 11:34 [Buildroot] Custom extract command agian agian Allan W. Nielsen
2011-05-10 11:34 ` [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
2011-05-10 18:43   ` Thomas Petazzoni
2011-05-16 19:52     ` Thomas Petazzoni
2011-05-18 14:39       ` Allan Nielsen
2011-05-18 15:27         ` Thomas Petazzoni
2011-05-18 16:05           ` Allan Nielsen
2011-05-10  9:58 [Buildroot] Custom extract command again Allan W. Nielsen
2011-05-10  9:58 ` [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
2011-05-10  9:55 [Buildroot] Custom extract command again Allan W. Nielsen
2011-05-10  9:55 ` [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
2011-04-11 11:08 [Buildroot] New version of patch to provide custom extract procedures Allan W. Nielsen
2011-04-11 11:08 ` [Buildroot] [PATCH] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.