2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, openssl
|
|
|
|
, windows
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "srt";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.5.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Haivision";
|
|
|
|
repo = "srt";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-HW5l26k9w4F6IJrtiahU/8/CPY6M/cKn8AgESsntC6A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isMinGW [
|
|
|
|
windows.mingw_w64_pthreads
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = lib.optionals stdenv.hostPlatform.isMinGW [
|
|
|
|
./no-msvc-compat-headers.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
# the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
|
|
|
|
# (setting it to an absolute path causes include files to go to $out/$out/include,
|
|
|
|
# because the absolute path is interpreted with root at $out).
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
|
|
|
# TODO Remove this when https://github.com/Haivision/srt/issues/538 is fixed and available to nixpkgs
|
|
|
|
# Workaround for the fact that srt incorrectly disables GNUInstallDirs when LIBDIR is specified,
|
|
|
|
# see https://github.com/NixOS/nixpkgs/pull/54463#discussion_r249878330
|
|
|
|
"-UCMAKE_INSTALL_LIBDIR"
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Secure, Reliable, Transport";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/Haivision/srt";
|
|
|
|
license = licenses.mpl20;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ nh2 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|