diff --git a/dev-lang/ruby/patches/ruby-1.9.1.patch b/dev-lang/ruby/patches/ruby-1.9.1.patch index 5bc61bcfc..91ea08562 100644 --- a/dev-lang/ruby/patches/ruby-1.9.1.patch +++ b/dev-lang/ruby/patches/ruby-1.9.1.patch @@ -1,7 +1,8 @@ -diff -ur ruby-1.9.1-p243/configure.in ruby-1.9.1-p243-haiku/configure.in ---- ruby-1.9.1-p243/configure.in 2009-10-27 21:03:32.000000000 -0600 -+++ ruby-1.9.1-p243-haiku/configure.in 2009-10-27 21:03:25.000000000 -0600 -@@ -1466,7 +1466,7 @@ +diff -up ruby-1.9.1-p243/ChangeLog.orig ruby-1.9.1-p243/ChangeLog +diff -up ruby-1.9.1-p243/configure.in.orig ruby-1.9.1-p243/configure.in +--- ruby-1.9.1-p243/configure.in.orig 2009-05-11 09:06:48.039321600 -0600 ++++ ruby-1.9.1-p243/configure.in 2010-04-18 22:19:16.236716032 -0600 +@@ -1466,7 +1466,7 @@ if test "$with_dln_a_out" != yes; then ;; i586*) : ${LDSHARED="ld -shared"} @@ -10,10 +11,31 @@ diff -ur ruby-1.9.1-p243/configure.in ruby-1.9.1-p243-haiku/configure.in ;; esac : ${LIBPATHENV=LIBRARY_PATH} -diff -ur ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h ruby-1.9.1-p243-haiku/ext/nkf/nkf-utf8/nkf.h ---- ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h 2008-11-11 01:41:20.000000000 -0700 -+++ ruby-1.9.1-p243-haiku/ext/nkf/nkf-utf8/nkf.h 2009-10-26 15:14:01.000000000 -0600 -@@ -164,6 +164,11 @@ +diff -up ruby-1.9.1-p243/signal.c.orig ruby-1.9.1-p243/signal.c +--- ruby-1.9.1-p243/signal.c.orig 2009-02-22 02:48:12.003932160 -0700 ++++ ruby-1.9.1-p243/signal.c 2010-04-18 22:19:16.291766272 -0600 +@@ -34,7 +34,7 @@ typedef int rb_atomic_t; + # define ATOMIC_DEC(var) (--(var)) + #endif + +-#ifdef __BEOS__ ++#if defined __BEOS__ || defined __HAIKU__ + #undef SIGBUS + #endif + +@@ -586,7 +586,7 @@ static int segv_received = 0; + static RETSIGTYPE + sigsegv(int sig SIGINFO_ARG) + { +-#ifdef USE_SIGALTSTACK ++#if defined USE_SIGALTSTACK && defined SA_SIGINFO + int ruby_stack_overflowed_p(const rb_thread_t *, const void *); + NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th)); + rb_thread_t *th = GET_THREAD(); +diff -up ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h.orig ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h +--- ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h.orig 2008-11-11 01:41:20.044564480 -0700 ++++ ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h 2010-04-18 22:19:16.276037632 -0600 +@@ -164,6 +164,11 @@ void setbinmode(FILE *fp) # ifndef HAVE_LOCALE_H # define HAVE_LOCALE_H # endif @@ -25,24 +47,198 @@ diff -ur ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h ruby-1.9.1-p243-haiku/ext/nkf/nk #else # ifndef HAVE_LANGINFO_H # define HAVE_LANGINFO_H -diff -ur ruby-1.9.1-p243/signal.c ruby-1.9.1-p243-haiku/signal.c ---- ruby-1.9.1-p243/signal.c 2009-02-22 02:48:12.000000000 -0700 -+++ ruby-1.9.1-p243-haiku/signal.c 2009-10-26 15:03:07.000000000 -0600 -@@ -34,7 +34,7 @@ - # define ATOMIC_DEC(var) (--(var)) - #endif +diff -up ruby-1.9.1-p243/ext/openssl/ossl.c.orig ruby-1.9.1-p243/ext/openssl/ossl.c +--- ruby-1.9.1-p243/ext/openssl/ossl.c.orig 2009-01-15 08:39:30.047448064 -0700 ++++ ruby-1.9.1-p243/ext/openssl/ossl.c 2010-04-18 22:57:15.778305536 -0600 +@@ -92,7 +92,7 @@ ossl_x509_ary2sk(VALUE ary) --#ifdef __BEOS__ -+#if defined __BEOS__ || defined __HAIKU__ - #undef SIGBUS - #endif + #define OSSL_IMPL_SK2ARY(name, type) \ + VALUE \ +-ossl_##name##_sk2ary(STACK *sk) \ ++ossl_##name##_sk2ary(STACK_OF(type) *sk) \ + { \ + type *t; \ + int i, num; \ +@@ -102,7 +102,7 @@ ossl_##name##_sk2ary(STACK *sk) \ + OSSL_Debug("empty sk!"); \ + return Qnil; \ + } \ +- num = sk_num(sk); \ ++ num = sk_##type##_num(sk); \ + if (num < 0) { \ + OSSL_Debug("items in sk < -1???"); \ + return rb_ary_new(); \ +@@ -110,7 +110,7 @@ ossl_##name##_sk2ary(STACK *sk) \ + ary = rb_ary_new2(num); \ + \ + for (i=0; i= 0x10000000L ++#define STACK _STACK ++#endif ++ ++/* + * String to HEXString conversion + */ + int string2hex(const unsigned char *, int, char **, int *); +diff -up ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c.orig ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c +--- ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c.orig 2008-07-22 09:34:23.050069504 -0600 ++++ ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c 2010-04-18 22:57:15.864550912 -0600 +@@ -572,12 +572,11 @@ ossl_pkcs7_add_certificate(VALUE self, V + return self; + } + +-static STACK * +-pkcs7_get_certs_or_crls(VALUE self, int want_certs) ++static STACK_OF(X509) * ++pkcs7_get_certs(VALUE self) { --#ifdef USE_SIGALTSTACK -+#if defined USE_SIGALTSTACK && defined SA_SIGINFO - int ruby_stack_overflowed_p(const rb_thread_t *, const void *); - NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th)); - rb_thread_t *th = GET_THREAD(); + PKCS7 *pkcs7; + STACK_OF(X509) *certs; +- STACK_OF(X509_CRL) *crls; + int i; + + GetPKCS7(self, pkcs7); +@@ -585,17 +584,38 @@ pkcs7_get_certs_or_crls(VALUE self, int + switch(i){ + case NID_pkcs7_signed: + certs = pkcs7->d.sign->cert; +- crls = pkcs7->d.sign->crl; + break; + case NID_pkcs7_signedAndEnveloped: + certs = pkcs7->d.signed_and_enveloped->cert; ++ break; ++ default: ++ certs = NULL; ++ } ++ ++ return certs; ++} ++ ++static STACK_OF(X509_CRL) * ++pkcs7_get_crls(VALUE self) ++{ ++ PKCS7 *pkcs7; ++ STACK_OF(X509_CRL) *crls; ++ int i; ++ ++ GetPKCS7(self, pkcs7); ++ i = OBJ_obj2nid(pkcs7->type); ++ switch(i){ ++ case NID_pkcs7_signed: ++ crls = pkcs7->d.sign->crl; ++ break; ++ case NID_pkcs7_signedAndEnveloped: + crls = pkcs7->d.signed_and_enveloped->crl; + break; + default: +- certs = crls = NULL; ++ crls = NULL; + } + +- return want_certs ? certs : crls; ++ return crls; + } + + static VALUE +@@ -610,7 +630,7 @@ ossl_pkcs7_set_certificates(VALUE self, + STACK_OF(X509) *certs; + X509 *cert; + +- certs = pkcs7_get_certs_or_crls(self, 1); ++ certs = pkcs7_get_certs(self); + while((cert = sk_X509_pop(certs))) X509_free(cert); + rb_block_call(ary, rb_intern("each"), 0, 0, ossl_pkcs7_set_certs_i, self); + +@@ -620,7 +640,7 @@ ossl_pkcs7_set_certificates(VALUE self, + static VALUE + ossl_pkcs7_get_certificates(VALUE self) + { +- return ossl_x509_sk2ary(pkcs7_get_certs_or_crls(self, 1)); ++ return ossl_x509_sk2ary(pkcs7_get_certs(self)); + } + + static VALUE +@@ -650,7 +670,7 @@ ossl_pkcs7_set_crls(VALUE self, VALUE ar + STACK_OF(X509_CRL) *crls; + X509_CRL *crl; + +- crls = pkcs7_get_certs_or_crls(self, 0); ++ crls = pkcs7_get_crls(self); + while((crl = sk_X509_CRL_pop(crls))) X509_CRL_free(crl); + rb_block_call(ary, rb_intern("each"), 0, 0, ossl_pkcs7_set_crls_i, self); + +@@ -660,7 +680,7 @@ ossl_pkcs7_set_crls(VALUE self, VALUE ar + static VALUE + ossl_pkcs7_get_crls(VALUE self) + { +- return ossl_x509crl_sk2ary(pkcs7_get_certs_or_crls(self, 0)); ++ return ossl_x509crl_sk2ary(pkcs7_get_crls(self)); + } + + static VALUE +diff -up ruby-1.9.1-p243/ext/openssl/ossl_ssl.c.orig ruby-1.9.1-p243/ext/openssl/ossl_ssl.c +--- ruby-1.9.1-p243/ext/openssl/ossl_ssl.c.orig 2009-04-19 07:32:18.051118080 -0600 ++++ ruby-1.9.1-p243/ext/openssl/ossl_ssl.c 2010-04-18 22:57:15.747634688 -0600 +@@ -1195,10 +1195,10 @@ ossl_ssl_get_peer_cert_chain(VALUE self) + } + chain = SSL_get_peer_cert_chain(ssl); + if(!chain) return Qnil; +- num = sk_num(chain); ++ num = sk_X509_num(chain); + ary = rb_ary_new2(num); + for (i = 0; i < num; i++){ +- cert = (X509*)sk_value(chain, i); ++ cert = sk_X509_value(chain, i); + rb_ary_push(ary, ossl_x509_new(cert)); + } + +diff -up ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c.orig ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c +--- ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c.orig 2008-08-28 21:19:15.051904512 -0600 ++++ ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c 2010-04-18 22:57:15.719585280 -0600 +@@ -218,8 +218,9 @@ ossl_x509attr_get_value(VALUE self) + ossl_str_adjust(str, p); + } + else{ +- length = i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, NULL, +- i2d_ASN1_TYPE, V_ASN1_SET, V_ASN1_UNIVERSAL, 0); ++ length = i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, ++ (unsigned char **) NULL, i2d_ASN1_TYPE, ++ V_ASN1_SET, V_ASN1_UNIVERSAL, 0); + str = rb_str_new(0, length); + p = (unsigned char *)RSTRING_PTR(str); + i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, &p, +diff -up ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c.orig ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c +--- ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c.orig 2008-07-22 09:34:23.052166656 -0600 ++++ ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c 2010-04-18 22:57:15.824180736 -0600 +@@ -264,7 +264,7 @@ ossl_x509crl_get_revoked(VALUE self) + VALUE ary, revoked; + + GetX509CRL(self, crl); +- num = sk_X509_CRL_num(X509_CRL_get_REVOKED(crl)); ++ num = sk_X509_REVOKED_num(X509_CRL_get_REVOKED(crl)); + if (num < 0) { + OSSL_Debug("num < 0???"); + return rb_ary_new(); +@@ -272,7 +272,7 @@ ossl_x509crl_get_revoked(VALUE self) + ary = rb_ary_new2(num); + for(i=0; i