1{ lib, stdenv, fetchFromGitHub, cmake, openssl
2}:
3
4stdenv.mkDerivation rec {
5 pname = "srt";
6 version = "1.5.1";
7
8 src = fetchFromGitHub {
9 owner = "Haivision";
10 repo = "srt";
11 rev = "v${version}";
12 sha256 = "sha256-qVvoHtROtJjrUd+YpjN/0I6KmiH7c24+pQ4xYTUGPXk=";
13 };
14
15 nativeBuildInputs = [ cmake ];
16
17 buildInputs = [ openssl ];
18
19 cmakeFlags = [
20 # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
21 # (setting it to an absolute path causes include files to go to $out/$out/include,
22 # because the absolute path is interpreted with root at $out).
23 "-DCMAKE_INSTALL_INCLUDEDIR=include"
24 # TODO Remove this when https://github.com/Haivision/srt/issues/538 is fixed and available to nixpkgs
25 # Workaround for the fact that srt incorrectly disables GNUInstallDirs when LIBDIR is specified,
26 # see https://github.com/NixOS/nixpkgs/pull/54463#discussion_r249878330
27 "-UCMAKE_INSTALL_LIBDIR"
28 ];
29
30 meta = with lib; {
31 description = "Secure, Reliable, Transport";
32 homepage = "https://github.com/Haivision/srt";
33 license = licenses.mpl20;
34 maintainers = with maintainers; [ nh2 ];
35 platforms = platforms.all;
36 };
37}