diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix index a155c1717eb4..610e89c2fc3b 100644 --- a/pkgs/tools/archivers/p7zip/default.nix +++ b/pkgs/tools/archivers/p7zip/default.nix @@ -13,6 +13,10 @@ stdenv.mkDerivation rec { } ; + patches = [ + ./gcc10.patch + ]; + # Default makefile is full of impurities on Darwin. The patch doesn't hurt Linux so I'm leaving it unconditional postPatch = '' sed -i '/CC=\/usr/d' makefile.macosx_llvm_64bits diff --git a/pkgs/tools/archivers/p7zip/gcc10.patch b/pkgs/tools/archivers/p7zip/gcc10.patch new file mode 100644 index 000000000000..9361249af937 --- /dev/null +++ b/pkgs/tools/archivers/p7zip/gcc10.patch @@ -0,0 +1,40 @@ +From 1b7d2c73f01b2d2b6a3d2d16840e96e92afdcd61 Mon Sep 17 00:00:00 2001 +From: jinfeihan57 +Date: Tue, 9 Jun 2020 16:48:25 +0800 +Subject: [PATCH] gix gcc10 compiler error + +--- + CPP/Windows/ErrorMsg.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/CPP/Windows/ErrorMsg.cpp b/CPP/Windows/ErrorMsg.cpp +index 99684ae..90a7e20 100644 +--- a/CPP/Windows/ErrorMsg.cpp ++++ b/CPP/Windows/ErrorMsg.cpp +@@ -13,7 +13,7 @@ UString MyFormatMessage(DWORD errorCode) + const char * txt = 0; + AString msg; + +- switch(errorCode) { ++ switch(HRESULT(errorCode)) { + case ERROR_NO_MORE_FILES : txt = "No more files"; break ; + case E_NOTIMPL : txt = "E_NOTIMPL"; break ; + case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; +@@ -22,7 +22,7 @@ UString MyFormatMessage(DWORD errorCode) + case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; + case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; + case E_INVALIDARG : txt = "E_INVALIDARG"; break ; +- case ERROR_DIRECTORY : txt = "Error Directory"; break ; ++ case ERROR_DIRECTORY : txt = "Error Directory"; break ; + default: + txt = strerror(errorCode); + } +@@ -43,7 +43,7 @@ bool MyFormatMessage(DWORD messageID, CSysString &message) + const char * txt = 0; + AString msg; + +- switch(messageID) { ++ switch(HRESULT(messageID)) { + case ERROR_NO_MORE_FILES : txt = "No more files"; break ; + case E_NOTIMPL : txt = "E_NOTIMPL"; break ; + case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ;