1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 18:55:29 +03:00
aports/community/ruby-pg_query/unbundle-deps.patch
2021-06-06 01:39:19 +02:00

28 lines
1,013 B
Diff

Link against system-provided libpg_query and xxhash, and respect our CFLAGS.
--- a/ext/pg_query/extconf.rb
+++ b/ext/pg_query/extconf.rb
@@ -5,9 +5,11 @@
require 'open-uri'
require 'pathname'
-$objs = Dir.glob(File.join(__dir__, '*.c')).map { |f| Pathname.new(f).sub_ext('.o').to_s }
+$CFLAGS << " #{ENV["CFLAGS"]}"
+$CFLAGS << " -O3" unless $CFLAGS[/-O\d/]
+$CFLAGS << " -Wall -fno-strict-aliasing -fwrapv -fstack-protector -Wno-unused-function -Wno-unused-variable"
-$CFLAGS << " -I#{File.join(__dir__, 'include')} -O3 -Wall -fno-strict-aliasing -fwrapv -fstack-protector -Wno-unused-function -Wno-unused-variable -g"
+$LDFLAGS << " -lpg_query -lxxhash"
SYMFILE = File.join(__dir__, 'pg_query_ruby.sym')
if RUBY_PLATFORM =~ /darwin/
--- a/ext/pg_query/pg_query_ruby.c
+++ b/ext/pg_query/pg_query_ruby.c
@@ -1,5 +1,5 @@
-#include "pg_query.h"
-#include "xxhash/xxhash.h"
+#include <pg_query.h>
+#include <xxhash.h>
#include <ruby.h>
void raise_ruby_parse_error(PgQueryProtobufParseResult result);