Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v7] canfestival: new package
@ 2014-06-29 13:28 Samuel Martin
  2014-09-23 17:06 ` claurita
  2014-09-23 20:28 ` claurita
  0 siblings, 2 replies; 5+ messages in thread
From: Samuel Martin @ 2014-06-29 13:28 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Cc: Julien Boibessot <julien.boibessot@armadeus.com>
Cc: Davide Viti <zinosat@tiscali.it>

---
changes v6 -> v7:
- rebase
- remove patch (merged upstream)
- bump version

changes v5 -> v6:
- rebase
- fix typoes (ThomasP)
- remove Anagate and PeakSystem support (ThomasP)
- fix kernel dependency (ThomasP)
- fix license details (ThomasP)
- add comment why we are using generic-infra (ThomasP)
- make install commands failed if something goes wrong (ThomasP)

changes v4 -> v5:
- rebase
- cosmetic changes (Davide)

changes v3 -> v4:
- rebase
- pass --prefix=/usr to the configure call (Davide)
- misc. cleanup in canfestival.mk (Yann)
- keep package/Config.in alphabetically ordered

changes v2 -> v3:
- rename package libcanfestival -> canfestival (follow upstream name)
- add option to install examples
- use latest revision
- use tarball instead of hg clone
- cosmetic fixes and typos (Peter and Yegor)
- add note about the standard mainline can interface (Peter)
- set default max bus number to 1 (Peter)

changes v1 -> v2:
- clean/fix *.mk
---
 package/Config.in                  |  1 +
 package/canfestival/Config.in      | 96 ++++++++++++++++++++++++++++++++++++++
 package/canfestival/canfestival.mk | 61 ++++++++++++++++++++++++
 3 files changed, 158 insertions(+)
 create mode 100644 package/canfestival/Config.in
 create mode 100644 package/canfestival/canfestival.mk

diff --git a/package/Config.in b/package/Config.in
index d7e1acc..125571f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -724,6 +724,7 @@ endmenu
 menu "Networking"
 	source "package/agentpp/Config.in"
 	source "package/c-ares/Config.in"
+	source "package/canfestival/Config.in"
 	source "package/cppzmq/Config.in"
 	source "package/czmq/Config.in"
 	source "package/filemq/Config.in"
