summary refs log tree commit diff
diff options
context:
space:
mode:
authorIzorkin <izorkin@elven.pw>2022-07-13 11:16:34 +0300
committerIzorkin <izorkin@elven.pw>2022-07-13 11:22:33 +0300
commitc16db99d3b38a558caabd66f4d59621ed6c7f49b (patch)
treef2598749cc7b39f2c0673a31279ba34787ab1b95
parent1570838769fad637e3cf26a56ab6ff14d23c4b95 (diff)
downloadnixpkgs-c16db99d3b38a558caabd66f4d59621ed6c7f49b.tar
nixpkgs-c16db99d3b38a558caabd66f4d59621ed6c7f49b.tar.gz
nixpkgs-c16db99d3b38a558caabd66f4d59621ed6c7f49b.tar.bz2
nixpkgs-c16db99d3b38a558caabd66f4d59621ed6c7f49b.tar.lz
nixpkgs-c16db99d3b38a558caabd66f4d59621ed6c7f49b.tar.xz
nixpkgs-c16db99d3b38a558caabd66f4d59621ed6c7f49b.tar.zst
nixpkgs-c16db99d3b38a558caabd66f4d59621ed6c7f49b.zip
libssh2: fix build with libressl 3.5.x
-rw-r--r--pkgs/development/libraries/libssh2/default.nix6
-rw-r--r--pkgs/development/libraries/libssh2/openssl_add_support_for_libressl_3_5.patch26
2 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libssh2/default.nix b/pkgs/development/libraries/libssh2/default.nix
index d6817550fe7..1b5d65335b8 100644
--- a/pkgs/development/libraries/libssh2/default.nix
+++ b/pkgs/development/libraries/libssh2/default.nix
@@ -11,6 +11,12 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "devdoc" ];
 
+  patches = [
+    # https://github.com/libssh2/libssh2/pull/700
+    # openssl: add support for LibreSSL 3.5.x
+    ./openssl_add_support_for_libressl_3_5.patch
+  ];
+
   buildInputs = [ openssl zlib ]
     ++ lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
 
diff --git a/pkgs/development/libraries/libssh2/openssl_add_support_for_libressl_3_5.patch b/pkgs/development/libraries/libssh2/openssl_add_support_for_libressl_3_5.patch
new file mode 100644
index 00000000000..d72a67a6340
--- /dev/null
+++ b/pkgs/development/libraries/libssh2/openssl_add_support_for_libressl_3_5.patch
@@ -0,0 +1,26 @@
+From f0681a4573d7c7f7484d3157ddff7063a200295b Mon Sep 17 00:00:00 2001
+From: Viktor Szakats <commit@vsz.me>
+Date: Thu, 19 May 2022 13:25:06 +0000
+Subject: [PATCH] openssl: add support for LibreSSL 3.5.x
+
+LibreSSL 3.5.0 made more structures opaque, so let's enable existing
+support for that when building against these LibreSSL versions.
+
+Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.0-relnotes.txt
+---
+ src/openssl.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/openssl.h b/src/openssl.h
+index 658b040..1733b9e 100644
+--- a/src/openssl.h
++++ b/src/openssl.h
+@@ -58,7 +58,8 @@
+ #include <openssl/rand.h>
+
+ #if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
+-    !defined(LIBRESSL_VERSION_NUMBER)
++    !defined(LIBRESSL_VERSION_NUMBER) || \
++    LIBRESSL_VERSION_NUMBER >= 0x3050000fL
+ # define HAVE_OPAQUE_STRUCTS 1
+ #endif