diff mbox

qwt: new package

Message ID 1355094387-22886-6-git-send-email-s.martin49@gmail.com
State Superseded
Headers show

Commit Message

Samuel Martin Dec. 9, 2012, 11:06 p.m. UTC
Cc: Julien Boibessot <julien.boibessot@armadeus.com>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
 package/Config.in                                  |  1 +
 package/qwt/Config.in                              | 17 +++++
 .../qwt/qwt-5.2.1-change-install-directories.patch | 23 +++++++
 package/qwt/qwt-5.2.1-disable-designer.patch       | 17 +++++
 package/qwt/qwt.mk                                 | 74 ++++++++++++++++++++++
 5 files changed, 132 insertions(+)
 create mode 100644 package/qwt/Config.in
 create mode 100644 package/qwt/qwt-5.2.1-change-install-directories.patch
 create mode 100644 package/qwt/qwt-5.2.1-disable-designer.patch
 create mode 100644 package/qwt/qwt.mk

Comments

Peter Korsgaard Dec. 16, 2012, 10:08 a.m. UTC | #1
>>>>> "Samuel" == Samuel Martin <s.martin49@gmail.com> writes:

Hi,

A few comments:

 Samuel> @@ -141,6 +141,7 @@ comment "QT libraries and helper libraries"
 Samuel>  source "package/grantlee/Config.in"
 Samuel>  source "package/qextserialport/Config.in"
 Samuel>  source "package/qtuio/Config.in"
 Samuel> +source "package/qwt/Config.in"
 Samuel>  endif
 
 Samuel>  source "package/x11r7/Config.in"
 Samuel> diff --git a/package/qwt/Config.in b/package/qwt/Config.in
 Samuel> new file mode 100644
 Samuel> index 0000000..15e3925
 Samuel> --- /dev/null
 Samuel> +++ b/package/qwt/Config.in
 Samuel> @@ -0,0 +1,17 @@
 Samuel> +comment "Qwt requires Qt to be installed"
 Samuel> +	depends on !BR2_PACKAGE_QT
 Samuel> +
 Samuel> +config BR2_PACKAGE_QWT
 Samuel> +	bool "Qwt"

We normally use lower case for package name.

 Samuel> +	depends on BR2_PACKAGE_QT

The package is already within a BR2_PACKAGE_QT conditional, so you can
drop this.

Can this work with any QT configuration? I would guess you would need to
select BR2_PACKAGE_QT_GUI_MODULE atleast.

 Samuel> +	help
 Samuel> +	  Qwt for Embedded Linux.

Everything in buildroot is about embedded Linux. I would prefer if you
instead explain what Qwt means - E.G.:

Qt Widgets for Technical Applications 


 Samuel> +
 Samuel> +	  http://qwt.sourceforge.net/
 Samuel> +
 Samuel> +config BR2_PACKAGE_QWT_EXAMPLES
 Samuel> +	bool "Examples"

Lower case as well.

 Samuel> +	depends on BR2_PACKAGE_QWT
 Samuel> +	select BR2_PACKAGE_QT_SVG
 Samuel> +	help
 Samuel> +	  Compile & install the examples.
 Samuel> diff --git a/package/qwt/qwt-5.2.1-change-install-directories.patch b/package/qwt/qwt-5.2.1-change-install-directories.patch
 Samuel> new file mode 100644
 Samuel> index 0000000..4c28065
 Samuel> --- /dev/null
 Samuel> +++ b/package/qwt/qwt-5.2.1-change-install-directories.patch
 Samuel> @@ -0,0 +1,23 @@
 Samuel> +Change install directories.

Please provide a patch description explaining WHY this is done instead.


 Samuel> +
 Samuel> +Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
 Samuel> +Signed-off-by: Samuel Martin <s.martin49@gmail.com>
 Samuel> +
 Samuel> +--- qwt-5.2.1/src/src.pro.orig	2010-09-28 14:40:39.000000000 +0200
 Samuel> ++++ qwt-5.2.1/src/src.pro	2010-09-28 14:41:29.000000000 +0200
 Samuel> +@@ -218,9 +218,12 @@
 Samuel> + }
 Samuel> + 
 Samuel> + # Install directives
 Samuel> +-
 Samuel> +-headers.files  = $$HEADERS
 Samuel> +-doc.files      = $${QWT_ROOT}/doc/html $${QWT_ROOT}/doc/qwt-5.2.0.qch
 Samuel> ++
 Samuel> ++target.path = /usr/lib
 Samuel> ++headers.files  = $$HEADERS
 Samuel> ++headers.path = /usr/include/qwt-5.2.1
 Samuel> ++doc.files      = $${QWT_ROOT}/doc/html $${QWT_ROOT}/doc/qwt-5.2.0.qch
 Samuel> ++doc.path = /usr/doc/qwt-5.2.1
 Samuel> + unix {
 Samuel> +     doc.files      += $${QWT_ROOT}/doc/man
 Samuel> + }
 Samuel> diff --git a/package/qwt/qwt-5.2.1-disable-designer.patch b/package/qwt/qwt-5.2.1-disable-designer.patch
 Samuel> new file mode 100644
 Samuel> index 0000000..5d1bbe5
 Samuel> --- /dev/null
 Samuel> +++ b/package/qwt/qwt-5.2.1-disable-designer.patch
 Samuel> @@ -0,0 +1,17 @@
 Samuel> +Disable QwtDesigner.