diff --git a/package/canfestival/Config.in b/package/canfestival/Config.in
new file mode 100644
index 0000000..83abe49
--- /dev/null
+++ b/package/canfestival/Config.in
@@ -0,0 +1,96 @@
+config BR2_PACKAGE_CANFESTIVAL
+	bool "canfestival"
+	depends on BR2_i386 || BR2_x86_64 || BR2_powerpc || BR2_arm
+	help
+	  CanFestival is an OpenSource CANOpen framework, licensed under
+	  LGPLv2.1 and GPLv2 for some drivers (virtual_kernel, lincan and
+	  copcican_comedi).
+
+	  http://www.canfestival.org
+
+if BR2_PACKAGE_CANFESTIVAL
+
+choice
+	prompt "driver to use"
+	default BR2_PACKAGE_CANFESTIVAL_SOCKET
+
+# AnaGate CAN(duo) driver [1] and PeakSystem CAN support [2] are not
+# available (not packaged in Buildroot)
+#
+# [1] http://www.anagate.de/en/index.html
+# [2] http://www.peak-system.com/linux/
+
+config BR2_PACKAGE_CANFESTIVAL_VIRTUAL
+	bool "virtual"
+	help
+	  Unix pipe based virtual CAN driver.
+
+config BR2_PACKAGE_CANFESTIVAL_VIRTUAL_KERNEL
+	bool "virtual_kernel"
+	depends on BR2_LINUX_KERNEL
+	help
+	  Kernel module virtual CAN driver.
+
+config BR2_PACKAGE_CANFESTIVAL_SOCKET
+	bool "socket"
+	help
+	  SocketCAN (the standard mainline CAN bus interface).
+
+	  http://developer.berlios.de/projects/socketcan/
+
+config BR2_PACKAGE_CANFESTIVAL_LINCAN
+	bool "lincan"
+	help
+	  Lincan driver.
+
+	  http://www.ocera.org/download/components/WP7/lincan-0.3.3.html
+
+config BR2_PACKAGE_CANFESTIVAL_CAN4LINUX
+	bool "can4linux"
+	help
+	  Can4linux driver.
+
+	  http://www.port.de/engl/canprod/hw_can4linux.html
+
+config BR2_PACKAGE_CANFESTIVAL_COPCICAN_LINUX
+	bool "copcican_linux"
+	help
+	  User space driver interface for CO-PCICAN card.
+
+	  http://www.cosateq.com/
+
+config BR2_PACKAGE_CANFESTIVAL_COPCICAN_COMEDI
+	bool "copcican_comedi"
+	depends on BR2_LINUX_KERNEL
+	help
+	  COMEDI driver interface for CO-PCICAN card.
+
+	  http://www.cosateq.com/
+
+endchoice
+
+config BR2_PACKAGE_CANFESTIVAL_DRIVER
+	string
+	default "anagate_linux"	  if BR2_PACKAGE_CANFESTIVAL_ANAGATE_LINUX
+	default "peak_linux"	  if BR2_PACKAGE_CANFESTIVAL_PEAK_LINUX
+	default "virtual"	  if BR2_PACKAGE_CANFESTIVAL_VIRTUAL
+	default "virtual_kernel"  if BR2_PACKAGE_CANFESTIVAL_VIRTUAL_KERNEL
+	default "socket"	  if BR2_PACKAGE_CANFESTIVAL_SOCKET
+	default "lincan"	  if BR2_PACKAGE_CANFESTIVAL_LINCAN
+	default "can4linux"	  if BR2_PACKAGE_CANFESTIVAL_CAN4LINUX
+	default "copcican_linux"  if BR2_PACKAGE_CANFESTIVAL_COCPICAN_LINUX
+	default "copcican_comedi" if BR2_PACKAGE_CANFESTIVAL_COPCICAN_COMEDI
+
+config BR2_PACKAGE_CANFESTIVAL_ADDITIONAL_OPTIONS
+	string "additional configure options"
+	help
+	  Additional options can be passed directly to the configure script
+	  (e.g.: --MAX_CAN_BUS_ID=..., --SDO_MAX_LENGTH_TRANSFER=...,
+	  --SDO_BLOCK_SIZE=...).
+
+config BR2_PACKAGE_CANFESTIVAL_INSTALL_EXAMPLES
+	bool "install examples"
+	help
+	  Install binary application examples.
+
+endif
diff --git a/package/canfestival/canfestival.mk b/package/canfestival/canfestival.mk
new file mode 100644
index 0000000..75193cf
--- /dev/null
+++ b/package/canfestival/canfestival.mk
@@ -0,0 +1,61 @@
+################################################################################
+#
+# canfestival
+#
+################################################################################
+
+# Revision 791:
+CANFESTIVAL_VERSION = 7740ac6fdedc
+CANFESTIVAL_SOURCE = $(CANFESTIVAL_VERSION).tar.bz2
+CANFESTIVAL_SITE = http://dev.automforge.net/CanFestival-3/archive
+# Runtime code is licensed LGPLv2, whereas accompanying developer tools and few
+# drivers (virtual_kernel, lincan and copcican_linux) are licensed GPLv2.
+CANFESTIVAL_LICENSE = LGPLv2.1+, GPLv2 for the virtual_kernel, lincan and copcican_linux drivers
+CANFESTIVAL_LICENSE_FILES = COPYING LICENCE
+CANFESTIVAL_INSTALL_STAGING = YES
+CANFESTIVAL_INSTALLED-y = src drivers
+CANFESTIVAL_INSTALLED-$(BR2_PACKAGE_CANFESTIVAL_INSTALL_EXAMPLES) += examples
+
+ifeq ($(BR2_PACKAGE_CANFESTIVAL_VIRTUAL_KERNEL)$(BR2_PACKAGE_CANFESTIVAL_COPCICAN_COMEDI),y)
+CANFESTIVAL_DEPENDENCIES += linux
+CANFESTIVAL_CONF_OPT += --kerneldir=$(LINUX_DIR)
+endif
+
+# canfestival uses its own hand-written build-system. Though there is configure
+# script, it does not use the autotools at all.
+# So, we use the generic-package infrastructure.
+define CANFESTIVAL_CONFIGURE_CMDS
+	cd $(@D) && \
+		$(TARGET_CONFIGURE_OPTS) ./configure \
+		--target=unix \
+		--arch=$(BR2_ARCH) \
+		--timers=unix \
+		--binutils=$(TARGET_CROSS) \
+		--cc="$(TARGET_CC)" \
+		--cxx="$(TARGET_CC)" \
+		--ld="$(TARGET_CC)" \
+		--prefix=/usr \
+		--can=$(BR2_PACKAGE_CANFESTIVAL_DRIVER) \
+		$(CANFESTIVAL_CONF_OPT) \
+		$(call qstrip,$(BR2_PACKAGE_CANFESTIVAL_ADDITIONAL_OPTIONS))
+endef
+
+define CANFESTIVAL_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) all
+endef
+
+define CANFESTIVAL_INSTALL_TARGET_CMDS
+	for d in $(CANFESTIVAL_INSTALLED-y) ; do \
+		$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$$d install \
+			DESTDIR=$(TARGET_DIR) || exit 1 ; \
+	done
+endef
+
+define CANFESTIVAL_INSTALL_STAGING_CMDS
+	for d in $(CANFESTIVAL_INSTALLED-y) ; do \
+		$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$$d install \
+			DESTDIR=$(STAGING_DIR) || exit 1 ; \
+	done
+endef
+
+$(eval $(generic-package))
-- 
2.0.1

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

