2023-09-25 10:39:08 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchzip
|
|
|
|
, cmake
|
|
|
|
, gitUpdater
|
|
|
|
}:
|
2022-01-01 16:41:51 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openfec";
|
2024-08-09 21:03:26 +00:00
|
|
|
version = "1.4.2.11";
|
2022-01-01 16:41:51 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
2023-09-25 10:39:08 +00:00
|
|
|
url = "https://github.com/roc-streaming/openfec/archive/refs/tags/v${version}.tar.gz";
|
2024-08-09 21:03:26 +00:00
|
|
|
hash = "sha256-lBR8vz8whEdPVHAGVq9eRriKtmS5tUAvtoyXwO4AuEs=";
|
2022-01-01 16:41:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
2024-05-11 09:30:03 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DDEBUG:STRING=OFF"
|
|
|
|
(lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic)
|
|
|
|
];
|
2022-01-01 16:41:51 +00:00
|
|
|
|
|
|
|
installPhase =
|
2024-05-11 09:30:03 +00:00
|
|
|
let so = stdenv.hostPlatform.extensions.library;
|
2022-01-01 16:41:51 +00:00
|
|
|
in ''
|
|
|
|
# This is pretty horrible but sadly there is not installation procedure
|
|
|
|
# provided.
|
|
|
|
mkdir -p $dev/include
|
|
|
|
cp -R ../src/* $dev/include
|
|
|
|
find $dev/include -type f -a ! -iname '*.h' -delete
|
|
|
|
|
|
|
|
install -D -m755 -t $out/lib ../bin/Release/libopenfec${so}
|
2022-12-31 07:44:11 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
install_name_tool -id $out/lib/libopenfec${so} $out/lib/libopenfec${so}
|
|
|
|
'' + ''
|
2022-01-01 16:41:51 +00:00
|
|
|
ln -s libopenfec${so} $out/lib/libopenfec${so}.1
|
|
|
|
'';
|
|
|
|
|
2023-09-25 10:39:08 +00:00
|
|
|
passthru.updateScript = gitUpdater {
|
|
|
|
url = "https://github.com/roc-streaming/openfec.git";
|
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
|
|
|
|
2022-01-01 16:41:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Application-level Forward Erasure Correction codes";
|
|
|
|
homepage = "https://github.com/roc-streaming/openfec";
|
|
|
|
license = licenses.cecill-c;
|
|
|
|
maintainers = with maintainers; [ bgamari ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|