1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 03:05:48 +03:00
aports/community/libpg_query/unbundle-vendor-deps.patch
2021-06-06 01:38:25 +02:00

38 lines
1.6 KiB
Diff

Link against system provided protobuf-c and xxhash libraries.
--- a/Makefile
+++ b/Makefile
@@ -19,16 +19,18 @@
SONAME = lib$(TARGET).so.$(SOVERSION)
SOLIB = $(SONAME).$(LIB_VERSION_MINOR).$(LIB_VERSION_PATCH)
-SRC_FILES := $(wildcard src/*.c src/postgres/*.c) vendor/protobuf-c/protobuf-c.c vendor/xxhash/xxhash.c protobuf/pg_query.pb-c.c
+SRC_FILES := $(wildcard src/*.c src/postgres/*.c) protobuf/pg_query.pb-c.c
NOT_OBJ_FILES := src/pg_query_enum_defs.o src/pg_query_fingerprint_defs.o src/pg_query_fingerprint_conds.o src/pg_query_outfuncs_defs.o src/pg_query_outfuncs_conds.o src/pg_query_readfuncs_defs.o src/pg_query_readfuncs_conds.o src/postgres/guc-file.o src/postgres/scan.o src/pg_query_json_helper.o
OBJ_FILES := $(filter-out $(NOT_OBJ_FILES), $(SRC_FILES:.c=.o))
-override CFLAGS += -g -I. -I./vendor -I./src/postgres/include -Wall -Wno-unused-function -Wno-unused-value -Wno-unused-variable -fno-strict-aliasing -fwrapv -fPIC
+LIBS = -lxxhash -lprotobuf-c
+
+override CFLAGS += -g -I. -I./src/postgres/include -Wall -Wno-unused-function -Wno-unused-value -Wno-unused-variable -fno-strict-aliasing -fwrapv -fPIC
override PG_CONFIGURE_FLAGS += -q --without-readline --without-zlib
-override TEST_CFLAGS += -I. -I./vendor -g
-override TEST_LDFLAGS += -pthread
+override TEST_CFLAGS += -I. -g
+override TEST_LDFLAGS += -pthread $(LIBS)
CFLAGS_OPT_LEVEL = -O3
ifeq ($(DEBUG),1)
--- a/src/pg_query_fingerprint.c
+++ b/src/pg_query_fingerprint.c
@@ -7,7 +7,7 @@
#include "pg_query_fingerprint.h"
#include "postgres.h"
-#include "xxhash/xxhash.h"
+#include <xxhash.h>
#include "lib/ilist.h"
#include "parser/parser.h"