From f3b6fcf3c411ef6ea6fa85f4dc9abe7b850252c6 Mon Sep 17 00:00:00 2001 From: cyan Date: Mon, 21 Oct 2024 20:27:56 +0000 Subject: fix polyseed patch for macOS --- patches/monero/0009-polyseed.patch | 96 ++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 10 deletions(-) diff --git a/patches/monero/0009-polyseed.patch b/patches/monero/0009-polyseed.patch index de546f7..38af2ea 100644 --- a/patches/monero/0009-polyseed.patch +++ b/patches/monero/0009-polyseed.patch @@ -1,4 +1,4 @@ -From 3514a626e1ee02dfa6cbcfb60efe506f60a682fb Mon Sep 17 00:00:00 2001 +From 6b0951540be868373ed261fa9b2806bf7888c9f0 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 12 Mar 2024 09:42:37 +0100 Subject: [PATCH 09/12] polyseed @@ -7,10 +7,12 @@ Co-authored-by: Czarek Nakamoto --- .gitmodules | 6 + CMakeLists.txt | 4 +- + contrib/depends/hosts/darwin.mk | 2 + contrib/depends/hosts/linux.mk | 8 +- contrib/depends/packages/packages.mk | 2 +- - contrib/depends/packages/polyseed.mk | 23 +++ + contrib/depends/packages/polyseed.mk | 28 +++ contrib/depends/packages/sodium.mk | 2 +- + .../polyseed/0001-disable-soname.patch | 48 +++++ .../patches/polyseed/force-static-mingw.patch | 23 +++ contrib/epee/include/wipeable_string.h | 7 + contrib/epee/src/wipeable_string.cpp | 10 + @@ -34,10 +36,12 @@ Co-authored-by: Czarek Nakamoto src/wallet/api/wallet_manager.h | 10 + src/wallet/wallet2.cpp | 100 ++++++++-- src/wallet/wallet2.h | 30 ++- - 28 files changed, 856 insertions(+), 24 deletions(-) + 31 files changed, 912 insertions(+), 24 deletions(-) create mode 100644 contrib/depends/packages/polyseed.mk + create mode 100644 contrib/depends/patches/polyseed/0001-disable-soname.patch create mode 100644 contrib/depends/patches/polyseed/force-static-mingw.patch create mode 160000 external/polyseed + create mode 160000 external/utf8proc create mode 100644 src/polyseed/CMakeLists.txt create mode 100644 src/polyseed/pbkdf2.c create mode 100644 src/polyseed/pbkdf2.h @@ -83,6 +87,19 @@ index 43ef6cd20..e7fa90abb 100644 if(APPLE) cmake_policy(SET CMP0042 NEW) +diff --git a/contrib/depends/hosts/darwin.mk b/contrib/depends/hosts/darwin.mk +index 83d83036b..b14ee5c5b 100644 +--- a/contrib/depends/hosts/darwin.mk ++++ b/contrib/depends/hosts/darwin.mk +@@ -8,6 +8,8 @@ endif + darwin_CC=clang -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -mlinker-version=$(LD64_VERSION) -B$(host_prefix)/native/bin/$(host)- + darwin_CXX=clang++ -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -mlinker-version=$(LD64_VERSION) -stdlib=libc++ -B$(host_prefix)/native/bin/$(host)- + ++darwin_RANLIB=$(host_prefix)/native/bin/$(host)-ranlib ++ + darwin_CFLAGS=-pipe + darwin_CXXFLAGS=$(darwin_CFLAGS) + darwin_ARFLAGS=cr diff --git a/contrib/depends/hosts/linux.mk b/contrib/depends/hosts/linux.mk index 912fdb03c..b79799f30 100644 --- a/contrib/depends/hosts/linux.mk @@ -119,28 +136,33 @@ index d2d1eca85..8783d4955 100644 ifneq ($(GITIAN),1) diff --git a/contrib/depends/packages/polyseed.mk b/contrib/depends/packages/polyseed.mk new file mode 100644 -index 000000000..2ddeac621 +index 000000000..0071b20f3 --- /dev/null +++ b/contrib/depends/packages/polyseed.mk -@@ -0,0 +1,23 @@ +@@ -0,0 +1,28 @@ +package=polyseed +$(package)_version=2.0.0 +$(package)_download_path=https://github.com/tevador/$(package)/archive/refs/tags/ +$(package)_download_file=v$($(package)_version).tar.gz +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=f36282fcbcd68d32461b8230c89e1a40661bd46b91109681cec637433004135a -+$(package)_patches=force-static-mingw.patch ++$(package)_patches=force-static-mingw.patch 0001-disable-soname.patch + +define $(package)_preprocess_cmds -+ patch -p1 < $($(package)_patch_dir)/force-static-mingw.patch ++ patch -p1 < $($(package)_patch_dir)/force-static-mingw.patch &&\ ++ patch -p1 < $($(package)_patch_dir)/0001-disable-soname.patch +endef + +define $(package)_config_cmds -+ cmake -DCMAKE_INSTALL_PREFIX=$(host_prefix) -DCMAKE_C_COMPILER=$($(package)_cc) . ++ CC="$($(package)_cc)" cmake -DCMAKE_INSTALL_PREFIX="$(host_prefix)" . ++endef ++ ++define $(package)_set_vars ++ $(package)_build_opts=CC="$($(package)_cc)" +endef + +define $(package)_build_cmds -+ $(MAKE) ++ CC="$($(package)_cc)" $(MAKE) +endef + +define $(package)_stage_cmds @@ -159,6 +181,60 @@ index 87b34599e..68a5b48ba 100644 $(package)_config_opts+=--prefix=$(host_prefix) endef +diff --git a/contrib/depends/patches/polyseed/0001-disable-soname.patch b/contrib/depends/patches/polyseed/0001-disable-soname.patch +new file mode 100644 +index 000000000..bd97dd394 +--- /dev/null ++++ b/contrib/depends/patches/polyseed/0001-disable-soname.patch +@@ -0,0 +1,48 @@ ++From aabafcfc0572651436d024a635483c49042fad7f Mon Sep 17 00:00:00 2001 ++From: Czarek Nakamoto ++Date: Thu, 28 Mar 2024 00:32:51 +0100 ++Subject: [PATCH] disable soname ++ ++--- ++ CMakeLists.txt | 16 +++++++++------- ++ 1 file changed, 9 insertions(+), 7 deletions(-) ++ ++diff --git a/CMakeLists.txt b/CMakeLists.txt ++index 8a8e7c2..5301353 100644 ++--- a/CMakeLists.txt +++++ b/CMakeLists.txt ++@@ -36,6 +36,7 @@ include_directories(polyseed ++ target_compile_definitions(polyseed PRIVATE POLYSEED_SHARED) ++ set_target_properties(polyseed PROPERTIES VERSION 2.0.0 ++ SOVERSION 2 +++ NO_SONAME 1 ++ C_STANDARD 11 ++ C_STANDARD_REQUIRED ON) ++ ++@@ -45,16 +46,17 @@ include_directories(polyseed_static ++ include/) ++ target_compile_definitions(polyseed_static PRIVATE POLYSEED_STATIC) ++ set_target_properties(polyseed_static PROPERTIES OUTPUT_NAME polyseed +++ NO_SONAME 1 ++ C_STANDARD 11 ++ C_STANDARD_REQUIRED ON) ++ ++-add_executable(polyseed-tests ++- tests/tests.c) ++-include_directories(polyseed-tests ++- include/) ++-target_compile_definitions(polyseed-tests PRIVATE POLYSEED_STATIC) ++-target_link_libraries(polyseed-tests ++- PRIVATE polyseed_static) +++# add_executable(polyseed-tests +++# tests/tests.c) +++# include_directories(polyseed-tests +++# include/) +++# target_compile_definitions(polyseed-tests PRIVATE POLYSEED_STATIC) +++# target_link_libraries(polyseed-tests +++# PRIVATE polyseed_static) ++ ++ include(GNUInstallDirs) ++ install(TARGETS polyseed polyseed_static ++-- ++2.39.2 diff --git a/contrib/depends/patches/polyseed/force-static-mingw.patch b/contrib/depends/patches/polyseed/force-static-mingw.patch new file mode 100644 index 000000000..f05cb2b6a @@ -253,7 +329,7 @@ index 000000000..dfb05d8ed +Subproject commit dfb05d8edb682b0e8f743b1b70c9131712ff4157 diff --git a/external/utf8proc b/external/utf8proc new file mode 160000 -index 000000000..dfb05d8ed +index 000000000..3de4596fb --- /dev/null +++ b/external/utf8proc @@ -0,0 +1 @@ -- cgit v1.2.3