From cd467f92e5e2d50e6285c898c141a3b33118ea6b Mon Sep 17 00:00:00 2001 From: Sean Link Date: Wed, 29 Nov 2023 13:43:26 -0700 Subject: [PATCH] srt: Add mingw32 build support --- pkgs/development/libraries/srt/default.nix | 23 +++++++++++++++---- .../srt/no-msvc-compat-headers.patch | 10 ++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/libraries/srt/no-msvc-compat-headers.patch diff --git a/pkgs/development/libraries/srt/default.nix b/pkgs/development/libraries/srt/default.nix index 73bf5c25ae54..d25aab35da22 100644 --- a/pkgs/development/libraries/srt/default.nix +++ b/pkgs/development/libraries/srt/default.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, cmake, openssl +{ lib +, stdenv +, fetchFromGitHub +, cmake +, openssl +, windows }: stdenv.mkDerivation rec { @@ -14,7 +19,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - buildInputs = [ openssl ]; + 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 @@ -29,9 +42,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Secure, Reliable, Transport"; - homepage = "https://github.com/Haivision/srt"; - license = licenses.mpl20; + homepage = "https://github.com/Haivision/srt"; + license = licenses.mpl20; maintainers = with maintainers; [ nh2 ]; - platforms = platforms.all; + platforms = platforms.all; }; } diff --git a/pkgs/development/libraries/srt/no-msvc-compat-headers.patch b/pkgs/development/libraries/srt/no-msvc-compat-headers.patch new file mode 100644 index 000000000000..ffededc7d54e --- /dev/null +++ b/pkgs/development/libraries/srt/no-msvc-compat-headers.patch @@ -0,0 +1,10 @@ +--- srt-1.3.2/common/filelist_win32.maf.orig 2018-06-15 21:44:11.000000000 +0200 ++++ srt-1.3.2/common/filelist_win32.maf 2018-09-25 20:26:36.903688700 +0200 +@@ -4,7 +4,6 @@ + # + # These are included by platform_sys.h header contained in ../srtcore/filelist.maf + # +-win/unistd.h + + SOURCES + win_time.cpp