Commit a418816b authored by Sigmanificient's avatar Sigmanificient
Browse files

bsc: 3.3.6 -> 3.3.12

parent ba9e09cc
Loading
Loading
Loading
Loading
+10 −14
Original line number Diff line number Diff line
@@ -3,37 +3,33 @@
  stdenv,
  fetchFromGitHub,
  llvmPackages,
  cmake,
  nix-update-script,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "bsc";
  version = "3.3.6";
  version = "3.3.12";

  src = fetchFromGitHub {
    owner = "IlyaGrebnov";
    repo = "libbsc";
    tag = "v${finalAttrs.version}";
    hash = "sha256-iUFKTDSAg2/57TPvR0nlmfVN2Z6O9kZKIg+BQQKvr/o=";
    hash = "sha256-3dFwmThnDzbXB6m/rDfbSz4DZAlIsm4gUOT7YwexpKA=";
  };

  enableParallelBuilding = true;

  buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
  nativeBuildInputs = [ cmake ];

  postPatch = lib.optional (!stdenv.hostPlatform.isx86) ''
    substituteInPlace makefile \
      --replace-fail "-mavx2" ""
  buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;

    substituteInPlace makefile.cuda \
      --replace-fail "-mavx2" ""
  postPatch = ''
    substituteInPlace CMakeLists.txt \
      --replace-fail "check_c_compiler_flag(-march=native COMPILER_SUPPORTS_MARCH_NATIVE_C)" "" \
      --replace-fail "check_cxx_compiler_flag(-march=native COMPILER_SUPPORTS_MARCH_NATIVE_CXX)" ""
  '';

  makeFlags = [
    "CC=$(CXX)"
    "PREFIX=${placeholder "out"}"
  ];

  passthru.updateScript = nix-update-script { };

  meta = {