Skip to content
Browse files

patched ruby works on leopard!

  • Loading branch information...
1 parent 0077c96 commit 14c82216e87e689c9c49445dd5a32a502896827e @mojombo committed
View
8 Manifest
@@ -1,3 +1,10 @@
+assets/darwin-10.5/dot-darwin.diff
+assets/darwin-10.5/etc-irbrc.diff
+assets/darwin-10.5/ignore-gsetcontext.diff
+assets/darwin-10.5/md5_sha1_commoncrypto.diff
+assets/darwin-10.5/use-dyld.diff
+assets/darwin-10.5/use-setreugid.diff
+assets/darwin-10.5/words-bigendian-from-arch.diff
assets/gc.c.patch
assets/parse.y.patch
assets/ruby-1.8.6-p110.tar.bz2
@@ -6,7 +13,6 @@ ext/build_logger.rb
ext/build_ruby.rb
ext/extconf.rb
ext/logger.c
-ext/logger.h
lib/vanhelsing.rb
LICENSE
LICENSE_bleak_house
View
4 Rakefile
@@ -7,8 +7,8 @@ Echoe.new('vanhelsing') do |p|
end
task :go do
- sh("sudo rm /usr/bin/ruby-vanhelsing")
- sh("sudo rm -fr /tmp/vanhelsing")
+ sh("sudo rm /usr/bin/ruby-vanhelsing") rescue nil
+ sh("sudo rm -fr /tmp/vanhelsing") rescue nil
sh("rake manifest")
sh("rake clean")
sh("rake package")
View
11 assets/darwin-10.5/dot-darwin.diff
@@ -0,0 +1,11 @@
+--- lib/rdoc/options.rb.orig 2007-10-23 17:36:41.000000000 +0200
++++ lib/rdoc/options.rb 2007-10-23 17:37:12.000000000 +0200
+@@ -544,7 +544,7 @@
+ # so we'll bypass the test under Windows
+
+ def check_diagram
+- return if RUBY_PLATFORM =~ /win/
++ return if RUBY_PLATFORM =~ /mswin32|cygwin|mingw|bccwin/
+
+ ok = false
+ ver = nil
View
12 assets/darwin-10.5/etc-irbrc.diff
@@ -0,0 +1,12 @@
+--- lib/irb/init.rb.orig 2007-10-23 17:43:49.000000000 +0200
++++ lib/irb/init.rb 2007-10-23 17:43:03.000000000 +0200
+@@ -243,6 +243,9 @@
+ yield proc{|rc| home+"/irb#{rc.sub(/\A_?/, '.')}"}
+ yield proc{|rc| home+"/_irb#{rc}"}
+ yield proc{|rc| home+"/$irb#{rc}"}
++ unless RUBY_PLATFORM =~ /mswin32|cygwin|mingw|bccwin/
++ yield proc{|rc| "/etc/irb#{rc}"}
++ end
+ end
+
+ # loading modules
View
23 assets/darwin-10.5/ignore-gsetcontext.diff
@@ -0,0 +1,23 @@
+--- node.h.orig 2007-10-23 17:09:10.000000000 +0200
++++ node.h 2007-10-23 17:08:19.000000000 +0200
+@@ -374,9 +374,17 @@
+ void rb_add_event_hook _((rb_event_hook_func_t,rb_event_t));
+ int rb_remove_event_hook _((rb_event_hook_func_t));
+
+-#if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT)
+-#include <ucontext.h>
+-#define USE_CONTEXT
++#if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT)
++# if defined(__APPLE__)
++# include <AvailabilityMacros.h>
++# if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
++# include <ucontext.h>
++# define USE_CONTEXT
++# endif
++# else
++# include <ucontext.h>
++# define USE_CONTEXT
++# endif
+ #endif
+ #include <setjmp.h>
+ #include "st.h"
View
46 assets/darwin-10.5/md5_sha1_commoncrypto.diff
@@ -0,0 +1,46 @@
+--- ext/digest/md5/extconf.rb.orig 2007-10-23 18:31:40.000000000 +0200
++++ ext/digest/md5/extconf.rb 2007-10-23 18:26:33.000000000 +0200
+@@ -11,6 +11,7 @@
+ dir_config("openssl")
+
+ if !with_config("bundled-md5") &&
++ !have_header("CommonCrypto/CommonDigest.h") &&
+ have_library("crypto") && have_header("openssl/md5.h")
+ $objs << "md5ossl.#{$OBJEXT}"
+
+--- ext/digest/md5/md5.h.orig 2007-10-23 18:31:52.000000000 +0200
++++ ext/digest/md5/md5.h 2007-10-23 18:28:19.000000000 +0200
+@@ -48,6 +48,10 @@
+
+ #include "defs.h"
+
++#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
++# include <CommonCrypto/CommonDigest.h>
++#endif
++
+ /*
+ * This code has some adaptations for the Ghostscript environment, but it
+ * will compile and run correctly in any environment with 8-bit chars and
+--- ext/digest/sha1/extconf.rb.orig 2007-10-23 18:42:07.000000000 +0200
++++ ext/digest/sha1/extconf.rb 2007-10-23 18:43:01.000000000 +0200
+@@ -11,6 +11,7 @@
+ dir_config("openssl")
+
+ if !with_config("bundled-sha1") &&
++ !have_header("CommonCrypto/CommonDigest.h") &&
+ have_library("crypto") && have_header("openssl/sha.h")
+ $objs << "sha1ossl.#{$OBJEXT}"
+ else
+--- ext/digest/sha1/sha1.h.orig 2007-10-23 18:42:14.000000000 +0200
++++ ext/digest/sha1/sha1.h 2007-10-23 18:43:23.000000000 +0200
+@@ -13,6 +13,10 @@
+
+ #include "defs.h"
+
++#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
++# include <CommonCrypto/CommonDigest.h>
++#endif
++
+ typedef struct {
+ uint32_t state[5];
+ uint32_t count[2];
View
35 assets/darwin-10.5/use-dyld.diff
@@ -0,0 +1,35 @@
+--- dln.c.orig 2007-10-23 19:59:39.000000000 +0200
++++ dln.c 2007-10-23 20:06:45.000000000 +0200
+@@ -87,13 +87,21 @@
+
+ #ifndef NO_DLN_LOAD
+
+-#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__) && !defined(_UNICOSMP)
++#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(_UNICOSMP)
+ /* dynamic load with dlopen() */
+ # define USE_DLN_DLOPEN
+ #endif
+
++#if defined(USE_DLN_DLOPEN) && defined(__APPLE__)
++/* Mac OS X system lesser than 10.4 should use the NSSymbol APIs instead of dlopen/dlsym. */
++# include <AvailabilityMacros.h>
++# if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
++# undef USE_DLN_DLOPEN
++# endif
++#endif
++
+ #ifndef FUNCNAME_PATTERN
+-# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(NeXT) || defined(__WATCOMC__) || defined(__APPLE__)
++# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(NeXT) || defined(__WATCOMC__) || (defined(__APPLE__) && !defined(USE_DLN_DLOPEN))
+ # define FUNCNAME_PATTERN "_Init_%s"
+ # else
+ # define FUNCNAME_PATTERN "Init_%s"
+@@ -1403,7 +1411,7 @@
+ }
+ #endif /* _AIX */
+
+-#if defined(NeXT) || defined(__APPLE__)
++#if defined(NeXT) || (defined(__APPLE__) && !defined(USE_DLN_DLOPEN))
+ #define DLN_DEFINED
+ /*----------------------------------------------------
+ By SHIROYAMA Takayuki Psi@fortune.nest.or.jp
View
22 assets/darwin-10.5/use-setreugid.diff
@@ -0,0 +1,22 @@
+--- process.c.orig 2007-10-23 18:50:29.000000000 +0200
++++ process.c 2007-10-23 19:08:01.000000000 +0200
+@@ -96,9 +96,16 @@
+ #undef HAVE_SETRGID
+ #endif
+
+-#if defined(__MacOS_X__) || defined(__bsdi__)
+-#define BROKEN_SETREUID 1
+-#define BROKEN_SETREGID 1
++#if defined(__APPLE__)
++# include <AvailabilityMacros.h>
++/* setreuid/setregid were broken in Mac OS X <= 10.4, but were fixed since. */
++# if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
++# define BROKEN_SETREUID 1
++# define BROKEN_SETREGID 1
++# endif
++#elif defined(__bsdi__)
++# define BROKEN_SETREUID 1
++# define BROKEN_SETREGID 1
+ #endif
+
+ #if defined(HAVE_44BSD_SETUID) || defined(__MacOS_X__)
View
33 assets/darwin-10.5/words-bigendian-from-arch.diff
@@ -0,0 +1,33 @@
+--- defines.h.orig 2007-10-23 19:48:41.000000000 +0200
++++ defines.h 2007-10-23 19:49:23.000000000 +0200
+@@ -102,6 +102,16 @@
+ #endif
+ #endif
+
++#if defined(__NeXT__) || defined(__APPLE__)
++/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
++ result in a different endian. Instead trust __BIG_ENDIAN__ and
++ __LITTLE_ENDIAN__ which are set correctly by -arch. */
++#undef WORDS_BIGENDIAN
++#ifdef __BIG_ENDIAN__
++#define WORDS_BIGENDIAN
++#endif
++#endif
++
+ #ifdef __NeXT__
+ /* NextStep, OpenStep, Rhapsody */
+ #ifndef S_IRUSR
+@@ -155,13 +165,6 @@
+ #ifndef S_ISREG
+ #define S_ISREG(mode) (((mode) & (0170000)) == (0100000))
+ #endif
+-/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
+- result in a different endian. Instead trust __BIG_ENDIAN__ and
+- __LITTLE_ENDIAN__ which are set correctly by -arch. */
+-#undef WORDS_BIGENDIAN
+-#ifdef __BIG_ENDIAN__
+-#define WORDS_BIGENDIAN
+-#endif
+ #ifndef __APPLE__
+ /* NextStep, OpenStep (but not Rhapsody) */
+ #ifndef GETPGRP_VOID
View
9 ext/build_ruby.rb
@@ -49,7 +49,14 @@ def which(basename)
# Patch, configure, and build
system("patch -p0 < \'#{source_dir}/gc.c.patch\' > ../gc.c.patch.log 2>&1")
system("patch -p0 < \'#{source_dir}/parse.y.patch\' > ../parse.y.patch.log 2>&1")
- system("./configure --prefix=#{binary_dir[0..-5]} > ../configure.log 2>&1") # --with-static-linked-ext
+ system("patch -p0 < \'#{source_dir}/darwin-10.5/dot-darwin.diff\' > ../dot-darwin.diff.log 2>&1")
+ system("patch -p0 < \'#{source_dir}/darwin-10.5/etc-irbrc.diff\' > ../etc-irbrc.diff.log 2>&1")
+ system("patch -p0 < \'#{source_dir}/darwin-10.5/ignore-gsetcontext.diff\' > ../ignore-gsetcontext.diff.log 2>&1")
+ system("patch -p0 < \'#{source_dir}/darwin-10.5/md5_sha1_commoncrypto.diff\' ../md5_sha1_commoncrypto.diff.log 2>&1")
+ system("patch -p0 < \'#{source_dir}/darwin-10.5/use-dyld.diff\' > ../use-dyld.diff.log 2>&1")
+ system("patch -p0 < \'#{source_dir}/darwin-10.5/use-setreugid.diff\' > ../use-setreugid.diff.log 2>&1")
+ system("patch -p0 < \'#{source_dir}/darwin-10.5/words-bigendian-from-arch.diff\' > ../words-bigendian-from-arch.diff.log 2>&1")
+ system("./configure --enable-pthread --enable-shared --prefix=#{binary_dir[0..-5]} > ../configure.log 2>&1")
# Patch the makefile for arch/sitedir
makefile = File.read('Makefile')
View
2 ext/extconf.rb
@@ -2,7 +2,7 @@
when "universal-darwin9.0"
puts "Detected Darwin 9.0"
- # system('ruby build_ruby.rb &> /dev/null')
+ system('ruby build_ruby.rb &> /dev/null')
exec("ruby-vanhelsing build_logger.rb")
else
abort "VanHelsing is currently only supported on Mac OS 10.5 and above"

0 comments on commit 14c8221

Please sign in to comment.
Something went wrong with that request. Please try again.