2021-01-17 03:51:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, glibc
|
2021-03-14 16:11:48 +00:00
|
|
|
, bison, curl, flex, gperftools, jansson, jemalloc, libkrb5, lua, libmysqlclient
|
2018-06-10 21:50:36 +01:00
|
|
|
, ncurses, openssl, pcre, pcre2, perl, rabbitmq-c, sqlite, tcl
|
|
|
|
, libaio, libedit, libtool, libui, libuuid, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "maxscale";
|
2018-06-10 21:50:36 +01:00
|
|
|
version = "2.1.17";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mariadb-corporation";
|
|
|
|
repo = "MaxScale";
|
2019-08-15 13:41:18 +01:00
|
|
|
rev = "${pname}-${version}";
|
2018-06-10 21:50:36 +01:00
|
|
|
sha256 = "161kc6aqqj3z509q4qwvsd86h06hlyzdask4gawn2ij0h3ca58q6";
|
|
|
|
};
|
|
|
|
|
2021-01-17 03:51:22 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2018-06-10 21:50:36 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-03-14 16:11:48 +00:00
|
|
|
bison curl flex gperftools jansson jemalloc libkrb5 lua libmysqlclient
|
2018-06-10 21:50:36 +01:00
|
|
|
ncurses openssl pcre pcre2 perl rabbitmq-c sqlite tcl
|
|
|
|
libaio libedit libtool libui libuuid zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [ ./getopt.patch ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
for i in `grep -l -R '#include <getopt.h>' .`; do
|
|
|
|
substituteInPlace $i --replace "#include <getopt.h>" "#include <${glibc.dev}/include/getopt.h>"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_C99=YES"
|
|
|
|
"-DDEFAULT_ADMIN_USER=root"
|
|
|
|
"-DWITH_MAXSCALE_CNF=YES"
|
|
|
|
"-DSTATIC_EMBEDDED=YES"
|
|
|
|
"-DBUILD_RABBITMQ=YES"
|
|
|
|
"-DBUILD_BINLOG=YES"
|
|
|
|
"-DBUILD_CDC=NO"
|
|
|
|
"-DBUILD_MMMON=YES"
|
|
|
|
"-DBUILD_LUAFILTER=YES"
|
|
|
|
"-DLUA_LIBRARIES=${lua}/lib"
|
|
|
|
"-DLUA_INCLUDE_DIR=${lua}/include"
|
|
|
|
"-DGCOV=NO"
|
|
|
|
"-DWITH_SCRIPTS=OFF"
|
|
|
|
"-DBUILD_TESTS=NO"
|
|
|
|
"-DBUILD_TOOLS=NO"
|
|
|
|
"-DPROFILE=NO"
|
|
|
|
"-DWITH_TCMALLOC=YES"
|
|
|
|
"-DWITH_JEMALLOC=YES"
|
|
|
|
"-DINSTALL_EXPERIMENTAL=YES"
|
|
|
|
"-DTARGET_COMPONENT=all"
|
|
|
|
];
|
|
|
|
|
|
|
|
CFLAGS = "-std=gnu99";
|
|
|
|
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
find $out/bin -type f -perm -0100 | while read f1; do
|
|
|
|
patchelf \
|
2019-09-22 08:38:09 +01:00
|
|
|
--set-rpath "$(patchelf --print-rpath $f1):${libmysqlclient}/lib/mariadb:$out/lib/maxscale" \
|
2018-06-10 21:50:36 +01:00
|
|
|
--set-interpreter "$(cat ${stdenv.cc}/nix-support/dynamic-linker)" $f1 \
|
|
|
|
&& patchelf --shrink-rpath $f1
|
|
|
|
done
|
|
|
|
|
|
|
|
find $out/lib/maxscale -type f -perm -0100 | while read f2; do
|
|
|
|
patchelf \
|
|
|
|
--set-rpath "$(patchelf --print-rpath $f2)":$out/lib/maxscale $f2
|
|
|
|
done
|
|
|
|
|
|
|
|
mv $out/share/maxscale/create_grants $out/bin
|
|
|
|
rm -rf $out/{etc,var}
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-10-26 04:08:40 +00:00
|
|
|
description = "MaxScale database proxy extends MariaDB Server's high availability";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://mariadb.com/products/technology/maxscale";
|
2018-06-10 21:50:36 +01:00
|
|
|
license = licenses.bsl11;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ izorkin ];
|
2020-04-10 07:51:53 +01:00
|
|
|
broken = true;
|
2018-06-10 21:50:36 +01:00
|
|
|
};
|
|
|
|
}
|