* [Buildroot] [PATCH v7] canfestival: new package
  2014-06-29 13:28 [Buildroot] [PATCH v7] canfestival: new package Samuel Martin
@ 2014-09-23 17:06 ` claurita
  2014-09-23 17:52   ` Thomas Petazzoni
  2014-09-23 20:28 ` claurita
  1 sibling, 1 reply; 5+ messages in thread
From: claurita @ 2014-09-23 17:06 UTC (permalink / raw)
  To: buildroot

I'd like to propose a little patch to add pkg-config support.
It's only a draft proposal, even if I'm using it. I hope it could be useful.
Claudio

diff --git a/canfestival.pc.in b/canfestival.pc.in
new file mode 100644
index 0000000..08ecbe1
--- /dev/null
+++ b/canfestival.pc.in
@@ -0,0 +1,12 @@
+PREFIX = SUB_PREFIX
+TARGET = SUB_TARGET
+
+prefix=${DESTDIR}${PREFIX}
+libdir=${prefix}/lib
+includedir=${prefix}/include/canfestival
+
+Name: Canfestival
+Description: Canfestival CANOpen library 
+Version: 1
+Libs: -L${libdir} -lcanfestival -lcanfestival_${TARGET} -lrt -ldl -lpthread
+Cflags: -I${includedir}
diff --git a/configure b/configure
index b63b276..6d909d6 100755
--- a/configure
+++ b/configure
@@ -825,6 +825,7 @@ elif [ "$SUB_TARGET" = "unix" -a "$SUB_TIMERS_DRIVER" =
"kernel_xeno" ]; then
 
 elif [ "$SUB_TARGET" = "unix" ]; then
 	MAKEFILES=$MAKEFILES\
+\	canfestival.pc.in\
 \	examples/CANOpenShell/Makefile.in\
 \	examples/TestMasterSlave/Makefile.in\
 \	examples/TestMasterSlaveLSS/Makefile.in\
diff --git a/src/Makefile.in b/src/Makefile.in
index e709f4f..8bee33d 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -132,9 +132,10 @@ $(TARGET)_%.o: %.c
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 install: libcanfestival.a
-	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/pkgconfig/
 	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
 	cp libcanfestival.a $(DESTDIR)$(PREFIX)/lib/
+	cp ../canfestival.pc $(DESTDIR)$(PREFIX)/lib/pkgconfig/
 	cp ../include/*.h $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall:



--
View this message in context: http://buildroot-busybox.2317881.n4.nabble.com/PATCH-v7-canfestival-new-package-tp73727p80004.html
Sent from the Buildroot (busybox) mailing list archive@Nabble.com.

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

* [Buildroot] [PATCH v7] canfestival: new package
  2014-09-23 17:06 ` claurita
