diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2024-05-16 22:21:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 22:21:01 +0200 |
commit | db475b5caffb98eda0e72ffa049ba8b7e0098a9f (patch) | |
tree | 71dd824850bebf448704c2479a28fabe0c7b0b37 /pkgs/development | |
parent | cfed66d12c5645d7d4171f44e2c70d7fce009ba2 (diff) | |
parent | 2df7707d2b0d6d63c5d905eea3e2ba513cff69a0 (diff) |
Merge pull request #309564 from avnik/avnik/sysbench-improvements
sysbench: Use vendored statically linked libck
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/tools/misc/sysbench/default.nix | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/pkgs/development/tools/misc/sysbench/default.nix b/pkgs/development/tools/misc/sysbench/default.nix index 6bba1ebfd6118..fa39c310a269f 100644 --- a/pkgs/development/tools/misc/sysbench/default.nix +++ b/pkgs/development/tools/misc/sysbench/default.nix @@ -5,7 +5,6 @@ , pkg-config , libmysqlclient , libaio -, libck , luajit # For testing: , testers @@ -17,7 +16,7 @@ stdenv.mkDerivation rec { version = "1.0.20"; nativeBuildInputs = [ autoreconfHook pkg-config ]; - buildInputs = [ libmysqlclient luajit libck ] ++ lib.optionals stdenv.isLinux [ libaio ]; + buildInputs = [ libmysqlclient luajit ] ++ lib.optionals stdenv.isLinux [ libaio ]; depsBuildBuild = [ pkg-config ]; src = fetchFromGitHub { @@ -33,11 +32,30 @@ stdenv.mkDerivation rec { # The bundled version does not build on aarch64-darwin: # https://github.com/akopytov/sysbench/issues/416 "--with-system-luajit" - "--with-system-ck" "--with-mysql-includes=${lib.getDev libmysqlclient}/include/mysql" "--with-mysql-libs=${libmysqlclient}/lib/mysql" ]; + # We cannot use the regular nixpkgs ck here, since it has very + # different performance characteristics than the vendored one. + # On the downside the vendored libck version require more fixes for cross-compilation. + # Sysbench related on statically linked vendored libck. + postPatch = '' + substituteInPlace \ + third_party/concurrency_kit/ck/configure \ + --replace-fail \ + 'COMPILER=`./.1 2> /dev/null`' \ + "COMPILER=${if stdenv.cc.isGNU then "gcc" else if stdenv.cc.isClang then "clang" else throw "Unsupported compiler"}" \ + --replace-fail \ + 'PLATFORM=`uname -m 2> /dev/null`' \ + "PLATFORM=${stdenv.hostPlatform.parsed.cpu.name}" + substituteInPlace \ + third_party/concurrency_kit/ck/src/Makefile.in \ + --replace-fail \ + "ar rcs" \ + "${stdenv.cc.targetPrefix}ar rcs" + ''; + passthru.tests = { versionTest = testers.testVersion { package = sysbench; |