Skip to content

Commit

Permalink
Feature, Add mysql_fdw extension
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLazzziest committed Jan 1, 2025
1 parent 2043276 commit a36c1dd
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions nix/ext/mysql_fdw.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ lib, stdenv, fetchFromGitHub, postgresql, postgresqlTestHook, testers, libmysqlclient }:

stdenv.mkDerivation ( finalAttrs: {
pname = "mysql_fdw";
version = "REL-2_9_2";

buildInputs = [ postgresql libmysqlclient ];

src = fetchFromGitHub {
owner = "EnterpriseDB";
repo = finalAttrs.pname;
rev = "refs/tags/${finalAttrs.version}"; # Tag corresponding to the version
sha256 = "sha256-CLnSaV+pv+i/k1RlFmMVMK9hXWQkJvEim/xYghXv2cs=";
};

makeFlags = [
"USE_PGXS=1"
];


# can't find .so file on execution
installPhase = ''
mkdir -p $out/{lib,share/postgresql/extension}
cp *${postgresql.dlSuffix} $out/lib
cp *.sql $out/share/postgresql/extension
cp *.control $out/share/postgresql/extension
# Copy libmariadb.so.3 to the PostgreSQL dynamic extension library
cp ${libmysqlclient}/lib/mariadb/libmariadb.so.3 $out/lib/libmysqlclient.so
'';

meta = with lib; {
description = "MySQL foreign data wrapper for PostgreSQL";
homepage = "https://github.com/EnterpriseDB/mysql_fdw";
changelog = "https://github.com/EnterpriseDB/mysql_fdw/releases/tags/${finalAttrs.version}";
maintainers = with maintainers; [ thelazzziest ];
inherit (postgresql.meta) platforms;
license = licenses.postgresql;
};
})

0 comments on commit a36c1dd

Please sign in to comment.