From 68c4999f3abf5c40a3ce75880fb515fd6036a1c4 Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Sun, 24 Mar 2024 17:06:43 +0100 Subject: [PATCH 1/4] keepassxc: switch to botan3 KeepassXC supports Botan 3 since release 2.7.5. Signed-off-by: Markus Theil --- pkgs/applications/misc/keepassxc/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/keepassxc/default.nix b/pkgs/applications/misc/keepassxc/default.nix index e74a45c02f31..c96d4d06602a 100644 --- a/pkgs/applications/misc/keepassxc/default.nix +++ b/pkgs/applications/misc/keepassxc/default.nix @@ -5,7 +5,7 @@ , qttools , asciidoctor -, botan2 +, botan3 , curl , libXi , libXtst @@ -114,7 +114,7 @@ stdenv.mkDerivation rec { buildInputs = [ curl - botan2 + botan3 libXi libXtst libargon2 From 568a503528675306776e5a726de99a3d1c81d717 Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Sun, 24 Mar 2024 17:09:28 +0100 Subject: [PATCH 2/4] corectrl: switch to botan3 Corectl supports botan3 since version 1.4 and prefers it when both botan3 and botan2 are installed on a system. Signed-off-by: Markus Theil --- pkgs/applications/misc/corectrl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/corectrl/default.nix b/pkgs/applications/misc/corectrl/default.nix index a7397da8d7cf..ad9dffc77053 100644 --- a/pkgs/applications/misc/corectrl/default.nix +++ b/pkgs/applications/misc/corectrl/default.nix @@ -1,7 +1,7 @@ { lib, stdenv , fetchFromGitLab , extra-cmake-modules -, botan2 +, botan3 , karchive , kauth , libdrm @@ -42,7 +42,7 @@ stdenv.mkDerivation rec{ wrapQtAppsHook ]; buildInputs = [ - botan2 + botan3 karchive kauth libdrm From 4f7abfbfc02b430cebdd958c7740581cca91beef Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Sun, 24 Mar 2024 17:17:29 +0100 Subject: [PATCH 3/4] rehex: switch to botan3 Signed-off-by: Markus Theil --- pkgs/applications/editors/rehex/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/editors/rehex/default.nix b/pkgs/applications/editors/rehex/default.nix index 9a3ba2a4a59f..e48d45cb7d27 100644 --- a/pkgs/applications/editors/rehex/default.nix +++ b/pkgs/applications/editors/rehex/default.nix @@ -5,7 +5,7 @@ , which , zip , libicns -, botan2 +, botan3 , capstone , jansson , libunistring @@ -32,14 +32,17 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config which zip ] ++ lib.optionals stdenv.isDarwin [ libicns ]; - buildInputs = [ botan2 capstone jansson libunistring wxGTK32 ] + buildInputs = [ botan3 capstone jansson libunistring wxGTK32 ] ++ (with lua53Packages; [ lua busted ]) ++ (with perlPackages; [ perl TemplateToolkit ]) ++ lib.optionals stdenv.isLinux [ gtk3 ] ++ lib.optionals stdenv.isDarwin [ Carbon Cocoa IOKit ]; - makeFlags = [ "prefix=${placeholder "out"}" ] - ++ lib.optionals stdenv.isDarwin [ "-f Makefile.osx" ]; + makeFlags = [ + "prefix=${placeholder "out"}" + "BOTAN_PKG=botan-3" + "CXXSTD=-std=c++20" + ] ++ lib.optionals stdenv.isDarwin [ "-f Makefile.osx" ]; enableParallelBuilding = true; From 2411e7cb6d7d438e637cd4677040750af0c03a1e Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Sun, 21 Apr 2024 15:11:21 +0200 Subject: [PATCH 4/4] botan3: fix build on MacOS with SDK 10.12 MacOS with an older SDK < 10.14 did not build botan3. Add the missing error/success code include. Can be removed again, when most users updated to a more recent SDK. Signed-off-by: Markus Theil --- pkgs/development/libraries/botan/3.0.nix | 4 +- .../libraries/botan/botan3-macos.patch | 48 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/botan/botan3-macos.patch diff --git a/pkgs/development/libraries/botan/3.0.nix b/pkgs/development/libraries/botan/3.0.nix index d55d7edfb74c..d3cd0ece00df 100644 --- a/pkgs/development/libraries/botan/3.0.nix +++ b/pkgs/development/libraries/botan/3.0.nix @@ -1,7 +1,9 @@ -{ callPackage, ... } @ args: +{ callPackage, stdenv, lib, ... } @ args: callPackage ./generic.nix (args // { baseVersion = "3.4"; revision = "0"; hash = "sha256-cYQ6/MCixYX48z+jBPC1iuS5xdgwb4lGZ7N0YEQndVc="; + # this patch fixes build errors on MacOS with SDK 10.12, recheck to remove this again + extraPatches = lib.optionals stdenv.hostPlatform.isDarwin [ ./botan3-macos.patch ]; }) diff --git a/pkgs/development/libraries/botan/botan3-macos.patch b/pkgs/development/libraries/botan/botan3-macos.patch new file mode 100644 index 000000000000..4fde08c32d3f --- /dev/null +++ b/pkgs/development/libraries/botan/botan3-macos.patch @@ -0,0 +1,48 @@ +diff --git a/src/lib/prov/commoncrypto/commoncrypto_block.cpp b/src/lib/prov/commoncrypto/commoncrypto_block.cpp +index a07fe118d..f059ee497 100644 +--- a/src/lib/prov/commoncrypto/commoncrypto_block.cpp ++++ b/src/lib/prov/commoncrypto/commoncrypto_block.cpp +@@ -11,6 +11,7 @@ + #include + #include + ++#include + #include + + namespace Botan { +diff --git a/src/lib/prov/commoncrypto/commoncrypto_hash.cpp b/src/lib/prov/commoncrypto/commoncrypto_hash.cpp +index 1fb79c419..faf9575c2 100644 +--- a/src/lib/prov/commoncrypto/commoncrypto_hash.cpp ++++ b/src/lib/prov/commoncrypto/commoncrypto_hash.cpp +@@ -11,6 +11,7 @@ + #include + #include + ++#include + #include + + namespace Botan { +diff --git a/src/lib/prov/commoncrypto/commoncrypto_utils.h b/src/lib/prov/commoncrypto/commoncrypto_utils.h +index b1c7411fd..9becab2d1 100644 +--- a/src/lib/prov/commoncrypto/commoncrypto_utils.h ++++ b/src/lib/prov/commoncrypto/commoncrypto_utils.h +@@ -10,6 +10,7 @@ + + #include + ++#include + #include + + namespace Botan { +diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp +index b2f7b4c45..f4933b1e3 100644 +--- a/src/lib/rng/system_rng/system_rng.cpp ++++ b/src/lib/rng/system_rng/system_rng.cpp +@@ -20,6 +20,7 @@ + #include + #include + #elif defined(BOTAN_TARGET_OS_HAS_CCRANDOM) ++ #include + #include + #elif defined(BOTAN_TARGET_OS_HAS_ARC4RANDOM) + #include