added ruby package per case 0000566
authorDavid Anders <dave123@abcsinc.com>
Mon, 23 Jan 2006 20:21:02 +0000 (20:21 -0000)
committerDavid Anders <dave123@abcsinc.com>
Mon, 23 Jan 2006 20:21:02 +0000 (20:21 -0000)
package/Config.in
package/ruby/Config.in [new file with mode: 0644]
package/ruby/ruby-configure.patch [new file with mode: 0644]
package/ruby/ruby.mk [new file with mode: 0644]

index 367e12ea14bafcc8211a40d5e4f5adf325765e78..e22adfbd272ffa6d721e3731af27fe2c46fe0f64 100644 (file)
@@ -108,6 +108,7 @@ source "package/qte/Config.in"
 source "package/raidtools/Config.in"
 source "package/readline/Config.in"
 source "package/rsync/Config.in"
+source "package/ruby/Config.in"
 source "package/rxvt/Config.in"
 source "package/sdl/Config.in"
 source "package/sfdisk/Config.in"
diff --git a/package/ruby/Config.in b/package/ruby/Config.in
new file mode 100644 (file)
index 0000000..bcc2b2c
--- /dev/null
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_RUBY
+       bool "ruby"
+       default n
+       help
+         Object Oriented Scripting Language.
+
+         http://www.ruby-lang.org/
diff --git a/package/ruby/ruby-configure.patch b/package/ruby/ruby-configure.patch
new file mode 100644 (file)
index 0000000..ab44ebe
--- /dev/null
@@ -0,0 +1,29 @@
+--- ruby-1.8.3/configure.in.orig       2005-11-29 11:18:27.000000000 +0100
++++ ruby-1.8.3/configure.in    2005-11-29 11:19:46.000000000 +0100
+@@ -529,7 +529,25 @@
+ fi
+ AC_FUNC_GETPGRP
+-AC_FUNC_SETPGRP  
++
++dnl AC_FUNC_SETPGRP does not work if cross compiling
++dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
++if test "$cross_compiling" = no; then
++  AC_FUNC_SETPGRP
++else
++  AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
++    [AC_TRY_COMPILE([
++#include <unistd.h>
++], [
++  if (setpgrp(1,1) == -1)
++    exit (0);
++  else
++    exit (1);
++], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
++if test $ac_cv_func_setpgrp_void = yes; then
++  AC_DEFINE(SETPGRP_VOID, 1)
++fi
++fi
+ AC_C_BIGENDIAN
+ AC_C_CONST
diff --git a/package/ruby/ruby.mk b/package/ruby/ruby.mk
new file mode 100644 (file)
index 0000000..2006b64
--- /dev/null
@@ -0,0 +1,70 @@
+#############################################################
+#
+# ruby
+#
+#############################################################
+RUBY_SOURCE:=ruby-1.8.2.tar.gz
+RUBY_SITE:=ftp://ftp.ruby-lang.org/pub/ruby/1.8
+RUBY_DIR:=$(BUILD_DIR)/ruby-1.8.2
+RUBY_CAT:=zcat
+RUBY_BINARY:=ruby
+RUBY_TARGET_BINARY:=usr/bin/ruby
+
+$(DL_DIR)/$(RUBY_SOURCE):
+        $(WGET) -P $(DL_DIR) $(RUBY_SITE)/$(RUBY_SOURCE)
+
+ruby-source: $(DL_DIR)/$(RUBY_SOURCE)
+
+$(RUBY_DIR)/.unpacked: $(DL_DIR)/$(RUBY_SOURCE)
+       $(RUBY_CAT) $(DL_DIR)/$(RUBY_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+       toolchain/patch-kernel.sh $(RUBY_DIR) package/ruby/ ruby-*.patch
+       (cd $(RUBY_DIR); autoreconf);
+       touch $(RUBY_DIR)/.unpacked
+
+$(RUBY_DIR)/.configured: $(RUBY_DIR)/.unpacked
+       (cd $(RUBY_DIR); rm -rf config.cache; \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               ./configure \
+               --target=$(GNU_TARGET_NAME) \
+               --host=$(GNU_TARGET_NAME) \
+               --build=$(GNU_HOST_NAME) \
+               --prefix=/usr \
+               --exec-prefix=/usr \
+               --bindir=/usr/bin \
+               --sbindir=/usr/sbin \
+               --libexecdir=/usr/lib \
+               --sysconfdir=/etc \
+               --datadir=/usr/share \
+               --localstatedir=/var \
+               --mandir=/usr/man \
+               --infodir=/usr/info \
+               $(DISABLE_NLS) \
+               $(DISABLE_LARGEFILE) \
+       );
+       touch $(RUBY_DIR)/.configured
+
+$(RUBY_DIR)/$(RUBY_BINARY): $(RUBY_DIR)/.configured
+       $(MAKE) -C $(RUBY_DIR)
+
+$(TARGET_DIR)/$(RUBY_TARGET_BINARY): $(RUBY_DIR)/$(RUBY_BINARY)
+       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(RUBY_DIR) install
+       rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
+
+ruby: uclibc $(TARGET_DIR)/$(RUBY_TARGET_BINARY)
+
+ruby-clean:
+       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(RUBY_DIR) uninstall
+       -$(MAKE) -C $(RUBY_DIR) clean
+
+ruby-dirclean:
+       rm -rf $(RUBY_DIR)
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_RUBY)),y)
+TARGETS+=ruby
+endif