Skip to content

Commit a36c1dd

Browse files
committed
Feature, Add mysql_fdw extension
1 parent 2043276 commit a36c1dd

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

nix/ext/mysql_fdw.nix

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{ lib, stdenv, fetchFromGitHub, postgresql, postgresqlTestHook, testers, libmysqlclient }:
2+
3+
stdenv.mkDerivation ( finalAttrs: {
4+
pname = "mysql_fdw";
5+
version = "REL-2_9_2";
6+
7+
buildInputs = [ postgresql libmysqlclient ];
8+
9+
src = fetchFromGitHub {
10+
owner = "EnterpriseDB";
11+
repo = finalAttrs.pname;
12+
rev = "refs/tags/${finalAttrs.version}"; # Tag corresponding to the version
13+
sha256 = "sha256-CLnSaV+pv+i/k1RlFmMVMK9hXWQkJvEim/xYghXv2cs=";
14+
};
15+
16+
makeFlags = [
17+
"USE_PGXS=1"
18+
];
19+
20+
21+
# can't find .so file on execution
22+
installPhase = ''
23+
mkdir -p $out/{lib,share/postgresql/extension}
24+
25+
cp *${postgresql.dlSuffix} $out/lib
26+
cp *.sql $out/share/postgresql/extension
27+
cp *.control $out/share/postgresql/extension
28+
29+
# Copy libmariadb.so.3 to the PostgreSQL dynamic extension library
30+
cp ${libmysqlclient}/lib/mariadb/libmariadb.so.3 $out/lib/libmysqlclient.so
31+
'';
32+
33+
meta = with lib; {
34+
description = "MySQL foreign data wrapper for PostgreSQL";
35+
homepage = "https://github.com/EnterpriseDB/mysql_fdw";
36+
changelog = "https://github.com/EnterpriseDB/mysql_fdw/releases/tags/${finalAttrs.version}";
37+
maintainers = with maintainers; [ thelazzziest ];
38+
inherit (postgresql.meta) platforms;
39+
license = licenses.postgresql;
40+
};
41+
})

0 commit comments

Comments
 (0)