2023-10-09 19:29:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, boost } :
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cm256cc";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "1.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "f4exb";
|
|
|
|
repo = "cm256cc";
|
|
|
|
rev = "v${version}";
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "sha256-T7ZUVVYGdzAialse//MoqWCVNBpbZvzWMAKc0cw7O9k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
patches = [
|
|
|
|
# Pull fix pending upstream inclusion for gcc-13 support:
|
|
|
|
# https://github.com/f4exb/cm256cc/pull/18
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-13.patch";
|
|
|
|
url = "https://github.com/f4exb/cm256cc/commit/a7f142bcdae8be1c646d67176ba0ba0f7e8dcd68.patch";
|
|
|
|
hash = "sha256-J7bm44sqnGsdPhJxQrE8LDxZ6tkTzLslHQnnKmtgrtM=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ boost ];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
# https://github.com/f4exb/cm256cc/issues/16
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace libcm256cc.pc.in \
|
|
|
|
--replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Fast GF(256) Cauchy MDS Block Erasure Codec in C++";
|
|
|
|
homepage = "https://github.com/f4exb/cm256cc";
|
2023-03-24 00:07:29 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ alkeryn ];
|
2020-07-18 16:06:22 +00:00
|
|
|
license = licenses.gpl3;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|