about summary refs log tree commit diff
path: root/pkgs/tools/compression/bsc/default.nix
blob: 7d2af1c4898fe04ea0b8e211e394f4e4a4ae679c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, stdenv, fetchFromGitHub, openmp }:

stdenv.mkDerivation rec {
  pname = "bsc";
  version = "3.1.0";

  src = fetchFromGitHub {
    owner = "IlyaGrebnov";
    repo = "libbsc";
    rev = version;
    sha256 = "0c0jmirh9y23kyi1jnrm13sa3xsjn54jazfr84ag45pai279fciz";
  };

  enableParallelBuilding = true;

  buildInputs = lib.optional stdenv.isDarwin openmp;

  postPatch = ''
    substituteInPlace makefile \
        --replace 'g++' '$(CXX)'
  '';

  makeFlags = [ "PREFIX=$(out)" ];

  meta = with lib; {
    description = "High performance block-sorting data compression library";
    homepage = "http://libbsc.com/";
    maintainers = with maintainers; [ ];
    # Later commits changed the licence to Apache2 (no release yet, though)
    license = with licenses; [ lgpl3Plus ];
    platforms = platforms.unix;
    mainProgram = "bsc";
  };
}