2022-08-21 13:32:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, pkg-config
|
|
|
|
, libmysqlclient
|
|
|
|
, libaio
|
2024-01-02 11:29:13 +00:00
|
|
|
, libck
|
2022-08-21 13:32:41 +00:00
|
|
|
, luajit
|
|
|
|
# For testing:
|
|
|
|
, testers
|
|
|
|
, sysbench
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "sysbench";
|
2020-05-15 21:57:56 +00:00
|
|
|
version = "1.0.20";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2024-01-02 11:29:13 +00:00
|
|
|
buildInputs = [ libmysqlclient luajit libck ] ++ lib.optionals stdenv.isLinux [ libaio ];
|
|
|
|
depsBuildBuild = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "akopytov";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-05-15 21:57:56 +00:00
|
|
|
sha256 = "1sanvl2a52ff4shj62nw395zzgdgywplqvwip74ky8q7s6qjf5qy";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
configureFlags = [
|
|
|
|
# The bundled version does not build on aarch64-darwin:
|
|
|
|
# https://github.com/akopytov/sysbench/issues/416
|
|
|
|
"--with-system-luajit"
|
2024-01-02 11:29:13 +00:00
|
|
|
"--with-system-ck"
|
|
|
|
"--with-mysql-includes=${lib.getDev libmysqlclient}/include/mysql"
|
|
|
|
"--with-mysql-libs=${libmysqlclient}/lib/mysql"
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
versionTest = testers.testVersion {
|
|
|
|
package = sysbench;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Modular, cross-platform and multi-threaded benchmark tool";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "sysbench";
|
2022-08-21 13:32:41 +00:00
|
|
|
longDescription = ''
|
|
|
|
sysbench is a scriptable multi-threaded benchmark tool based on LuaJIT.
|
|
|
|
It is most frequently used for database benchmarks, but can also be used
|
|
|
|
to create arbitrarily complex workloads that do not involve a database
|
|
|
|
server.
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/akopytov/sysbench";
|
2022-08-21 13:32:41 +00:00
|
|
|
downloadPage = "https://github.com/akopytov/sysbench/releases/tag/${version}";
|
|
|
|
changelog = "https://github.com/akopytov/sysbench/blob/${version}/ChangeLog";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2022-08-21 13:32:41 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|