sysbench: add macOS support (#185750)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Rahul Butani 2022-08-19 07:39:45 -05:00 committed by GitHub
parent a5de565921
commit 9fd235b40a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,14 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
, libmysqlclient, libaio
{ lib
, stdenv
, fetchFromGitHub
, autoreconfHook
, pkg-config
, libmysqlclient
, libaio
, luajit
# For testing:
, testers
, sysbench
}:
stdenv.mkDerivation rec {
@ -7,7 +16,7 @@ stdenv.mkDerivation rec {
version = "1.0.20";
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ libmysqlclient libaio ];
buildInputs = [ libmysqlclient luajit ] ++ lib.optionals stdenv.isLinux [ libaio ];
src = fetchFromGitHub {
owner = "akopytov";
@ -18,10 +27,30 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
configureFlags = [
# The bundled version does not build on aarch64-darwin:
# https://github.com/akopytov/sysbench/issues/416
"--with-system-luajit"
];
passthru.tests = {
versionTest = testers.testVersion {
package = sysbench;
};
};
meta = {
description = "Modular, cross-platform and multi-threaded benchmark tool";
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.
'';
homepage = "https://github.com/akopytov/sysbench";
downloadPage = "https://github.com/akopytov/sysbench/releases/tag/${version}";
changelog = "https://github.com/akopytov/sysbench/blob/${version}/ChangeLog";
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
platforms = lib.platforms.unix;
};
}