diff --git a/pkgs/by-name/ac/ac-library/package.nix b/pkgs/by-name/ac/ac-library/package.nix index 45e8b2e771fd..2123dd086cb1 100644 --- a/pkgs/by-name/ac/ac-library/package.nix +++ b/pkgs/by-name/ac/ac-library/package.nix @@ -4,17 +4,19 @@ lib, python3, nix-update-script, + cmake, }: stdenv.mkDerivation (finalAttrs: { pname = "ac-library"; - version = "1.5.1"; + version = "1.6"; src = fetchFromGitHub { owner = "atcoder"; repo = "ac-library"; tag = "v${finalAttrs.version}"; - hash = "sha256-AIqG98c1tcxxhYcX+NSf6Rw3onw61T5NTZtqQzT9jls="; + fetchSubmodules = true; + hash = "sha256-1wwzN/JPS6daj1vDFuEN5z20tMdLfMvEKti0sxCVlHA="; }; outputs = [ @@ -26,6 +28,41 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; + nativeInstallCheckInputs = [ + python3.pkgs.pytest + cmake + ]; + + dontUseCmakeConfigure = true; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + substituteInPlace test/test_expander.py \ + --replace-fail "g++" "$CXX" + python -m pytest --ignore-glob='test/unittest/googletest/*' + + pushd test/unittest + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=$STDCXX + make + ctest -VV + popd + + runHook postInstallCheck + ''; + + # We don't need -fno-strict-overflow because it will break UBSanitize's overflow check especially when the operation number is static definded. + hardeningDisable = [ "strictoverflow" ]; + + env = { + NIX_CFLAGS_COMPILE = toString [ + "-Wno-error=array-bounds" + ]; + }; + installPhase = '' runHook preInstall