3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #33176 from Izorkin/mariadb-galera

mariadb galera: init at 25.3.23
This commit is contained in:
Michael Raskin 2018-06-10 21:23:11 +00:00 committed by GitHub
commit d871acb3b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@
, libiconv, openssl, pcre, boost, judy, bison, libxml2 , libiconv, openssl, pcre, boost, judy, bison, libxml2
, libaio, libevent, groff, jemalloc, cracklib, systemd, numactl, perl , libaio, libevent, groff, jemalloc, cracklib, systemd, numactl, perl
, fixDarwinDylibNames, cctools, CoreServices , fixDarwinDylibNames, cctools, CoreServices
, asio, buildEnv, check, qt4, scons
}: }:
with stdenv.lib; with stdenv.lib;
@ -12,6 +13,12 @@ mariadb = everything // {
inherit client; # libmysqlclient.so in .out, necessary headers in .dev and utils in .bin inherit client; # libmysqlclient.so in .out, necessary headers in .dev and utils in .bin
server = everything; # a full single-output build, including everything in `client` again server = everything; # a full single-output build, including everything in `client` again
inherit connector-c; # libmysqlclient.so inherit connector-c; # libmysqlclient.so
inherit galera;
};
galeraLibs = buildEnv {
name = "galera-lib-inputs-united";
paths = [ openssl.out boost check ];
}; };
common = rec { # attributes common to both builds common = rec { # attributes common to both builds
@ -150,6 +157,7 @@ everything = stdenv.mkDerivation (common // {
"-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1" "-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1"
"-DWITHOUT_FEDERATED_STORAGE_ENGINE=1" "-DWITHOUT_FEDERATED_STORAGE_ENGINE=1"
"-DWITH_WSREP=ON" "-DWITH_WSREP=ON"
"-DWITH_INNODB_DISALLOW_WRITES=ON"
] ++ stdenv.lib.optionals stdenv.isDarwin [ ] ++ stdenv.lib.optionals stdenv.isDarwin [
"-DWITHOUT_OQGRAPH_STORAGE_ENGINE=1" "-DWITHOUT_OQGRAPH_STORAGE_ENGINE=1"
"-DWITHOUT_TOKUDB=1" "-DWITHOUT_TOKUDB=1"
@ -159,6 +167,7 @@ everything = stdenv.mkDerivation (common // {
rm -r "$out"/data # Don't need testing data rm -r "$out"/data # Don't need testing data
rm "$out"/share/man/man1/mysql-test-run.pl.1 rm "$out"/share/man/man1/mysql-test-run.pl.1
rm "$out"/bin/rcmysql rm "$out"/bin/rcmysql
sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster
''; '';
CXXFLAGS = optionalString stdenv.isi686 "-fpermissive" CXXFLAGS = optionalString stdenv.isi686 "-fpermissive"
@ -206,4 +215,52 @@ connector-c = stdenv.mkDerivation rec {
}; };
}; };
galera = stdenv.mkDerivation rec {
name = "mariadb-galera-${version}";
version = "25.3.23";
src = fetchurl {
url = "https://mirrors.nxthost.com/mariadb/mariadb-10.2.14/galera-${version}/src/galera-${version}.tar.gz";
sha256 = "11pfc85z29jk0h6g6bmi3hdv4in4yb00xsr2r0qm1b0y7m2wq3ra";
};
buildInputs = [ asio boost check openssl qt4 scons ];
patchPhase = ''
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"
'';
buildPhase = ''
scons -j$NIX_BUILD_CORES ssl=1 system_asio=1 strict_build_flags=0
'';
installPhase = ''
# copied with modifications from scripts/packages/freebsd.sh
GALERA_LICENSE_DIR="$share/licenses/${name}"
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"
install -m 444 "www.evanjones.ca/LICENSE" "$out/$GALERA_LICENSE_DIR/LICENSE.crc32c"
install -m 444 "chromium/LICENSE" "$out/$GALERA_LICENSE_DIR/LICENSE.chromium"
'';
meta = {
description = "Galera 3 wsrep provider library";
homepage = http://galeracluster.com/;
license = licenses.lgpl2;
maintainers = with maintainers; [ izorkin ];
platforms = platforms.all;
};
};
in mariadb in mariadb