From owner-svn-ports-head@freebsd.org Sun Aug 18 13:23:41 2019 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9334CC7749; Sun, 18 Aug 2019 13:23:41 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46BHnT3M9fz4XMJ; Sun, 18 Aug 2019 13:23:41 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54F2F2996; Sun, 18 Aug 2019 13:23:41 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7IDNfXZ070614; Sun, 18 Aug 2019 13:23:41 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7IDNe66070610; Sun, 18 Aug 2019 13:23:40 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201908181323.x7IDNe66070610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Sun, 18 Aug 2019 13:23:40 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r509207 - in head/databases/postgresql-plruby: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: in head/databases/postgresql-plruby: . files X-SVN-Commit-Revision: 509207 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2019 13:23:41 -0000 Author: tobik Date: Sun Aug 18 13:23:40 2019 New Revision: 509207 URL: https://svnweb.freebsd.org/changeset/ports/509207 Log: databases/postgresql-plruby: Unbreak build with PostgreSQL 11 ============================================================ PostgreSQL 11.4 is unsupported. Try plruby-0.4.2. ============================================================ *** Error code 1 http://package18.nyi.freebsd.org/data/120amd64-default-PR239514/2019-07-29_20h41m52s/logs/postgresql-plruby-0.5.7_4.log While here deprecate it since it seems to have been abandoned in 2010. PR: 239639 Approved by: knu (maintainer timeout, 2 weeks) Added: head/databases/postgresql-plruby/files/patch-src_plpl.c (contents, props changed) head/databases/postgresql-plruby/files/patch-src_plruby.c (contents, props changed) Modified: head/databases/postgresql-plruby/Makefile head/databases/postgresql-plruby/files/patch-extconf.rb Modified: head/databases/postgresql-plruby/Makefile ============================================================================== --- head/databases/postgresql-plruby/Makefile Sun Aug 18 13:03:57 2019 (r509206) +++ head/databases/postgresql-plruby/Makefile Sun Aug 18 13:23:40 2019 (r509207) @@ -13,6 +13,8 @@ COMMENT= PL/Ruby procedural language for the PostgreSQ LICENSE= BSD2CLAUSE RUBY LICENSE_COMB= dual +DEPRECATED= Abandonware +EXPIRATION_DATE= 2019-09-15 BROKEN_powerpc64= fails to build: ruby.h:628:35: call to 'ruby_safe_level_2_error' declared with attribute error: $SAFE=2 to 4 are obsolete USES= uidfix pgsql Modified: head/databases/postgresql-plruby/files/patch-extconf.rb ============================================================================== --- head/databases/postgresql-plruby/files/patch-extconf.rb Sun Aug 18 13:03:57 2019 (r509206) +++ head/databases/postgresql-plruby/files/patch-extconf.rb Sun Aug 18 13:23:40 2019 (r509207) @@ -1,9 +1,11 @@ ---- extconf.rb.orig 2017-08-31 10:56:23 UTC +--- extconf.rb.orig 2017-05-28 08:47:01 UTC +++ extconf.rb -@@ -122,6 +122,8 @@ end +@@ -122,6 +122,10 @@ end case version_str = `#{pg_config} --version` when /^PostgreSQL ([7-9])\.([0-9]{1,3})(\.[0-9]{1,3})?$/ version = 10 * $1.to_i + $2.to_i ++when /^PostgreSQL 11/ ++ version = 110 +when /^PostgreSQL 10/ + version = 100 else Added: head/databases/postgresql-plruby/files/patch-src_plpl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/postgresql-plruby/files/patch-src_plpl.c Sun Aug 18 13:23:40 2019 (r509207) @@ -0,0 +1,151 @@ +--- src/plpl.c.orig 2019-08-04 04:35:14 UTC ++++ src/plpl.c +@@ -137,12 +137,21 @@ pl_query_name(VALUE obj) + } + res = rb_ary_new2(tpl->dsc->natts); + for (i = 0; i < tpl->dsc->natts; i++) { ++#if PG_VERSION_NUM < 110000 + if (tpl->dsc->attrs[i]->attisdropped) { + attname = ""; + } + else { + attname = NameStr(tpl->dsc->attrs[i]->attname); + } ++#else ++ if (TupleDescAttr(tpl->dsc, i)->attisdropped) { ++ attname = ""; ++ } ++ else { ++ attname = NameStr(TupleDescAttr(tpl->dsc, i)->attname); ++ } ++#endif + rb_ary_push(res, rb_tainted_str_new2(attname)); + } + return res; +@@ -178,6 +187,7 @@ pl_query_type(VALUE obj) + } + res = rb_ary_new2(tpl->dsc->natts); + for (i = 0; i < tpl->dsc->natts; i++) { ++#if PG_VERSION_NUM < 110000 + if (tpl->dsc->attrs[i]->attisdropped) + continue; + PLRUBY_BEGIN(1); +@@ -189,6 +199,19 @@ pl_query_type(VALUE obj) + rb_raise(pl_ePLruby, "Cache lookup for attribute '%s' type %ld failed", + attname, OidGD(tpl->dsc->attrs[i]->atttypid)); + } ++#else ++ if (TupleDescAttr(tpl->dsc, i)->attisdropped) ++ continue; ++ PLRUBY_BEGIN(1); ++ attname = NameStr(TupleDescAttr(tpl->dsc, i)->attname); ++ typeTup = SearchSysCache(TYPEOID, OidGD(TupleDescAttr(tpl->dsc, i)->atttypid), ++ 0, 0, 0); ++ PLRUBY_END; ++ if (!HeapTupleIsValid(typeTup)) { ++ rb_raise(pl_ePLruby, "Cache lookup for attribute '%s' type %ld failed", ++ attname, OidGD(TupleDescAttr(tpl->dsc, i)->atttypid)); ++ } ++#endif + fpgt = (Form_pg_type) GETSTRUCT(typeTup); + rb_ary_push(res, rb_tainted_str_new2(NameStr(fpgt->typname))); + ReleaseSysCache(typeTup); +@@ -588,14 +611,23 @@ pl_tuple_heap(VALUE c, VALUE tuple) + MEMZERO(nulls, char, RARRAY_LEN(c)); + for (i = 0; i < RARRAY_LEN(c); i++) { + if (NIL_P(RARRAY_PTR(c)[i]) || ++#if PG_VERSION_NUM < 110000 + tupdesc->attrs[i]->attisdropped) { ++#else ++ TupleDescAttr(tupdesc, i)->attisdropped) { ++#endif + dvalues[i] = (Datum)0; + nulls[i] = 'n'; + } + else { + nulls[i] = ' '; ++#if PG_VERSION_NUM < 110000 + typid = tupdesc->attrs[i]->atttypid; + if (tupdesc->attrs[i]->attndims != 0 || ++#else ++ typid = TupleDescAttr(tupdesc, i)->atttypid; ++ if (TupleDescAttr(tupdesc, i)->attndims != 0 || ++#endif + tpl->att->attinfuncs[i].fn_addr == (PGFunction)array_in) { + pl_proc_desc prodesc; + FmgrInfo func; +@@ -1088,6 +1120,7 @@ plruby_build_tuple(HeapTuple tuple, TupleDesc tupdesc, + } + + for (i = 0; i < tupdesc->natts; i++) { ++#if PG_VERSION_NUM < 110000 + if (tupdesc->attrs[i]->attisdropped) + continue; + PLRUBY_BEGIN(1); +@@ -1101,7 +1134,21 @@ plruby_build_tuple(HeapTuple tuple, TupleDesc tupdesc, + rb_raise(pl_ePLruby, "Cache lookup for attribute '%s' type %ld failed", + attname, OidGD(tupdesc->attrs[i]->atttypid)); + } ++#else ++ if (TupleDescAttr(tupdesc, i)->attisdropped) ++ continue; ++ PLRUBY_BEGIN(1); ++ attname = NameStr(TupleDescAttr(tupdesc, i)->attname); ++ attr = heap_getattr(tuple, i + 1, tupdesc, &isnull); ++ typeTup = SearchSysCache(TYPEOID, OidGD(TupleDescAttr(tupdesc, i)->atttypid), ++ 0, 0, 0); ++ PLRUBY_END; + ++ if (!HeapTupleIsValid(typeTup)) { ++ rb_raise(pl_ePLruby, "Cache lookup for attribute '%s' type %ld failed", ++ attname, OidGD(TupleDescAttr(tupdesc, i)->atttypid)); ++ } ++#endif + fpgt = (Form_pg_type) GETSTRUCT(typeTup); + typoutput = (Oid) (fpgt->typoutput); + #if PG_PL_VERSION >= 75 +@@ -1115,6 +1162,7 @@ plruby_build_tuple(HeapTuple tuple, TupleDesc tupdesc, + int alen; + + typname = NameStr(fpgt->typname); ++#if PG_VERSION_NUM < 110000 + alen = tupdesc->attrs[i]->attlen; + typeid = tupdesc->attrs[i]->atttypid; + if (strcmp(typname, "text") == 0) { +@@ -1129,6 +1177,22 @@ plruby_build_tuple(HeapTuple tuple, TupleDesc tupdesc, + alen = tupdesc->attrs[i]->atttypmod - 4; + } + } ++#else ++ alen = TupleDescAttr(tupdesc, i)->attlen; ++ typeid = TupleDescAttr(tupdesc, i)->atttypid; ++ if (strcmp(typname, "text") == 0) { ++ alen = -1; ++ } ++ else if (strcmp(typname, "bpchar") == 0 || ++ strcmp(typname, "varchar") == 0) { ++ if (TupleDescAttr(tupdesc, i)->atttypmod == -1) { ++ alen = 0; ++ } ++ else { ++ alen = TupleDescAttr(tupdesc, i)->atttypmod - 4; ++ } ++ } ++#endif + if ((type_ret & RET_DESC_ARR) == RET_DESC_ARR) { + res = rb_ary_new(); + rb_ary_push(res, rb_tainted_str_new2(attname)); +@@ -1190,8 +1254,13 @@ plruby_build_tuple(HeapTuple tuple, TupleDesc tupdesc, + + fmgr_info(typoutput, &finfo); + ++#if PG_VERSION_NUM < 110000 + s = pl_convert_arg(attr, tupdesc->attrs[i]->atttypid, + &finfo, typelem,tupdesc->attrs[i]->attlen); ++#else ++ s = pl_convert_arg(attr, tupdesc->attrs[i].atttypid, ++ &finfo, typelem, TupleDescAttr(tupdesc, i)->attlen); ++#endif + } + PLRUBY_END_PROTECT; + Added: head/databases/postgresql-plruby/files/patch-src_plruby.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/postgresql-plruby/files/patch-src_plruby.c Sun Aug 18 13:23:40 2019 (r509207) @@ -0,0 +1,74 @@ +--- src/plruby.c.orig 2019-08-04 04:30:44 UTC ++++ src/plruby.c +@@ -1184,17 +1184,29 @@ for_numvals(obj, argobj) + rb_raise(pl_ePLruby, "invalid attribute '%s'", RSTRING_PTR(key)); + } + attnum -= 1; ++#if PG_VERSION_NUM < 110000 + if (arg->tupdesc->attrs[attnum]->attisdropped) { ++#else ++ if (TupleDescAttr(arg->tupdesc, attnum)->attisdropped) { ++#endif + return Qnil; + } + + PLRUBY_BEGIN(1); + typeTup = SearchSysCache(TYPEOID, ++#if PG_VERSION_NUM < 110000 + OidGD(arg->tupdesc->attrs[attnum]->atttypid), ++#else ++ OidGD(TupleDescAttr(arg->tupdesc, attnum)->atttypid), ++#endif + 0, 0, 0); + if (!HeapTupleIsValid(typeTup)) { + rb_raise(pl_ePLruby, "Cache lookup for attribute '%s' type %ld failed", ++#if PG_VERSION_NUM < 110000 + RSTRING_PTR(key), OidGD(arg->tupdesc->attrs[attnum]->atttypid)); ++#else ++ RSTRING_PTR(key), OidGD(TupleDescAttr(arg->tupdesc, attnum)->atttypid)); ++#endif + } + fpg = (Form_pg_type) GETSTRUCT(typeTup); + ReleaseSysCache(typeTup); +@@ -1226,11 +1238,19 @@ for_numvals(obj, argobj) + else { + arg->modvalues[attnum] = + plruby_to_datum(value, &finfo, ++#if PG_VERSION_NUM < 110000 + arg->tupdesc->attrs[attnum]->atttypid, + fpg->typelem, + (!VARLENA_FIXED_SIZE(arg->tupdesc->attrs[attnum])) + ? arg->tupdesc->attrs[attnum]->attlen + : arg->tupdesc->attrs[attnum]->atttypmod); ++#else ++ TupleDescAttr(arg->tupdesc, attnum)->atttypid, ++ fpg->typelem, ++ (!VARLENA_FIXED_SIZE(TupleDescAttr(arg->tupdesc, attnum))) ++ ? TupleDescAttr(arg->tupdesc, attnum)->attlen ++ : TupleDescAttr(arg->tupdesc, attnum)->atttypmod); ++#endif + } + return Qnil; + } +@@ -1284,12 +1304,21 @@ pl_trigger_handler(struct pl_thread_st *plth) + + tmp = rb_ary_new2(tupdesc->natts); + for (i = 0; i < tupdesc->natts; i++) { ++#if PG_VERSION_NUM < 110000 + if (tupdesc->attrs[i]->attisdropped) { + rb_ary_push(tmp, rb_str_freeze_new2("")); + } + else { + rb_ary_push(tmp, rb_str_freeze_new2(NameStr(tupdesc->attrs[i]->attname))); + } ++#else ++ if (TupleDescAttr(tupdesc, i)->attisdropped) { ++ rb_ary_push(tmp, rb_str_freeze_new2("")); ++ } ++ else { ++ rb_ary_push(tmp, rb_str_freeze_new2(NameStr(TupleDescAttr(tupdesc, i)->attname))); ++ } ++#endif + } + rb_hash_aset(TG, rb_str_freeze_new2("relatts"), rb_ary_freeze(tmp)); +