Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
pkgname=ruby18
pkgver=1.8.7_p249
_pkgver=1.8.7-p249
pkgrel=1
pkgdesc="An object-oriented language for quick and easy programming"
arch=('i686' 'x86_64')
license=('custom')
url="http://www.ruby-lang.org/en/"
depends=('gdbm>=1.8.3' 'db>=4.7.25' 'openssl>=1.0.0' 'zlib>=1.2.3.3' 'readline>=6')
makedepends=('tk>=8.5')
source=("ftp://ftp.ruby-lang.org/pub/ruby/stable/ruby-${_pkgver}.tar.bz2" "ruby-ssl-1.0.patch")
options=('!emptydirs')
md5sums=('37200cc956a16996bbfd25bb4068f242'
'972fb0af6342b5ee18fefff28ed02c50')
build() {
cd "${srcdir}/ruby-${_pkgver}"
# fix errors on OpenSSL 1.0
patch -Np1 -i ${srcdir}/ruby-ssl-1.0.patch || return 1
./configure --prefix=/usr --enable-shared --enable-pthread --program-suffix=18|| return 1
make || return 1
make DESTDIR="${pkgdir}" install || return 1
make DESTDIR="${pkgdir}" install-doc || return 1
install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING" || return 1
}
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index 6e7e523..7e36a3e 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -92,7 +92,7 @@ ossl_x509_ary2sk(VALUE ary)
#define OSSL_IMPL_SK2ARY(name, type) \
VALUE \
-ossl_##name##_sk2ary(STACK *sk) \
+ossl_##name##_sk2ary(STACK_OF(type) *sk) \
{ \
type *t; \
int i, num; \
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index 09bf1bb..3b5d7d2 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -570,7 +570,7 @@ ossl_pkcs7_add_certificate(VALUE self, VALUE cert)
return self;
}
-static STACK *
+static STACK_OF(X509) *
pkcs7_get_certs_or_crls(VALUE self, int want_certs)
{
PKCS7 *pkcs7;
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 1d1eb34..6fd4bbf 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -623,10 +623,10 @@ ossl_sslctx_get_ciphers(VALUE self)
if (!ciphers)
return rb_ary_new();
- num = sk_num((STACK*)ciphers);
+ num = sk_num((STACK_OF(SSL_CIPHER)*)ciphers);
ary = rb_ary_new2(num);
for(i = 0; i < num; i++){
- cipher = (SSL_CIPHER*)sk_value((STACK*)ciphers, i);
+ cipher = (SSL_CIPHER*)sk_value((STACK_OF(SSL_CIPHER)*)ciphers, i);
rb_ary_push(ary, ossl_ssl_cipher_to_ary(cipher));
}
return ary;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment