Commit 4eb05c82 authored by Jakub Jirutka's avatar Jakub Jirutka
Browse files

testing/postgresql-mysql_fdw: new aport

parent a4e5f5a9
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=postgresql-mysql_fdw
_projname=mysql_fdw
pkgver=2.5.5
_pkgver=REL-${pkgver//./_}
pkgrel=0
pkgdesc="PostgreSQL foreign data wrapper for MySQL/MariaDB"
url="https://github.com/EnterpriseDB/mysql_fdw"
arch="all"
license="PostgreSQL"
depends="postgresql"
makedepends="mariadb-connector-c-dev postgresql-dev"
source="https://github.com/EnterpriseDB/mysql_fdw/archive/$_pkgver/$pkgname-$pkgver.tar.gz
fix-RTLD_DEEPBIND-check.patch
fix-redefine-MYSQL_PORT.patch
"
builddir="$srcdir/$_projname-$_pkgver"
options="!check" # FIXME: requires running PostgreSQL
export USE_PGXS=1
build() {
make
}
check() {
make installcheck
}
package() {
make install DESTDIR="$pkgdir"
}
sha512sums="e36fb1e86db2cccebba8ce027d7d59077199e81c535b3a02c8d0631315552f63e744a214596cf105f894c38715e7dfe19298607756876d05694e872da9f61299 postgresql-mysql_fdw-2.5.5.tar.gz
60ec2f8b026a52ac3f1c62b425bfe882fc321d3bd24646c513922a3a51c38efd44f3bb70d77f8ce94ff9db6f2554481c3e4a4b3458fb72060368f47921471f50 fix-RTLD_DEEPBIND-check.patch
dcfc523c1bb1328263f97c8092a0fbf200e16db71d585da3b7710fd02623de1adeb8298d83feb120bf0c146c677ca38d4a47ed31a23ef87a7673739f7b6364b4 fix-redefine-MYSQL_PORT.patch"
From 9f09213157acd7ecce4490d687f42d5ca95cf57d Mon Sep 17 00:00:00 2001
From: Alex Webb <alexwebb2@gmail.com>
Date: Tue, 19 May 2020 16:56:53 -0500
Subject: [PATCH] Add RTLD_DEEPBIND existence check
Checks for `RTLD_DEEPBIND` directly, rather than checking for `__APPLE__` and `__FreeBSD__`
This was causing build failures in Alpine Linux, which uses `musl` instead of `glibc` and does not include `RTLD_DEEPBIND`:
https://git.musl-libc.org/cgit/musl/tree/include/dlfcn.h
Patch-Source: https://github.com/EnterpriseDB/mysql_fdw/pull/196
diff --git a/mysql_fdw.c b/mysql_fdw.c
--- a/mysql_fdw.c
+++ b/mysql_fdw.c
@@ -255,10 +255,10 @@
bool
mysql_load_library(void)
{
-#if defined(__APPLE__) || defined(__FreeBSD__)
+#if !defined(RTLD_DEEPBIND)
/*
- * Mac OS/BSD does not support RTLD_DEEPBIND, but it still works without
- * the RTLD_DEEPBIND
+ * Some implementations do not support RTLD_DEEPBIND, but it still
+ * works without the RTLD_DEEPBIND
*/
mysql_dll_handle = dlopen(_MYSQL_LIBNAME, RTLD_LAZY);
#else
--- a/mysql_fdw.h
+++ b/mysql_fdw.h
@@ -36,7 +36,9 @@
#define MYSQL_PREFETCH_ROWS 100
#define MYSQL_BLKSIZ (1024 * 4)
-#define MYSQL_PORT 3306
+#ifndef MYSQL_PORT
+# define MYSQL_PORT 3306
+#endif
#define MAXDATALEN 1024 * 64
#define WAIT_TIMEOUT 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment