nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

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