about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/thrift
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/libraries/thrift
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/thrift')
-rw-r--r--nixpkgs/pkgs/development/libraries/thrift/default.nix67
1 files changed, 57 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/development/libraries/thrift/default.nix b/nixpkgs/pkgs/development/libraries/thrift/default.nix
index f85e56578bbe..a4ae0a99f92d 100644
--- a/nixpkgs/pkgs/development/libraries/thrift/default.nix
+++ b/nixpkgs/pkgs/development/libraries/thrift/default.nix
@@ -1,5 +1,16 @@
-{ lib, stdenv, fetchurl, boost, zlib, libevent, openssl, python3, cmake, pkg-config
-, bison, flex
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, boost
+, zlib
+, libevent
+, openssl
+, python3
+, cmake
+, pkg-config
+, bison
+, flex
 , static ? stdenv.hostPlatform.isStatic
 }:
 
@@ -12,20 +23,54 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-9GC1wcow2JGP+V6j62KRs5Uc9RhVNWYIjz8r6JgfYgk=";
   };
 
-  # Workaround to make the python wrapper not drop this package:
+  # Workaround to make the Python wrapper not drop this package:
   # pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
   pythonPath = [];
 
-  nativeBuildInputs = [ cmake pkg-config bison flex ];
-  buildInputs = [ boost zlib libevent openssl ]
-    ++ lib.optionals (!static) [ (python3.withPackages (ps: [ps.twisted])) ];
+  nativeBuildInputs = [
+    bison
+    cmake
+    flex
+    pkg-config
+  ];
+
+  buildInputs = [
+    boost
+    libevent
+    openssl
+    zlib
+  ] ++ lib.optionals (!static) [
+    (python3.withPackages (ps: [ps.twisted]))
+  ];
+
+  postPatch = ''
+    # Python 3.10 related failures:
+    # SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
+    # AttributeError: module 'collections' has no attribute 'Hashable'
+    substituteInPlace test/py/RunClientServer.py \
+      --replace "'FastbinaryTest.py'," "" \
+      --replace "'TestEof.py'," "" \
+      --replace "'TestFrozen.py'," ""
+  '';
 
-  preConfigure = "export PY_PREFIX=$out";
+  preConfigure = ''
+    export PY_PREFIX=$out
+  '';
 
   patches = [
     # ToStringTest.cpp is failing from some reason due to locale issue, this
     # doesn't disable all UnitTests as in Darwin.
     ./disable-failing-test.patch
+    (fetchpatch {
+      name = "tests-expired-certs.diff"; # https://github.com/apache/thrift/pull/2629
+      url = "https://github.com/apache/thrift/commit/54765854873e19b8ba50a0ec8080dd92d8323851.diff";
+      sha256 = "wnG2MjY0DtAhVcEdcxu77tDa4T9Xm2pMYZU2wXLx2OA=";
+    })
+    (fetchpatch {
+      name = "setuptools-gte-62.1.0.patch";
+      url = "https://github.com/apache/thrift/pull/2635/commits/c41ad9d5119e9bdae1746167e77e224f390f2c42.patch";
+      hash = "sha256-FkErrg/6vXTomS4AsCsld7t+Iccc55ZiDaNjJ3W1km0=";
+    })
   ];
 
   cmakeFlags = [
@@ -43,12 +88,12 @@ stdenv.mkDerivation rec {
   disabledTests = [
     "PythonTestSSLSocket"
   ] ++ lib.optionals stdenv.isDarwin [
-    # tests that hang up in the darwin sandbox
+    # Tests that hang up in the Darwin sandbox
     "SecurityTest"
     "SecurityFromBufferTest"
     "python_test"
 
-    # tests that fail in the darwin sandbox when trying to use network
+    # Tests that fail in the Darwin sandbox when trying to use network
     "UnitTests"
     "TInterruptTest"
     "TServerIntegrationTest"
@@ -62,6 +107,7 @@ stdenv.mkDerivation rec {
   ];
 
   doCheck = !static;
+
   checkPhase = ''
     runHook preCheck
 
@@ -69,6 +115,7 @@ stdenv.mkDerivation rec {
 
     runHook postCheck
   '';
+
   enableParallelChecking = false;
 
   meta = with lib; {
@@ -76,6 +123,6 @@ stdenv.mkDerivation rec {
     homepage = "https://thrift.apache.org/";
     license = licenses.asl20;
     platforms = platforms.linux ++ platforms.darwin;
-    maintainers = [ maintainers.bjornfor ];
+    maintainers = with maintainers; [ bjornfor ];
   };
 }