lol

sysbench: Use vendored statically linked libck

This partially revert and redo 4af13554542ef24b20acb3a023c3f7a34f845cff
Vendored version of concurrency kit (aka libck) require little more
patching to support cross-compilation

authored by

Alexander V. Nikolaev and committed by
Jörg Thalheim
2df7707d 3b61d595

+21 -3
+21 -3
pkgs/development/tools/misc/sysbench/default.nix
··· 5 5 , pkg-config 6 6 , libmysqlclient 7 7 , libaio 8 - , libck 9 8 , luajit 10 9 # For testing: 11 10 , testers ··· 17 16 version = "1.0.20"; 18 17 19 18 nativeBuildInputs = [ autoreconfHook pkg-config ]; 20 - buildInputs = [ libmysqlclient luajit libck ] ++ lib.optionals stdenv.isLinux [ libaio ]; 19 + buildInputs = [ libmysqlclient luajit ] ++ lib.optionals stdenv.isLinux [ libaio ]; 21 20 depsBuildBuild = [ pkg-config ]; 22 21 23 22 src = fetchFromGitHub { ··· 33 32 # The bundled version does not build on aarch64-darwin: 34 33 # https://github.com/akopytov/sysbench/issues/416 35 34 "--with-system-luajit" 36 - "--with-system-ck" 37 35 "--with-mysql-includes=${lib.getDev libmysqlclient}/include/mysql" 38 36 "--with-mysql-libs=${libmysqlclient}/lib/mysql" 39 37 ]; 38 + 39 + # We cannot use the regular nixpkgs ck here, since it has very 40 + # different performance characteristics than the vendored one. 41 + # On the downside the vendored libck version require more fixes for cross-compilation. 42 + # Sysbench related on statically linked vendored libck. 43 + postPatch = '' 44 + substituteInPlace \ 45 + third_party/concurrency_kit/ck/configure \ 46 + --replace-fail \ 47 + 'COMPILER=`./.1 2> /dev/null`' \ 48 + "COMPILER=${if stdenv.cc.isGNU then "gcc" else if stdenv.cc.isClang then "clang" else throw "Unsupported compiler"}" \ 49 + --replace-fail \ 50 + 'PLATFORM=`uname -m 2> /dev/null`' \ 51 + "PLATFORM=${stdenv.hostPlatform.parsed.cpu.name}" 52 + substituteInPlace \ 53 + third_party/concurrency_kit/ck/src/Makefile.in \ 54 + --replace-fail \ 55 + "ar rcs" \ 56 + "${stdenv.cc.targetPrefix}ar rcs" 57 + ''; 40 58 41 59 passthru.tests = { 42 60 versionTest = testers.testVersion {