summaryrefslogtreecommitdiff
path: root/databases
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2010-09-10 04:42:58 +0000
committertaca <taca@pkgsrc.org>2010-09-10 04:42:58 +0000
commit74e92f1121ba0dae8dcf3ba8752699de29f146c7 (patch)
treebe8ac26c492924fba98077033968ec249e45de86 /databases
parent787e76dc410d9f1b623ff0e819416db05c25de64 (diff)
downloadpkgsrc-74e92f1121ba0dae8dcf3ba8752699de29f146c7.tar.gz
* Use lang/ruby/gem.mk instead of misc/rubygems/rubygem.mk.
* Update HOMEPAGE. * Add LICENSE. * Remove default value of GEM_BUILD. * Add patches for supporting ruby19.
Diffstat (limited to 'databases')
-rw-r--r--databases/ruby-postgresql/Makefile11
-rw-r--r--databases/ruby-postgresql/distinfo4
-rw-r--r--databases/ruby-postgresql/patches/patch-aa22
-rw-r--r--databases/ruby-postgresql/patches/patch-ab102
4 files changed, 134 insertions, 5 deletions
diff --git a/databases/ruby-postgresql/Makefile b/databases/ruby-postgresql/Makefile
index 9d0bceb4fc9..7168e0251ae 100644
--- a/databases/ruby-postgresql/Makefile
+++ b/databases/ruby-postgresql/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2010/02/10 19:34:06 joerg Exp $
+# $NetBSD: Makefile,v 1.36 2010/09/10 04:42:58 taca Exp $
DISTNAME= postgres-0.7.9.2008.01.28
PKGNAME= ${RUBY_PKGPREFIX}-${DISTNAME:C/postgres/&ql/}
@@ -6,13 +6,16 @@ PKGREVISION= 1
CATEGORIES= databases
MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://rubyforge.org/projects/ruby-pg/
+HOMEPAGE= http://bitbucket.org/ged/ruby-pg/
COMMENT= Ruby extension for PostgreSQL
+LICENSE= gnu-gpl-v2 OR ruby-license
-GEM_BUILD= gemspec
CONFIGURE_ARGS= --with-pgsql-include-dir=${PGSQL_PREFIX}/include/postgresql \
--with-pgsql-lib-dir=${PGSQL_PREFIX}/lib
-.include "../../misc/rubygems/rubygem.mk"
+pre-configure:
+ chmod -R g-w ${WRKSRC}
+
+.include "../../lang/ruby/gem.mk"
.include "../../mk/pgsql.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/databases/ruby-postgresql/distinfo b/databases/ruby-postgresql/distinfo
index e50a1d94ea0..54df1474552 100644
--- a/databases/ruby-postgresql/distinfo
+++ b/databases/ruby-postgresql/distinfo
@@ -1,5 +1,7 @@
-$NetBSD: distinfo,v 1.7 2008/04/04 15:16:02 jlam Exp $
+$NetBSD: distinfo,v 1.8 2010/09/10 04:42:58 taca Exp $
SHA1 (postgres-0.7.9.2008.01.28.gem) = 229ca3c503cda8a0977cd6e6d41896da7b8d5ecc
RMD160 (postgres-0.7.9.2008.01.28.gem) = 2473b4225802a49fd56a5adac702dc89d6cd19ba
Size (postgres-0.7.9.2008.01.28.gem) = 32768 bytes
+SHA1 (patch-aa) = 50263d107921a1733d57a276bac2c88b15785c03
+SHA1 (patch-ab) = a43bb1f31ddc90103f9dac11f7a2d326218b6f61
diff --git a/databases/ruby-postgresql/patches/patch-aa b/databases/ruby-postgresql/patches/patch-aa
new file mode 100644
index 00000000000..cd9e8f197ae
--- /dev/null
+++ b/databases/ruby-postgresql/patches/patch-aa
@@ -0,0 +1,22 @@
+$NetBSD: patch-aa,v 1.1 2010/09/10 04:42:58 taca Exp $
+
+Don't use deprecated constant PLATFORM, use RUBY_PLATFORM.
+
+--- ext/extconf.rb.orig 2010-08-27 23:28:37.000000000 +0000
++++ ext/extconf.rb
+@@ -1,13 +1,13 @@
+
+
+ # windows compatibility, need different library name
+-if(PLATFORM =~ /mingw|mswin/) then
++if(RUBY_PLATFORM =~ /mingw|mswin/) then
+ $libname = '/ms/libpq'
+ else
+ $libname = 'pq'
+ end
+
+-if(PLATFORM =~ /darwin/) then
++if(RUBY_PLATFORM =~ /darwin/) then
+ # test if postgresql is probably universal
+ bindir = (IO.popen("pg_config --bindir").readline.chomp rescue nil)
+ filetype = (IO.popen("file #{bindir}/pg_config").
diff --git a/databases/ruby-postgresql/patches/patch-ab b/databases/ruby-postgresql/patches/patch-ab
new file mode 100644
index 00000000000..8593cf67320
--- /dev/null
+++ b/databases/ruby-postgresql/patches/patch-ab
@@ -0,0 +1,102 @@
+$NetBSD: patch-ab,v 1.1 2010/09/10 04:42:58 taca Exp $
+
+Use modern Ruby's API.
+
+--- ext/postgres.c.orig 2010-08-28 00:00:42.000000000 +0000
++++ ext/postgres.c
+@@ -192,7 +192,7 @@ pgconn_connect(argc, argv, self)
+ PGconn *conn = NULL;
+
+ rb_scan_args(argc, argv, "0*", &args);
+- if (RARRAY(args)->len == 1) {
++ if (RARRAY_LEN(args) == 1) {
+ conn = try_connectdb(rb_ary_entry(args, 0));
+ }
+ if (conn == NULL) {
+@@ -720,14 +720,14 @@ pgconn_exec(argc, argv, obj)
+
+ Check_Type(command, T_STRING);
+
+- if (RARRAY(params)->len <= 0) {
++ if (RARRAY_LEN(params) <= 0) {
+ result = PQexec(conn, StringValuePtr(command));
+ }
+ else {
+- int len = RARRAY(params)->len;
++ int len = RARRAY_LEN(params);
+ int i;
+ #ifdef HAVE_PQEXECPARAMS
+- VALUE* ptr = RARRAY(params)->ptr;
++ VALUE* ptr = RARRAY_PTR(params);
+ char const** values = ALLOCA_N(char const*, len);
+ int* lengths = ALLOCA_N(int, len);
+ int* formats = ALLOCA_N(int, len);
+@@ -947,9 +947,9 @@ pgconn_insert_table(obj, table, values)
+
+ Check_Type(table, T_STRING);
+ Check_Type(values, T_ARRAY);
+- i = RARRAY(values)->len;
++ i = RARRAY_LEN(values);
+ while (i--) {
+- if (TYPE(RARRAY(RARRAY(values)->ptr[i])) != T_ARRAY) {
++ if (TYPE(RARRAY(RARRAY_PTR(values)[i])) != T_ARRAY) {
+ rb_raise(rb_ePGError, "second arg must contain some kind of arrays.");
+ }
+ }
+@@ -964,15 +964,15 @@ pgconn_insert_table(obj, table, values)
+ }
+ PQclear(result);
+
+- for (i = 0; i < RARRAY(values)->len; i++) {
+- struct RArray *row = RARRAY(RARRAY(values)->ptr[i]);
++ for (i = 0; i < RARRAY_LEN(values); i++) {
++ struct RArray *row = RARRAY(RARRAY_PTR(values)[i]);
+ buffer = rb_tainted_str_new(0,0);
+- for (j = 0; j < row->len; j++) {
++ for (j = 0; j < RARRAY_LEN(row); j++) {
+ if (j > 0) rb_str_cat(buffer, "\t", 1);
+- if (NIL_P(row->ptr[j])) {
++ if (NIL_P(RARRAY_PTR(row)[j])) {
+ rb_str_cat(buffer, "\\N",2);
+ } else {
+- s = rb_obj_as_string(row->ptr[j]);
++ s = rb_obj_as_string(RARRAY_PTR(row)[j]);
+ rb_funcall(s,pg_gsub_bang_id,2,
+ rb_str_new("([\\t\\n\\\\])", 10),pg_escape_str);
+ rb_str_cat(buffer, StringValuePtr(s), RSTRING_LEN(s));
+@@ -1482,7 +1482,7 @@ fetch_pgrow(self, fields, row_num)
+ PGresult *result = get_pgresult(self);
+ VALUE row = rb_funcall(rb_cPGrow, rb_intern("new"), 1, fields);
+ int field_num;
+- for (field_num = 0; field_num < RARRAY(fields)->len; field_num++) {
++ for (field_num = 0; field_num < RARRAY_LEN(fields); field_num++) {
+ /* don't use push, PGrow is sized with nils in #new */
+ rb_ary_store(row, field_num, fetch_pgresult(result, row_num, field_num));
+ }
+@@ -2417,7 +2417,7 @@ static VALUE
+ pgrow_init(self, keys)
+ VALUE self, keys;
+ {
+- VALUE args[1] = { LONG2NUM(RARRAY(keys)->len) };
++ VALUE args[1] = { LONG2NUM(RARRAY_LEN(keys)) };
+ rb_call_super(1, args);
+ rb_iv_set(self, "@keys", keys);
+ return self;
+@@ -2501,7 +2501,7 @@ pgrow_each_pair(self)
+ {
+ VALUE keys = pgrow_keys(self);
+ int i;
+- for (i = 0; i < RARRAY(keys)->len; ++i) {
++ for (i = 0; i < RARRAY_LEN(keys); ++i) {
+ rb_yield(rb_assoc_new(rb_ary_entry(keys, i), rb_ary_entry(self, i)));
+ }
+ return self;
+@@ -2556,7 +2556,7 @@ pgrow_to_hash(self)
+ VALUE result = rb_hash_new();
+ VALUE keys = pgrow_keys(self);
+ int i;
+- for (i = 0; i < RARRAY(self)->len; ++i) {
++ for (i = 0; i < RARRAY_LEN(self); ++i) {
+ rb_hash_aset(result, rb_ary_entry(keys, i), rb_ary_entry(self, i));
+ }
+ return result;