Skip to contentSkip to conversation

add ruby serialport extension

PATCH New laurent.laffont at gmail.com 2 participants 3 messages Jul 9, 2009 – Jul 13, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add ruby serialport extension

From: laurent laffont <[email protected]>

Handle ruby serialport extension cross compilation.
http://rubyforge.org/projects/ruby-serialport/

---
 package/Config.in                                  |    1 +
 package/ruby-serialport/Config.in                  |    7 +++
 .../ruby-serialport/ruby-serialport-fix-1.9.patch  |   52 +++++++++++++++++++
 package/ruby-serialport/ruby-serialport.mk         |   53 ++++++++++++++++++++
 4 files changed, 113 insertions(+), 0 deletions(-)
 create mode 100644 package/ruby-serialport/Config.in
 create mode 100644 package/ruby-serialport/ruby-serialport-fix-1.9.patch
 create mode 100644 package/ruby-serialport/ruby-serialport.mk
package/Config.in +1 -0
index cb83563..5c22ed3 100644
@@ -427,6 +427,7 @@ source "package/lua/Config.in"
 source "package/microperl/Config.in"
 source "package/python/Config.in"
 source "package/ruby/Config.in"
+source "package/ruby-serialport/Config.in"
 source "package/tcl/Config.in"
 source "package/php/Config.in"
 endmenu
package/ruby-serialport/Config.in new file +7 -0
new file mode 100644
index 0000000..acdb3be
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_RUBY_SERIALPORT
+	depends on BR2_PACKAGE_RUBY
+	bool "ruby-serialport"
+	help
+	  Ruby library that provides a class for using RS-232 serial ports
+	  http://rubyforge.org/projects/ruby-serialport/
+
package/ruby-serialport/ruby-serialport-fix-1.9.patch new file +52 -0

52 lines not on this page · raw message

package/ruby-serialport/ruby-serialport.mk new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 1/1 add ruby serialport extension

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"laurent" == laurent laffont <[email protected]> writes:

Hi,

laurent> From: laurent laffont <[email protected]> laurent> Handle ruby serialport extension cross compilation. laurent> http://rubyforge.org/projects/ruby-serialport/

laurent> Signed-off-by: laurent laffont <[email protected]>

laurent> +++ b/package/ruby-serialport/ruby-serialport-fix-1.9.patch laurent> @@ -0,0 +1,52 @@
laurent> +--- a/ext/impl/posix_serialport.c 2008-12-23 20:35:07.000000000 +0000
laurent> ++++ b/ext/impl/posix_serialport.c 2009-05-21 16:37:13.000000000 +0100
laurent> +@@ -38,16 +38,16 @@
laurent> + static int get_fd_helper(obj)
laurent> + VALUE obj;
laurent> + {
laurent> +- OpenFile *fptr;
laurent> ++ rb_io_t *fptr;

What is this for? It doesn't seem buildroot specific?

laurent> diff --git a/package/ruby-serialport/ruby-serialport.mk b/package/ruby-serialport/ruby-serialport.mk laurent> new file mode 100644
laurent> index 0000000..797646c
laurent> --- /dev/null
laurent> +++ b/package/ruby-serialport/ruby-serialport.mk
laurent> @@ -0,0 +1,53 @@
laurent> +#############################################################
laurent> +#
laurent> +# ruby-serialport
laurent> +#
laurent> +#############################################################
laurent> +RUBY_SERIALPORT_VERSION = 0.7.0
laurent> +RUBY_SERIALPORT_SOURCE = ruby-serialport-$(RUBY_SERIALPORT_VERSION).tar.gz laurent> +RUBY_SERIALPORT_SITE = http://rubyforge.org/frs/download.php/49992
laurent> +RUBY_SERIALPORT_DIR:=$(BUILD_DIR)/ruby-serialport-$(RUBY_SERIALPORT_VERSION) laurent> +RUBY_SERIALPORT_CAT:=$(ZCAT)
laurent> +
laurent> +$(DL_DIR)/$(RUBY_SERIALPORT_SOURCE):
laurent> + $(call DOWNLOAD,$(RUBY_SERIALPORT_SITE,$(RUBY_SERIALPORT_SOURCE))
laurent> +
laurent> +ruby-serialport-source: $(DL_DIR)/$(RUBY_SERIALPORT_SOURCE)
laurent> +
laurent> +$(RUBY_SERIALPORT_DIR)/.unpacked: $(DL_DIR)/$(RUBY_SERIALPORT_SOURCE)
laurent> + $(RUBY_SERIALPORT_CAT) $(DL_DIR)/$(RUBY_SERIALPORT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
laurent> + toolchain/patch-kernel.sh $(RUBY_SERIALPORT_DIR) package/ruby-serialport/ ruby-serialport\*.patch
laurent> + touch $@
laurent> +
laurent> +$(RUBY_SERIALPORT_DIR)/.configured: $(RUBY_SERIALPORT_DIR)/.unpacked
laurent> + (cd $(RUBY_SERIALPORT_DIR)/ext; rm Makefile; \
laurent> + RUBYLIB=$(RUBY_DIR):$(RUBY_DIR)/lib:$(RUBY_DIR)/.ext ruby-1.9 -e "require 'mkmf'; create_makefile('serialport')";)

This expects the host to have ruby 1.9 installed. Either we need to add a check with a sensible error message or you need to compile ruby for the host in $(HOST_DIR) and use that instead. See libglib2.mk for an example.

laurent> +$(RUBY_SERIALPORT_DIR)/.installed: $(RUBY_SERIALPORT_DIR)/ext/serialport.so
laurent> + (cd $(RUBY_SERIALPORT_DIR)/ext; \
laurent> + $(MAKE) DESTDIR=$(TARGET_DIR) extout=$(RUBY_DIR)/.ext install)

Doesn't this need to be stripped?

laurent> + touch $@
laurent> +
laurent> +ruby-serialport: $(RUBY_SERIALPORT_DIR)/.installed laurent> +
laurent> +ruby-serialport-clean:
laurent> + (cd $(RUBY_SERIALPORT_DIR)/ext; \
laurent> + $(MAKE) DESTDIR=$(TARGET_DIR) extout=$(RUBY_DIR)/.ext clean)

This will fail if the -source target hasn't executed yet (E.G. running make clean; make clean) - You can fix it by prefixing the line with '-' to tell make to ignore errors.

Signature · 1 line
Bye, Peter Korsgaard

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 add ruby serialport extension

Quoted 24 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"laurent" == laurent laffont <[email protected]> writes:

Hi,

laurent> From: laurent laffont <[email protected]> laurent> Handle ruby serialport extension cross compilation. laurent> http://rubyforge.org/projects/ruby-serialport/

laurent> Signed-off-by: laurent laffont <[email protected]>

laurent> +++ b/package/ruby-serialport/ruby-serialport-fix-1.9.patch laurent> @@ -0,0 +1,52 @@
laurent> +--- a/ext/impl/posix_serialport.c 2008-12-23
20:35:07.000000000 +0000
laurent> ++++ b/ext/impl/posix_serialport.c 2009-05-21
16:37:13.000000000 +0100
laurent> +@@ -38,16 +38,16 @@
laurent> + static int get_fd_helper(obj)
laurent> + VALUE obj;
laurent> + {
laurent> +- OpenFile *fptr;
laurent> ++ rb_io_t *fptr;

Quoted 1 line

What is this for? It doesn't seem buildroot specific?

This patch is needed to compile ruby-serialport with ruby 1.9.1 See
http://rubyforge.org/tracker/index.php?func=detail&aid=23788&group_id=61&atid=320

Quoted 46 lines

laurent> diff --git a/package/ruby-serialport/ruby-serialport.mkb/package/ruby-serialport/
ruby-serialport.mk
laurent> new file mode 100644
laurent> index 0000000..797646c
laurent> --- /dev/null
laurent> +++ b/package/ruby-serialport/ruby-serialport.mk
laurent> @@ -0,0 +1,53 @@
laurent> +############################################################# laurent> +#
laurent> +# ruby-serialport
laurent> +#
laurent> +############################################################# laurent> +RUBY_SERIALPORT_VERSION = 0.7.0
laurent> +RUBY_SERIALPORT_SOURCE =
ruby-serialport-$(RUBY_SERIALPORT_VERSION).tar.gz
laurent> +RUBY_SERIALPORT_SITE =
http://rubyforge.org/frs/download.php/49992
laurent>
+RUBY_SERIALPORT_DIR:=$(BUILD_DIR)/ruby-serialport-$(RUBY_SERIALPORT_VERSION)
laurent> +RUBY_SERIALPORT_CAT:=$(ZCAT)
laurent> +
laurent> +$(DL_DIR)/$(RUBY_SERIALPORT_SOURCE):
laurent> + $(call
DOWNLOAD,$(RUBY_SERIALPORT_SITE,$(RUBY_SERIALPORT_SOURCE))
laurent> +
laurent> +ruby-serialport-source: $(DL_DIR)/$(RUBY_SERIALPORT_SOURCE) laurent> +
laurent> +$(RUBY_SERIALPORT_DIR)/.unpacked:
$(DL_DIR)/$(RUBY_SERIALPORT_SOURCE)
laurent> + $(RUBY_SERIALPORT_CAT) $(DL_DIR)/$(RUBY_SERIALPORT_SOURCE)
| tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
laurent> + toolchain/patch-kernel.sh $(RUBY_SERIALPORT_DIR)
package/ruby-serialport/ ruby-serialport\*.patch
laurent> + touch $@
laurent> +
laurent> +$(RUBY_SERIALPORT_DIR)/.configured:
$(RUBY_SERIALPORT_DIR)/.unpacked
laurent> + (cd $(RUBY_SERIALPORT_DIR)/ext; rm Makefile; \
laurent> +
RUBYLIB=$(RUBY_DIR):$(RUBY_DIR)/lib:$(RUBY_DIR)/.ext ruby-1.9 -e "require 'mkmf'; create_makefile('serialport')";)

Quoted 4 lines

This expects the host to have ruby 1.9 installed. Either we need to add a check with a sensible error message or you need to compile ruby for the host in $(HOST_DIR) and use that instead. See libglib2.mk for an example.

OK, I will take look.

Quoted 11 lines

laurent> +$(RUBY_SERIALPORT_DIR)/.installed:
$(RUBY_SERIALPORT_DIR)/ext/serialport.so
laurent> + (cd $(RUBY_SERIALPORT_DIR)/ext; \
laurent> + $(MAKE) DESTDIR=$(TARGET_DIR)
extout=$(RUBY_DIR)/.ext install)

Doesn't this need to be stripped?

I will try.

Quoted 11 lines

laurent> + touch $@
laurent> +
laurent> +ruby-serialport: $(RUBY_SERIALPORT_DIR)/.installed laurent> +
laurent> +ruby-serialport-clean:
laurent> + (cd $(RUBY_SERIALPORT_DIR)/ext; \
laurent> + $(MAKE) DESTDIR=$(TARGET_DIR)
extout=$(RUBY_DIR)/.ext clean)

Quoted 3 lines

This will fail if the -source target hasn't executed yet (E.G. running make clean; make clean) - You can fix it by prefixing the line with '-' to tell make to ignore errors.

OK. Thanks for your comments.

Regards,

Laurent Laffont
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20090713/489f8bd6/attachment-0001.htm>