Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] Resubmit converted gentargets
@ 2010-10-05 20:04 Martin Banky
  2010-10-05 20:04 ` [Buildroot] [PATCH 1/2] input-tools: convert to gentargets Martin Banky
  2010-10-05 20:04 ` [Buildroot] [PATCH 2/2] mii-diag: convert to gentargets and bump to 2.11.3 Martin Banky
  0 siblings, 2 replies; 5+ messages in thread
From: Martin Banky @ 2010-10-05 20:04 UTC (permalink / raw)
  To: buildroot

As Thomas pointed out, gentargets can use post patch hooks. I've changed these
two packages to apply the debian patches in the post patch hooks.

[PATCH 1/2] input-tools: convert to gentargets
[PATCH 2/2] mii-diag: convert to gentargets and bump to 2.11.3

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

* [Buildroot] [PATCH 1/2] input-tools: convert to gentargets
  2010-10-05 20:04 [Buildroot] [PATCH 0/2] Resubmit converted gentargets Martin Banky
@ 2010-10-05 20:04 ` Martin Banky
  2010-12-11 10:25   ` Thomas Petazzoni
  2010-10-05 20:04 ` [Buildroot] [PATCH 2/2] mii-diag: convert to gentargets and bump to 2.11.3 Martin Banky
  1 sibling, 1 reply; 5+ messages in thread
From: Martin Banky @ 2010-10-05 20:04 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Martin Banky <Martin.Banky@gmail.com>
---
 .../input-tools/input-tools-20051019-rint.patch    |   18 ++++
 package/input-tools/input-tools.mk                 |   88 ++++++++-----------
 package/input-tools/joystick-20051019-rint.patch   |   18 ----
 3 files changed, 55 insertions(+), 69 deletions(-)
 create mode 100644 package/input-tools/input-tools-20051019-rint.patch
 delete mode 100644 package/input-tools/joystick-20051019-rint.patch

diff --git a/package/input-tools/input-tools-20051019-rint.patch b/package/input-tools/input-tools-20051019-rint.patch
new file mode 100644
index 0000000..b2aa13f
--- /dev/null
+++ b/package/input-tools/input-tools-20051019-rint.patch
@@ -0,0 +1,18 @@
+diff -urN joystick-20051019.orig/utils/jscal.c joystick-20051019/utils/jscal.c
+--- joystick-20051019.orig/utils/jscal.c	2004-10-19 09:51:52.000000000 +0200
++++ joystick-20051019/utils/jscal.c	2009-01-18 10:48:50.000000000 +0100
+@@ -141,10 +141,10 @@
+ 	c = 32767.0 / (inputs.cmin[1] - inputs.cmax[0]);
+ 	d = 32767.0 / (inputs.cmin[2] - inputs.cmax[1]);
+ 
+-	results[0] = rint(a);
+-	results[1] = rint(b);
+-	results[2] = rint(c*16384.0);
+-	results[3] = rint(d*16384.0);
++	results[0] = (int) (a + 0.5);
++	results[1] = (int) (b + 0.5);
++	results[2] = (int) (c*16384.0 + 0.5);
++	results[3] = (int) (d*16384.0 + 0.5);
+ 
+ 	return 1;
+ }
diff --git a/package/input-tools/input-tools.mk b/package/input-tools/input-tools.mk
index 9f5eb19..d4decc0 100644
--- a/package/input-tools/input-tools.mk
+++ b/package/input-tools/input-tools.mk
@@ -3,64 +3,50 @@
 # input-tools
 #
 #############################################################
+INPUT_TOOLS_VERSION = 20051019
+INPUT_TOOLS_SOURCE = joystick_$(INPUT_TOOLS_VERSION).orig.tar.gz
+INPUT_TOOLS_PATCH = joystick_$(INPUT_TOOLS_VERSION)-5.diff.gz
+INPUT_TOOLS_SITE = $(BR2_DEBIAN_MIRROR)/debian/pool/main/j/joystick/
 
-INPUT_TOOLS_VERSION:=20051019
-INPUT_TOOLS_SOURCE:=joystick_$(INPUT_TOOLS_VERSION).orig.tar.gz
-INPUT_TOOLS_PATCH:=joystick_$(INPUT_TOOLS_VERSION)-2.diff.gz
-INPUT_TOOLS_SITE:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/j/joystick/
-INPUT_TOOLS_DIR:=$(BUILD_DIR)/joystick-$(INPUT_TOOLS_VERSION).orig
-INPUT_TOOLS_CAT:=$(ZCAT)
+INPUT_TOOLS_TARGETS_$(BR2_PACKAGE_INPUT_TOOLS_EVTEST) += evtest
+INPUT_TOOLS_TARGETS_$(BR2_PACKAGE_INPUT_TOOLS_INPUTATTACH) += inputattach
+INPUT_TOOLS_TARGETS_$(BR2_PACKAGE_INPUT_TOOLS_JSCAL) += jscal
+INPUT_TOOLS_TARGETS_$(BR2_PACKAGE_INPUT_TOOLS_JSTEST) += jstest
 
-INPUT_TOOLS_TARGETS-y:=
-
-INPUT_TOOLS_TARGETS-$(BR2_PACKAGE_INPUT_TOOLS_EVTEST) += evtest
-INPUT_TOOLS_TARGETS-$(BR2_PACKAGE_INPUT_TOOLS_INPUTATTACH) += inputattach
-INPUT_TOOLS_TARGETS-$(BR2_PACKAGE_INPUT_TOOLS_JSCAL) += jscal
-INPUT_TOOLS_TARGETS-$(BR2_PACKAGE_INPUT_TOOLS_JSTEST) += jstest
-
-INPUT_TOOLS_TARGETS := $(addprefix $(TARGET_DIR)/usr/bin/, $(INPUT_TOOLS_TARGETS-y))
-INPUT_TOOLS_SOURCES := $(addprefix $(INPUT_TOOLS_DIR)/utils/, \
-	$(addsuffix .c, $(INPUT_TOOLS_TARGETS-y)))
-
-$(DL_DIR)/$(INPUT_TOOLS_SOURCE):
-	$(call DOWNLOAD,$(INPUT_TOOLS_SITE),$(@F))
-
-$(DL_DIR)/$(INPUT_TOOLS_PATCH):
-	$(call DOWNLOAD,$(INPUT_TOOLS_SITE),$(@F))
-
-$(INPUT_TOOLS_DIR)/.unpacked: $(DL_DIR)/$(INPUT_TOOLS_SOURCE) $(DL_DIR)/$(INPUT_TOOLS_PATCH)
-	$(INPUT_TOOLS_CAT) $(DL_DIR)/$(INPUT_TOOLS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
 ifneq ($(INPUT_TOOLS_PATCH),)
-	(cd $(INPUT_TOOLS_DIR) && $(INPUT_TOOLS_CAT) $(DL_DIR)/$(INPUT_TOOLS_PATCH) | patch -p1)
+define INPUT_TOOLS_DEBIAN_PATCHES
+	if [ -d $(@D)/debian/patches ]; then \
+		(cd $(@D)/debian/patches && for i in *; \
+		 do $(SED) 's,^\+\+\+ .*joystick-$(INPUT_TOOLS_VERSION)/,+++ joystick-$(INPUT_TOOLS_VERSION)/,' $$i; \
+		 done; \
+		); \
+		toolchain/patch-kernel.sh $(@D) $(@D)/debian/patches \*.patch; \
+	fi
+endef
 endif
-	toolchain/patch-kernel.sh $(INPUT_TOOLS_DIR) package/input-tools/ \*.patch
-	touch $@
-
-$(INPUT_TOOLS_SOURCES): $(INPUT_TOOLS_DIR)/.unpacked
 
-$(INPUT_TOOLS_DIR)/utils/%: $(INPUT_TOOLS_DIR)/utils/%.c
-	$(TARGET_CC) $(TARGET_CFLAGS) -o $@ $^
+INPUT_TOOLS_POST_PATCH_HOOKS = INPUT_TOOLS_DEBIAN_PATCHES
 
-$(INPUT_TOOLS_TARGETS): $(TARGET_DIR)/usr/bin/%: $(INPUT_TOOLS_DIR)/utils/%
-	cp -dpf $^ $@
-	$(STRIPCMD) $(STRIP_STRIP_ALL) $@
+define INPUT_TOOLS_BUILD_CMDS
+	(cd $(@D)/utils; \
+		$(TARGET_CC) $(TARGET_CFLAGS) -o evtest evtest.c; \
+		$(TARGET_CC) $(TARGET_CFLAGS) -o inputattach inputattach.c; \
+		$(TARGET_CC) $(TARGET_CFLAGS) -o jscal jscal.c; \
+		$(TARGET_CC) $(TARGET_CFLAGS) -o jstest jstest.c; \
+	)
+endef
 
-input-tools: $(INPUT_TOOLS_TARGETS)
+define INPUT_TOOLS_INSTALL_TARGET_CMDS
+	test -z "$(INPUT_TOOLS_TARGETS_y)" || \
+	install -m 755 $(addprefix $(@D)/utils/,$(INPUT_TOOLS_TARGETS_y)) $(TARGET_DIR)/usr/bin/
+endef
 
-input-tools-source: $(DL_DIR)/$(INPUT_TOOLS_SOURCE) $(DL_DIR)/$(INPUT_TOOLS_PATCH)
+define INPUT_TOOLS_UNINSTALL_TARGET_CMDS
+	rm -f $(addprefix $(TARGET_DIR)/usr/bin/,$(INPUT_TOOLS_TARGETS_y))
+endef
 
-input-tools-unpacked: $(INPUT_TOOLS_DIR)/.unpacked
+define INPUT_TOOLS_CLEAN_CMDS
+	rm -f $(addprefix $(@D)/utils/,$(INPUT_TOOLS_TARGETS_y))
+endef
 
-input-tools-clean:
-	rm -f $(INPUT_TOOLS_TARGETS)
-
-input-tools-dirclean:
-	rm -rf $(INPUT_TOOLS_DIR)
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_INPUT_TOOLS),y)
-TARGETS+=input-tools
-endif
+$(eval $(call GENTARGETS,package,input-tools))
diff --git a/package/input-tools/joystick-20051019-rint.patch b/package/input-tools/joystick-20051019-rint.patch
deleted file mode 100644
index b2aa13f..0000000
--- a/package/input-tools/joystick-20051019-rint.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff -urN joystick-20051019.orig/utils/jscal.c joystick-20051019/utils/jscal.c
---- joystick-20051019.orig/utils/jscal.c	2004-10-19 09:51:52.000000000 +0200
-+++ joystick-20051019/utils/jscal.c	2009-01-18 10:48:50.000000000 +0100
-@@ -141,10 +141,10 @@
- 	c = 32767.0 / (inputs.cmin[1] - inputs.cmax[0]);
- 	d = 32767.0 / (inputs.cmin[2] - inputs.cmax[1]);
- 
--	results[0] = rint(a);
--	results[1] = rint(b);
--	results[2] = rint(c*16384.0);
--	results[3] = rint(d*16384.0);
-+	results[0] = (int) (a + 0.5);
-+	results[1] = (int) (b + 0.5);
-+	results[2] = (int) (c*16384.0 + 0.5);
-+	results[3] = (int) (d*16384.0 + 0.5);
- 
- 	return 1;
- }
-- 
1.7.3.1

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

* [Buildroot] [PATCH 2/2] mii-diag: convert to gentargets and bump to 2.11.3
  2010-10-05 20:04 [Buildroot] [PATCH 0/2] Resubmit converted gentargets Martin Banky
  2010-10-05 20:04 ` [Buildroot] [PATCH 1/2] input-tools: convert to gentargets Martin Banky