Why?


 Samuel> +
 Samuel> +Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
 Samuel> +Signed-off-by: Samuel Martin <s.martin49@gmail.com>
 Samuel> +
 Samuel> +--- qwt-5.2.1/qwtconfig.pri.orig	2010-09-28 14:34:01.000000000 +0200
 Samuel> ++++ qwt-5.2.1/qwtconfig.pri	2010-09-28 15:37:02.000000000 +0200
 Samuel> +@@ -115,7 +115,7 @@
 Samuel> + # Otherwise you have to build it from the designer directory.
 Samuel> + ######################################################################
 Samuel> + 
 Samuel> +-CONFIG     += QwtDesigner
 Samuel> ++#CONFIG     += QwtDesigner
 Samuel> + 
 Samuel> + ######################################################################
 Samuel> + # If you want to auto build the examples, enable the line below
 Samuel> +
 Samuel> diff --git a/package/qwt/qwt.mk b/package/qwt/qwt.mk
 Samuel> new file mode 100644
 Samuel> index 0000000..3d4e7f1
 Samuel> --- /dev/null
 Samuel> +++ b/package/qwt/qwt.mk
 Samuel> @@ -0,0 +1,74 @@
 Samuel> +######################################################################
 Samuel> +#
 Samuel> +# QWT
 Samuel> +#
 Samuel> +######################################################################
 Samuel> +QWT_VERSION = 5.2.1
 Samuel> +QWT_SOURCE = qwt-$(QWT_VERSION).zip

Why not use the .tar.bz2 version instead? Upsteam is now up to 5.2.3
(and 6.0) - Any reason to use the old 5.2.1?


 Samuel> +QWT_SITE = http://sourceforge.net/projects/qwt/files/qwt/$(QWT_VERSION)

Normally the sf.net URLs are of the downloads.sourceforge.net/.. form.


 Samuel> +# Qwt License v1.0 is a LGPL v2.1 with exceptions
 Samuel> +QWT_LICENSE = QWTv1.0
 Samuel> +QWT_LICENSE_FILES = COPYING
 Samuel> +
 Samuel> +QWT_DEPENDENCIES = qt
 Samuel> +
 Samuel> +QWT_INSTALL_STAGING = YES
 Samuel> +
 Samuel> +define QWT_EXTRACT_CMDS
 Samuel> +	$(RM) -rf $(QWT_DIR)
 Samuel> +	unzip -q -d $(BUILD_DIR)/ $(DL_DIR)/$(QWT_SOURCE)
 Samuel> +	test -d $(QWT_DIR) || \
 Samuel> +		mv $(BUILD_DIR)/$(subst .zip,,$(QWT_SOURCE)) $(QWT_DIR)
 Samuel> +endef

With .tar.bz2 this could be dropped.


 Samuel> +
 Samuel> +ifeq ($(BR2_PACKAGE_QWT_EXAMPLES),y)
 Samuel> +define QWT_CONFIGURE_EXAMPLES
 Samuel> +	test ! -f $(@D)/examples/Makefile || $(MAKE) -C $(@D)/examples distclean

Hmm, we normally don't do something like this.

 Samuel> +	cd $(@D)/examples && $(QT_QMAKE)
 Samuel> +endef
 Samuel> +
 Samuel> +define QWT_BUILD_EXAMPLES
 Samuel> +	$(MAKE) -C $(@D)/examples
 Samuel> +endef
 Samuel> +
 Samuel> +define QWT_INSTALL_STAGING_EXAMPLES
 Samuel> +	$(INSTALL) -d $(STAGING_DIR)/usr/local/qwt-5.2.1/examples/bin

Why /usr/local? Please use QWT_VERSION.

Does it ever make sense to install examples into staging?

 Samuel> +	cp -f $(@D)/examples/bin/* \
 Samuel> +		$(STAGING_DIR)/usr/local/qwt-5.2.1/examples/bin
 Samuel> +endef
 Samuel> +
 Samuel> +define QWT_INSTALL_TARGET_EXAMPLES
 Samuel> +	$(INSTALL) -d $(TARGET_DIR)/usr/local/qwt-5.2.1/examples/bin
 Samuel> +	cp -f $(STAGING_DIR)/usr/local/qwt-5.2.1/examples/bin/* \
 Samuel> +		$(TARGET_DIR)/usr/local/qwt-5.2.1/examples/bin

Same comments. Why nor just install them into TARGET_DIR/usr/bin?

 Samuel> +endef
 Samuel> +endif
 Samuel> +
 Samuel> +
 Samuel> +define QWT_CONFIGURE_CMDS
 Samuel> +	test ! -f $(@D)/Makefile || $(MAKE) -C $(@D) distclean

Same comment as for CONFIGURE_EXAMPLES.

Nit: It would be more logical to list these steps in the logical order
they are used - E.G. configure -> build -> install.

 Samuel> +	cd $(@D) && $(QT_QMAKE)
 Samuel> +	$(QWT_CONFIGURE_EXAMPLES)
 Samuel> +endef
 Samuel> +
 Samuel> +define QWT_BUILD_CMDS
 Samuel> +	$(MAKE) -C $(@D)
 Samuel> +	$(QWT_BUILD_EXAMPLES)
 Samuel> +endef
 Samuel> +
 Samuel> +define QWT_INSTALL_STAGING_CMDS
 Samuel> +	$(MAKE) INSTALL_ROOT=$(STAGING_DIR) -C $(@D) install
 Samuel> +	$(QWT_INSTALL_STAGING_EXAMPLES)
 Samuel> +endef
 Samuel> +
 Samuel> +define QWT_INSTALL_TARGET_CMDS
 Samuel> +	cp -dpf $(STAGING_DIR)/usr/lib/libqwt.so* $(TARGET_DIR)/usr/lib/

Why not just make install like for staging?


 Samuel> +	$(QWT_INSTALL_TARGET_EXAMPLES)
 Samuel> +endef
 Samuel> +
 Samuel> +define QWT_CLEAN_CMDS
 Samuel> +	-$(MAKE) -C $(@D) clean
 Samuel> +	-rm $(TARGET_DIR)/usr/lib/libqwt.so.*

If we cannot clean completely (E.G. everything else installed into
staging), then I prefer just not providing a clean target.
Arnout Vandecappelle Dec. 17, 2012, 6:55 a.m. UTC | #2
On 16/12/12 11:08, Peter Korsgaard wrote:
>   Samuel>  +define QWT_CLEAN_CMDS
>   Samuel>  +	-$(MAKE) -C $(@D) clean
>   Samuel>  +	-rm $(TARGET_DIR)/usr/lib/libqwt.so.*
>
> If we cannot clean completely (E.G. everything else installed into
> staging), then I prefer just not providing a clean target.

  Begging to differ: I think it does make sense to have clean commands
but no uninstall commands. Of course, the definition above should have
been split up into a clean and an uninstall.

  Regards,
  Arnout
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 45ccbcf..88849d3 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -141,6 +141,7 @@  comment "QT libraries and helper libraries"
 source "package/grantlee/Config.in"
 source "package/qextserialport/Config.in"
 source "package/qtuio/Config.in"
+source "package/qwt/Config.in"
 endif
 
 source "package/x11r7/Config.in"
diff --git a/package/qwt/Config.in b/package/qwt/Config.in
new file mode 100644
index 0000000..15e3925
--- /dev/null
+++ b/package/qwt/Config.in
@@ -0,0 +1,17 @@ 
+comment "Qwt requires Qt to be installed"
+	depends on !BR2_PACKAGE_QT
+
+config BR2_PACKAGE_QWT
+	bool "Qwt"
+	depends on BR2_PACKAGE_QT
+	help
+	  Qwt for Embedded Linux.
+
+	  http://qwt.sourceforge.net/
+
+config BR2_PACKAGE_QWT_EXAMPLES
+	bool "Examples"
+	depends on BR2_PACKAGE_QWT
+	select BR2_PACKAGE_QT_SVG
+	help
+	  Compile & install the examples.
diff --git a/package/qwt/qwt-5.2.1-change-install-directories.patch b/package/qwt/qwt-5.2.1-change-install-directories.patch
new file mode 100644
index 0000000..4c28065
--- /dev/null
+++ b/package/qwt/qwt-5.2.1-change-install-directories.patch
@@ -0,0 +1,23 @@ 
+Change install directories.
+
+Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+
+--- qwt-5.2.1/src/src.pro.orig	2010-09-28 14:40:39.000000000 +0200
++++ qwt-5.2.1/src/src.pro	2010-09-28 14:41:29.000000000 +0200
+@@ -218,9 +218,12 @@
+ }
+ 
+ # Install directives
+-
+-headers.files  = $$HEADERS
+-doc.files      = $${QWT_ROOT}/doc/html $${QWT_ROOT}/doc/qwt-5.2.0.qch
++
++target.path = /usr/lib
++headers.files  = $$HEADERS
++headers.path = /usr/include/qwt-5.2.1
++doc.files      = $${QWT_ROOT}/doc/html $${QWT_ROOT}/doc/qwt-5.2.0.qch
++doc.path = /usr/doc/qwt-5.2.1
+ unix {
+     doc.files      += $${QWT_ROOT}/doc/man
+ }
diff --git a/package/qwt/qwt-5.2.1-disable-designer.patch b/package/qwt/qwt-5.2.1-disable-designer.patch
new file mode 100644
index 0000000..5d1bbe5
--- /dev/null
+++ b/package/qwt/qwt-5.2.1-disable-designer.patch
@@ -0,0 +1,17 @@ 
+Disable QwtDesigner.
+
+Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+
+--- qwt-5.2.1/qwtconfig.pri.orig	2010-09-28 14:34:01.000000000 +0200
++++ qwt-5.2.1/qwtconfig.pri	2010-09-28 15:37:02.000000000 +0200
+@@ -115,7 +115,7 @@
+ # Otherwise you have to build it from the designer directory.
+ ######################################################################
+ 
+-CONFIG     += QwtDesigner
++#CONFIG     += QwtDesigner
+ 
+ ######################################################################
+ # If you want to auto build the examples, enable the line below
+
diff --git a/package/qwt/qwt.mk b/package/qwt/qwt.mk
new file mode 100644
index 0000000..3d4e7f1
--- /dev/null
+++ b/package/qwt/qwt.mk
@@ -0,0 +1,74 @@ 
+######################################################################
+#
+# QWT
+#
+######################################################################
+QWT_VERSION = 5.2.1
+QWT_SOURCE = qwt-$(QWT_VERSION).zip
+QWT_SITE = http://sourceforge.net/projects/qwt/files/qwt/$(QWT_VERSION)
+# Qwt License v1.0 is a LGPL v2.1 with exceptions
+QWT_LICENSE = QWTv1.0
+QWT_LICENSE_FILES = COPYING
+
+QWT_DEPENDENCIES = qt
+
+QWT_INSTALL_STAGING = YES
+
+define QWT_EXTRACT_CMDS
+	$(RM) -rf $(QWT_DIR)
+	unzip -q -d $(BUILD_DIR)/ $(DL_DIR)/$(QWT_SOURCE)
+	test -d $(QWT_DIR) || \
+		mv $(BUILD_DIR)/$(subst .zip,,$(QWT_SOURCE)) $(QWT_DIR)
+endef
+
+ifeq ($(BR2_PACKAGE_QWT_EXAMPLES),y)
+define QWT_CONFIGURE_EXAMPLES
+	test ! -f $(@D)/examples/Makefile || $(MAKE) -C $(@D)/examples distclean
+	cd $(@D)/examples && $(QT_QMAKE)
+endef
+
+define QWT_BUILD_EXAMPLES
+	$(MAKE) -C $(@D)/examples
+endef
+
+define QWT_INSTALL_STAGING_EXAMPLES
+	$(INSTALL) -d $(STAGING_DIR)/usr/local/qwt-5.2.1/examples/bin
+	cp -f $(@D)/examples/bin/* \
+		$(STAGING_DIR)/usr/local/qwt-5.2.1/examples/bin
+endef
+
+define QWT_INSTALL_TARGET_EXAMPLES
+	$(INSTALL) -d $(TARGET_DIR)/usr/local/qwt-5.2.1/examples/bin
+	cp -f $(STAGING_DIR)/usr/local/qwt-5.2.1/examples/bin/* \
+		$(TARGET_DIR)/usr/local/qwt-5.2.1/examples/bin
+endef
+endif
+
+
+define QWT_CONFIGURE_CMDS
+	test ! -f $(@D)/Makefile || $(MAKE) -C $(@D) distclean
+	cd $(@D) && $(QT_QMAKE)
+	$(QWT_CONFIGURE_EXAMPLES)
+endef
+
+define QWT_BUILD_CMDS
+	$(MAKE) -C $(@D)
+	$(QWT_BUILD_EXAMPLES)
+endef
+
+define QWT_INSTALL_STAGING_CMDS
+	$(MAKE) INSTALL_ROOT=$(STAGING_DIR) -C $(@D) install
+	$(QWT_INSTALL_STAGING_EXAMPLES)
+endef
+
+define QWT_INSTALL_TARGET_CMDS
+	cp -dpf $(STAGING_DIR)/usr/lib/libqwt.so* $(TARGET_DIR)/usr/lib/
+	$(QWT_INSTALL_TARGET_EXAMPLES)
+endef
+
+define QWT_CLEAN_CMDS
+	-$(MAKE) -C $(@D) clean
+	-rm $(TARGET_DIR)/usr/lib/libqwt.so.*
+endef
+
+$(eval $(generic-package))