Merge pull request #64646 from aanderse/mytop
mariadb: fix mytop script
This commit is contained in:
commit
304f267917
|
@ -1,8 +1,9 @@
|
||||||
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig, ncurses, zlib, xz, lzo, lz4, bzip2, snappy
|
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig, makeWrapper, ncurses, zlib, xz, lzo, lz4, bzip2, snappy
|
||||||
, libiconv, openssl, pcre, boost, judy, bison, libxml2, libkrb5
|
, libiconv, openssl, pcre, boost, judy, bison, libxml2, libkrb5
|
||||||
, libaio, libevent, jemalloc, cracklib, systemd, numactl, perl
|
, libaio, libevent, jemalloc, cracklib, systemd, numactl, perl
|
||||||
, fixDarwinDylibNames, cctools, CoreServices
|
, fixDarwinDylibNames, cctools, CoreServices
|
||||||
, asio, buildEnv, check, scons
|
, asio, buildEnv, check, scons
|
||||||
|
, less
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
@ -11,6 +12,8 @@ let # in mariadb # spans the whole file
|
||||||
|
|
||||||
libExt = stdenv.hostPlatform.extensions.sharedLibrary;
|
libExt = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
|
|
||||||
|
mytopEnv = perl.withPackages (p: with p; [ DataDumper DBDmysql DBI TermReadKey ]);
|
||||||
|
|
||||||
mariadb = everything // {
|
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
|
||||||
|
@ -133,12 +136,13 @@ everything = stdenv.mkDerivation (common // {
|
||||||
|
|
||||||
outputs = [ "out" "dev" "man" ];
|
outputs = [ "out" "dev" "man" ];
|
||||||
|
|
||||||
nativeBuildInputs = common.nativeBuildInputs ++ [ bison ];
|
nativeBuildInputs = common.nativeBuildInputs ++ [ bison ] ++ optional (!stdenv.isDarwin) makeWrapper;
|
||||||
|
|
||||||
buildInputs = common.buildInputs ++ [
|
buildInputs = common.buildInputs ++ [
|
||||||
xz lzo lz4 bzip2 snappy
|
xz lzo lz4 bzip2 snappy
|
||||||
libxml2 boost judy libevent cracklib
|
libxml2 boost judy libevent cracklib
|
||||||
] ++ optional (stdenv.isLinux && !stdenv.isAarch32) numactl;
|
] ++ optional (stdenv.isLinux && !stdenv.isAarch32) numactl
|
||||||
|
++ optional (!stdenv.isDarwin) mytopEnv;
|
||||||
|
|
||||||
cmakeFlags = common.cmakeFlags ++ [
|
cmakeFlags = common.cmakeFlags ++ [
|
||||||
"-DMYSQL_DATADIR=/var/lib/mysql"
|
"-DMYSQL_DATADIR=/var/lib/mysql"
|
||||||
|
@ -161,6 +165,8 @@ everything = stdenv.mkDerivation (common // {
|
||||||
cmakeFlags="$cmakeFlags \
|
cmakeFlags="$cmakeFlags \
|
||||||
-DINSTALL_SHAREDIR=$dev/share/mysql
|
-DINSTALL_SHAREDIR=$dev/share/mysql
|
||||||
-DINSTALL_SUPPORTFILESDIR=$dev/share/mysql"
|
-DINSTALL_SUPPORTFILESDIR=$dev/share/mysql"
|
||||||
|
'' + optionalString (!stdenv.isDarwin) ''
|
||||||
|
patchShebangs scripts/mytop.sh
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
@ -181,6 +187,11 @@ everything = stdenv.mkDerivation (common // {
|
||||||
sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster
|
sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# perlPackages.DBDmysql is broken on darwin
|
||||||
|
postFixup = optionalString (!stdenv.isDarwin) ''
|
||||||
|
wrapProgram $out/bin/mytop --set PATH ${less}/bin/less
|
||||||
|
'';
|
||||||
|
|
||||||
CXXFLAGS = optionalString stdenv.isi686 "-fpermissive";
|
CXXFLAGS = optionalString stdenv.isi686 "-fpermissive";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue