depot/third_party/nixpkgs/pkgs/development/libraries/srt/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

50 lines
1.4 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, cmake
, openssl
, windows
}:
stdenv.mkDerivation rec {
pname = "srt";
version = "1.5.2";
src = fetchFromGitHub {
owner = "Haivision";
repo = "srt";
rev = "v${version}";
sha256 = "sha256-HW5l26k9w4F6IJrtiahU/8/CPY6M/cKn8AgESsntC6A=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
openssl
] ++ lib.optionals stdenv.hostPlatform.isMinGW [
windows.mingw_w64_pthreads
];
patches = lib.optionals stdenv.hostPlatform.isMinGW [
./no-msvc-compat-headers.patch
];
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"
];
meta = with lib; {
description = "Secure, Reliable, Transport";
homepage = "https://github.com/Haivision/srt";
license = licenses.mpl20;
maintainers = with maintainers; [ nh2 ];
platforms = platforms.all;
};
}