1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 llvmPackages,
6}:
7
8stdenv.mkDerivation (finalAttrs: {
9 pname = "bsc";
10 version = "3.3.6";
11
12 src = fetchFromGitHub {
13 owner = "IlyaGrebnov";
14 repo = "libbsc";
15 tag = "v${finalAttrs.version}";
16 hash = "sha256-iUFKTDSAg2/57TPvR0nlmfVN2Z6O9kZKIg+BQQKvr/o=";
17 };
18
19 enableParallelBuilding = true;
20
21 buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
22
23 postPatch = lib.optional (!stdenv.hostPlatform.isx86) ''
24 substituteInPlace makefile \
25 --replace-fail "-mavx2" ""
26
27 substituteInPlace makefile.cuda \
28 --replace-fail "-mavx2" ""
29 '';
30
31 makeFlags = [
32 "CC=$(CXX)"
33 "PREFIX=${placeholder "out"}"
34 ];
35
36 meta = {
37 description = "High performance block-sorting data compression library";
38 homepage = "http://libbsc.com/";
39 maintainers = with lib.maintainers; [ sigmanificient ];
40 license = lib.licenses.asl20;
41 platforms = lib.platforms.unix;
42 mainProgram = "bsc";
43 };
44})