2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, buildEnv
|
2020-04-24 23:36:52 +00:00
|
|
|
, asio, boost, check, openssl, scons
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
galeraLibs = buildEnv {
|
|
|
|
name = "galera-lib-inputs-united";
|
|
|
|
paths = [ openssl.out boost check ];
|
|
|
|
};
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "mariadb-galera";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "26.4.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "codership";
|
|
|
|
repo = "galera";
|
|
|
|
rev = "release_${version}";
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "0h7s670pcasq8wzprhyxqfca2cghi62b8xz2kikb2a86wd453qil";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ asio boost check openssl scons ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace SConstruct \
|
|
|
|
--replace "boost_library_path = '''" "boost_library_path = '${boost}/lib'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export CPPFLAGS="-I${asio}/include -I${boost.dev}/include -I${check}/include -I${openssl.dev}/include"
|
|
|
|
export LIBPATH="${galeraLibs}/lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
sconsFlags = "ssl=1 system_asio=1 strict_build_flags=0";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# copied with modifications from scripts/packages/freebsd.sh
|
2020-05-15 21:57:56 +00:00
|
|
|
GALERA_LICENSE_DIR="$share/licenses/${pname}-${version}"
|
2020-04-24 23:36:52 +00:00
|
|
|
install -d $out/{bin,lib/galera,share/doc/galera,$GALERA_LICENSE_DIR}
|
|
|
|
install -m 555 "garb/garbd" "$out/bin/garbd"
|
|
|
|
install -m 444 "libgalera_smm.so" "$out/lib/galera/libgalera_smm.so"
|
|
|
|
install -m 444 "scripts/packages/README" "$out/share/doc/galera/"
|
|
|
|
install -m 444 "scripts/packages/README-MySQL" "$out/share/doc/galera/"
|
|
|
|
install -m 444 "scripts/packages/freebsd/LICENSE" "$out/$GALERA_LICENSE_DIR"
|
|
|
|
install -m 444 "LICENSE" "$out/$GALERA_LICENSE_DIR/GPLv2"
|
|
|
|
install -m 444 "asio/LICENSE_1_0.txt" "$out/$GALERA_LICENSE_DIR/LICENSE.asio"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Galera 3 wsrep provider library";
|
|
|
|
homepage = "https://galeracluster.com/";
|
|
|
|
license = licenses.lgpl2;
|
|
|
|
maintainers = with maintainers; [ izorkin ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|