Unverified Commit 8d9e5048 authored by Colin's avatar Colin Committed by GitHub
Browse files

bsc: 3.3.6 -> 3.3.12, set updateScript (#451066)

parents 95de9c07 a418816b
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
@@ -3,35 +3,34 @@
  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 = {
    description = "High performance block-sorting data compression library";