summaryrefslogtreecommitdiff
path: root/databases/rubygem-gitlab-pg_query
diff options
context:
space:
mode:
authorMatthias Fechner <mfechner@FreeBSD.org>2020-11-21 08:07:20 +0000
committerMatthias Fechner <mfechner@FreeBSD.org>2020-11-21 08:07:20 +0000
commit4b27333610f2daf9db640abe817651ef8a07a463 (patch)
treecaf59e18eb607271f416e3c5deb0af0b582edf0f /databases/rubygem-gitlab-pg_query
parentnet/liveMedia: update to 2020.11.20 (diff)
New ports required for gitlab-ce 13.6 upgrade.
Diffstat (limited to 'databases/rubygem-gitlab-pg_query')
-rw-r--r--databases/rubygem-gitlab-pg_query/Makefile24
-rw-r--r--databases/rubygem-gitlab-pg_query/distinfo3
-rw-r--r--databases/rubygem-gitlab-pg_query/files/patch-ext_pg__query_extconf.rb39
-rw-r--r--databases/rubygem-gitlab-pg_query/pkg-descr7
4 files changed, 73 insertions, 0 deletions
diff --git a/databases/rubygem-gitlab-pg_query/Makefile b/databases/rubygem-gitlab-pg_query/Makefile
new file mode 100644
index 000000000000..c4721c305c17
--- /dev/null
+++ b/databases/rubygem-gitlab-pg_query/Makefile
@@ -0,0 +1,24 @@
+# Created by: Matthias Fechner <mfechner@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= gitlab-pg_query
+PORTVERSION= 1.3.0
+CATEGORIES= databases rubygems
+MASTER_SITES= RG
+
+MAINTAINER= mfechner@FreeBSD.org
+COMMENT= Parses SQL queries using a copy of the PostgreSQL server query parser
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${LOCALBASE}/lib/libpg_query.a:databases/libpg_query
+
+USES= gem
+USE_RUBY= yes
+
+#CONFIGURE_ARGS= --with-pgsql-include-dir=`${PG_CONFIG} --includedir` \
+# --with-pgsql-lib-dir=`${PG_CONFIG} --libdir`
+#PG_CONFIG= ${LOCALBASE}/bin/pg_config
+
+.include <bsd.port.mk>
diff --git a/databases/rubygem-gitlab-pg_query/distinfo b/databases/rubygem-gitlab-pg_query/distinfo
new file mode 100644
index 000000000000..f8775c785407
--- /dev/null
+++ b/databases/rubygem-gitlab-pg_query/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1605910010
+SHA256 (rubygem/gitlab-pg_query-1.3.0.gem) = 98c66602fdf054dc57dff8b91925e57fa7b43015c9c699dc6f6d6de31fd27f77
+SIZE (rubygem/gitlab-pg_query-1.3.0.gem) = 35328
diff --git a/databases/rubygem-gitlab-pg_query/files/patch-ext_pg__query_extconf.rb b/databases/rubygem-gitlab-pg_query/files/patch-ext_pg__query_extconf.rb
new file mode 100644
index 000000000000..f5947a5ce0df
--- /dev/null
+++ b/databases/rubygem-gitlab-pg_query/files/patch-ext_pg__query_extconf.rb
@@ -0,0 +1,39 @@
+--- ext/pg_query/extconf.rb.orig 2020-11-20 23:41:38 UTC
++++ ext/pg_query/extconf.rb
+@@ -10,22 +10,22 @@ libdir = File.join(workdir, 'libpg_query-' + LIB_PG_QU
+ gemdir = File.join(__dir__, '../..')
+ libfile = libdir + '/libpg_query.a'
+
+-unless File.exist?("#{workdir}/libpg_query.tar.gz")
+- File.open("#{workdir}/libpg_query.tar.gz", 'wb') do |target_file|
+- open("https://gitlab.com/gitlab-org/libpg_query/-/archive/#{LIB_PG_QUERY_TAG}/libpg_query-#{LIB_PG_QUERY_TAG}.tar.gz", 'rb') do |read_file|
+- target_file.write(read_file.read)
+- end
+- end
+-end
++#unless File.exist?("#{workdir}/libpg_query.tar.gz")
++# File.open("#{workdir}/libpg_query.tar.gz", 'wb') do |target_file|
++# open("https://gitlab.com/gitlab-org/libpg_query/-/archive/#{LIB_PG_QUERY_TAG}/libpg_query-#{LIB_PG_QUERY_TAG}.tar.gz", 'rb') do |read_file|
++# target_file.write(read_file.read)
++# end
++# end
++#end
+
+-unless Dir.exist?(libdir)
+- system("tar -xzf #{workdir}/libpg_query.tar.gz") || raise('ERROR')
+-end
++#unless Dir.exist?(libdir)
++# system("tar -xzf #{workdir}/libpg_query.tar.gz") || raise('ERROR')
++#end
+
+-unless Dir.exist?(libfile)
+- # Build libpg_query (and parts of PostgreSQL)
+- system("cd #{libdir}; #{ENV['MAKE'] || (RUBY_PLATFORM =~ /bsd/ ? 'gmake' : 'make')} build")
+-end
++#unless Dir.exist?(libfile)
++# # Build libpg_query (and parts of PostgreSQL)
++# system("cd #{libdir}; #{ENV['MAKE'] || (RUBY_PLATFORM =~ /bsd/ ? 'gmake' : 'make')} build")
++#end
+
+ # Copy test files (this intentionally overwrites existing files!)
+ system("cp #{libdir}/testdata/* #{gemdir}/spec/files/")
diff --git a/databases/rubygem-gitlab-pg_query/pkg-descr b/databases/rubygem-gitlab-pg_query/pkg-descr
new file mode 100644
index 000000000000..7a86795e7fa5
--- /dev/null
+++ b/databases/rubygem-gitlab-pg_query/pkg-descr
@@ -0,0 +1,7 @@
+This Ruby extension uses the actual PostgreSQL server source
+to parse SQL queries and return the internal PostgreSQL parsetree.
+
+In addition the extension allows you to normalize queries (replacing constant
+values with ?) and parse these normalized queries into a parsetree again.
+
+WWW: https://github.com/lfittl/pg_query