@ 2010-10-05 20:04 ` Martin Banky
  2010-12-11 10:37   ` Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Martin Banky @ 2010-10-05 20:04 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Martin Banky <Martin.Banky@gmail.com>
---
 package/mii-diag/mii-diag.mk |   79 ++++++++++++++++--------------------------
 1 files changed, 30 insertions(+), 49 deletions(-)

diff --git a/package/mii-diag/mii-diag.mk b/package/mii-diag/mii-diag.mk
index ba01c0e..8d946ae 100644
--- a/package/mii-diag/mii-diag.mk
+++ b/package/mii-diag/mii-diag.mk
@@ -3,59 +3,40 @@
 # mii-diag
 #
 #############################################################
-MIIDIAG_VERSION:=2.11
-MIIDIAG_DEBIAN_PATCH_LEVEL:=2
-MIIDIAG_SOURCE:=mii-diag_$(MIIDIAG_VERSION).orig.tar.gz
-MIIDIAG_PATCH_FILE=mii-diag_$(MIIDIAG_VERSION)-$(MIIDIAG_DEBIAN_PATCH_LEVEL).diff.gz
-MIIDIAG_SITE:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/m/mii-diag
-MIIDIAG_DIR:=$(BUILD_DIR)/mii-diag-$(MIIDIAG_VERSION)
-MIIDIAG_CAT:=$(ZCAT)
-MIIDIAG_BINARY:=usr/sbin/mii-diag
-
-ifneq ($(MIIDIAG_PATCH_FILE),)
-MIIDIAG_PATCH=$(DL_DIR)/$(MIIDIAG_PATCH_FILE)
-$(MIIDIAG_PATCH):
-	$(call DOWNLOAD,$(MIIDIAG_SITE),$(MIIDIAG_PATCH_FILE))
-endif
-
-$(DL_DIR)/$(MIIDIAG_SOURCE):
-	$(call DOWNLOAD,$(MIIDIAG_SITE),$(MIIDIAG_SOURCE))
-
-$(MIIDIAG_DIR)/.unpacked: $(DL_DIR)/$(MIIDIAG_SOURCE) $(MIIDIAG_PATCH)
-	mkdir -p $(MIIDIAG_DIR)
-	$(MIIDIAG_CAT) $(DL_DIR)/$(MIIDIAG_SOURCE) | tar --strip 1 -C $(MIIDIAG_DIR) $(TAR_OPTIONS) -
-ifneq ($(MIIDIAG_PATCH_FILE),)
-	(cd $(MIIDIAG_DIR) && $(MIIDIAG_CAT) $(MIIDIAG_PATCH) | patch -p1)
+MII_DIAG_VERSION = 2.11
+MII_DIAG_SOURCE = mii-diag_$(MII_DIAG_VERSION).orig.tar.gz
+MII_DIAG_PATCH = mii-diag_$(MII_DIAG_VERSION)-3.diff.gz
+MII_DIAG_SITE = $(BR2_DEBIAN_MIRROR)/debian/pool/main/m/mii-diag
+
+ifneq ($(MII_DIAG_PATCH),)
+define MII_DIAG_DEBIAN_PATCHES
+	if [ -d $(@D)/debian/patches ]; then \
+		(cd $(@D)/debian/patches && for i in *; \
+		 do $(SED) 's,^\+\+\+ .*mii-diag-$(MII_DIAG_VERSION)/,+++ mii-diag-$(MII_DIAG_VERSION)/,' $$i; \
+		 done; \
+		); \
+		toolchain/patch-kernel.sh $(@D) $(@D)/debian/patches \*.patch; \
+	fi
+endef
 endif
-	toolchain/patch-kernel.sh $(MIIDIAG_DIR) package/mii-diag/ mii-diag-\*.patch*
-	touch $@
-
-$(MIIDIAG_DIR)/.configured: $(MIIDIAG_DIR)/.unpacked
-	touch $@
-
-$(MIIDIAG_DIR)/mii-diag: $(MIIDIAG_DIR)/.configured
-	$(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" -C $(MIIDIAG_DIR)
 
-$(TARGET_DIR)/$(MIIDIAG_BINARY): $(MIIDIAG_DIR)/mii-diag
-	$(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" -C $(MIIDIAG_DIR) DESTDIR=$(TARGET_DIR) install
-	$(STRIPCMD) $@
-	touch $@
+MII_DIAG_POST_PATCH_HOOKS = MII_DIAG_DEBIAN_PATCHES
 
-mii-diag: $(TARGET_DIR)/$(MIIDIAG_BINARY)
+define MII_DIAG_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \
+	LDFLAGS="$(TARGET_LDFLAGS)" -C $(@D)
+endef
 
-mii-diag-source: $(DL_DIR)/$(MIIDIAG_SOURCE) $(MIIDIAG_PATCH)
+define MII_DIAG_INSTALL_TARGET_CMDS
+	$(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
+endef
 
-mii-diag-clean:
-	-$(MAKE) -C $(MIIDIAG_DIR) clean
+define MII_DIAG_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/sbin/mii-diag
+endef
 
-mii-diag-dirclean:
-	rm -rf $(MIIDIAG_DIR)
+define MII_DIAG_CLEAN_CMDS
+	$(MAKE) -C $(@D) clean
+endef
 
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_MIIDIAG),y)
-TARGETS+=mii-diag
-endif
+$(eval $(call GENTARGETS,package,mii-diag))
-- 
1.7.3.1

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

* [Buildroot] [PATCH 1/2] input-tools: convert to gentargets
  2010-10-05 20:04 ` [Buildroot] [PATCH 1/2] input-tools: convert to gentargets Martin Banky
@ 2010-12-11 10:25   ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2010-12-11 10:25 UTC (permalink / raw)
  To: buildroot

On Tue,  5 Oct 2010 13:04:36 -0700
Martin Banky <martin.banky@gmail.com> wrote:

> Signed-off-by: Martin Banky <Martin.Banky@gmail.com>

Thanks, merged into one of my branch, for which I'll send a pull
request soon.

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] 5+ messages in thread

* [Buildroot] [PATCH 2/2] mii-diag: convert to gentargets and bump to 2.11.3
  2010-10-05 20:04 ` [Buildroot] [PATCH 2/2] mii-diag: convert to gentargets and bump to 2.11.3 Martin Banky
@ 2010-12-11 10:37   ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2010-12-11 10:37 UTC (permalink / raw)
  To: buildroot

On Tue,  5 Oct 2010 13:04:37 -0700
Martin Banky <martin.banky@gmail.com> wrote:

> Signed-off-by: Martin Banky <Martin.Banky@gmail.com>

Thanks, merged into one of my branch.

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] 5+ messages in thread

end of thread, other threads:[~2010-12-11 10:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05 20:04 [Buildroot] [PATCH 0/2] Resubmit converted gentargets Martin Banky
2010-10-05 20:04 ` [Buildroot] [PATCH 1/2] input-tools: convert to gentargets Martin Banky
2010-12-11 10:25   ` Thomas Petazzoni
2010-10-05 20:04 ` [Buildroot] [PATCH 2/2] mii-diag: convert to gentargets and bump to 2.11.3 Martin Banky
2010-12-11 10:37   ` Thomas Petazzoni

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