@ 2014-09-23 17:52   ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2014-09-23 17:52 UTC (permalink / raw)
  To: buildroot

Dear claurita,

On Tue, 23 Sep 2014 10:06:40 -0700 (PDT), claurita wrote:

> I'd like to propose a little patch to add pkg-config support.
> It's only a draft proposal, even if I'm using it. I hope it could be useful.

Thanks. But your patch is against canfestival itself, while you're
posting to the Buildroot mailing list. So you have two choices here:

 */ Submit your patch to the canfestival project directly.

 */ Add your patch inside Buildroot, in package/canfestival/, and then
    post a Buildroot patch adding your patch (yes, you'll have a patch
    adding a patch!)

Thanks,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v7] canfestival: new package
  2014-06-29 13:28 [Buildroot] [PATCH v7] canfestival: new package Samuel Martin
  2014-09-23 17:06 ` claurita
@ 2014-09-23 20:28 ` claurita
  2014-09-23 21:28   ` Samuel Martin
  1 sibling, 1 reply; 5+ messages in thread
From: claurita @ 2014-09-23 20:28 UTC (permalink / raw)
  To: buildroot

Thank you for your attention.
My intention was exactly the second choice you offered.
Those few lines are the contents of a file named
canfestival-add-pkgconfig-support.patch that I put into
/buildroot/package/canfestival. It only does what I actually need and I
thought it may save a bit of time to someone else.
Think of my first post as a "(more or less) already done" feature request to
the author of the real patch, in case of his interest for V8.

Claudio



--
View this message in context: http://buildroot-busybox.2317881.n4.nabble.com/PATCH-v7-canfestival-new-package-tp73727p80043.html
Sent from the Buildroot (busybox) mailing list archive at Nabble.com.

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

* [Buildroot] [PATCH v7] canfestival: new package
  2014-09-23 20:28 ` claurita
@ 2014-09-23 21:28   ` Samuel Martin
  0 siblings, 0 replies; 5+ messages in thread
From: Samuel Martin @ 2014-09-23 21:28 UTC (permalink / raw)
  To: buildroot

Hi Claudio,

On Tue, Sep 23, 2014 at 10:28 PM, claurita
<claudio.laurita@integrazionetotale.it> wrote:
> Thank you for your attention.
> My intention was exactly the second choice you offered.
> Those few lines are the contents of a file named
> canfestival-add-pkgconfig-support.patch that I put into
> /buildroot/package/canfestival. It only does what I actually need and I
> thought it may save a bit of time to someone else.
> Think of my first post as a "(more or less) already done" feature request to
> the author of the real patch, in case of his interest for V8.
>

Thanks for the patch.

I plan to respin this patch soon (in the coming days or weeks at worst).
I'll integrate this patch if not already merged upstream.

If you could try to submit this patch to canfestival mailing list [1]
(you need to subscribe to the canfestival list [2]), it'd be good.
From my little experience working with the canfestival developer,
patches get merged rather quickly.


Regards,

[1] canfestival-devel at lists.sourceforge.net
[2] https://lists.sourceforge.net/lists/listinfo/canfestival-devel

-- 
Samuel

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

end of thread, other threads:[~2014-09-23 21:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-29 13:28 [Buildroot] [PATCH v7] canfestival: new package Samuel Martin
2014-09-23 17:06 ` claurita
2014-09-23 17:52   ` Thomas Petazzoni
2014-09-23 20:28 ` claurita
2014-09-23 21:28   ` Samuel Martin

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