File 05_use_system_json_spirit.patch of Package ethereum-cpp

From: Adam Mizerski <adam@mizerski.pl>
Date: 2019-02-12 20:48:31
Upstream: no
Subject: use system json_spirit

ethereum-cpp has bundled json_spirit library with an additional custom header
JsonSpiritHeaders.h. This patch adds this header to libdevcore and disables
using bundled code.

Index: ethereum-cpp-1.8.0/libdevcore/JsonSpiritHeaders.h
===================================================================
--- /dev/null
+++ ethereum-cpp-1.8.0/libdevcore/JsonSpiritHeaders.h
@@ -0,0 +1,32 @@
+/*
+	This file is part of cpp-ethereum.
+
+	cpp-ethereum is free software: you can redistribute it and/or modify
+	it under the terms of the GNU General Public License as published by
+	the Free Software Foundation, either version 3 of the License, or
+	(at your option) any later version.
+
+	cpp-ethereum is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with cpp-ethereum.  If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file JsonSpiritHeaders.h
+ * @author Tim Hughes <tim@twistedfury.com>
+ * @date 2014
+ */
+#pragma once
+
+#pragma warning(push)
+#pragma warning(disable: 4100)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+#include <json_spirit/json_spirit_reader_template.h>
+#include <json_spirit/json_spirit_writer_template.h>
+#pragma GCC diagnostic pop
+#pragma warning(pop)
+
Index: ethereum-cpp-1.8.0/libdevcore/JsonUtils.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/libdevcore/JsonUtils.cpp
+++ ethereum-cpp-1.8.0/libdevcore/JsonUtils.cpp
@@ -1,7 +1,7 @@
 // Aleth: Ethereum C++ client, tools and libraries.
 // Copyright 2014-2019 Aleth Authors.
 // Licensed under the GNU General Public License, Version 3.
-#include <json_spirit/JsonSpiritHeaders.h>
+#include "JsonSpiritHeaders.h"
 #include <libdevcore/JsonUtils.h>
 #include <boost/algorithm/string/join.hpp>
 #include <ostream>
Index: ethereum-cpp-1.8.0/libdevcore/JsonUtils.h
===================================================================
--- ethereum-cpp-1.8.0.orig/libdevcore/JsonUtils.h
+++ ethereum-cpp-1.8.0/libdevcore/JsonUtils.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <libdevcore/Exceptions.h>
-#include <json_spirit/JsonSpiritHeaders.h>
+#include "JsonSpiritHeaders.h"
 #include <set>
 #include <string>
 
Index: ethereum-cpp-1.8.0/libethereum/ChainParams.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/libethereum/ChainParams.cpp
+++ ethereum-cpp-1.8.0/libethereum/ChainParams.cpp
@@ -7,7 +7,7 @@
 #include "GenesisInfo.h"
 #include "State.h"
 #include "ValidationSchemes.h"
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcore/JsonUtils.h>
 #include <libdevcore/Log.h>
 #include <libdevcore/TrieDB.h>
Index: ethereum-cpp-1.8.0/libethereum/GenesisInfo.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/libethereum/GenesisInfo.cpp
+++ ethereum-cpp-1.8.0/libethereum/GenesisInfo.cpp
@@ -3,7 +3,7 @@
 // Licensed under the GNU General Public License, Version 3.
 
 #include <libdevcrypto/Common.h>
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include "GenesisInfo.h"
 
 using namespace dev;
Index: ethereum-cpp-1.8.0/libethereum/ValidationSchemes.h
===================================================================
--- ethereum-cpp-1.8.0.orig/libethereum/ValidationSchemes.h
+++ ethereum-cpp-1.8.0/libethereum/ValidationSchemes.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <string>
 
 namespace dev
Index: ethereum-cpp-1.8.0/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/CMakeLists.txt
+++ ethereum-cpp-1.8.0/CMakeLists.txt
@@ -92,7 +92,6 @@ if(MINIUPNPC)
     find_package(Miniupnpc 1.8.2013 REQUIRED)
 endif()
 
-set(UTILS_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/utils")
 
 configure_project()
 
Index: ethereum-cpp-1.8.0/libdevcrypto/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/libdevcrypto/CMakeLists.txt
+++ ethereum-cpp-1.8.0/libdevcrypto/CMakeLists.txt
@@ -2,5 +2,4 @@ file(GLOB SOURCES "*.cpp")
 file(GLOB HEADERS "*.h")
 
 add_library(devcrypto ${SOURCES} ${HEADERS})
-target_include_directories(devcrypto PRIVATE ${UTILS_INCLUDE_DIR})
 target_link_libraries(devcrypto PUBLIC devcore ${SECP256K1_LIBRARIES} PRIVATE ${LIBFF} ${LIBGMP} ${CRYPTOPP_LIBRARIES} ${LIBSCRYPT})
\ No newline at end of file
Index: ethereum-cpp-1.8.0/libethcore/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/libethcore/CMakeLists.txt
+++ ethereum-cpp-1.8.0/libethcore/CMakeLists.txt
@@ -2,5 +2,4 @@ file(GLOB sources "*.cpp" "*.h")
 
 add_library(ethcore ${sources})
 
-target_include_directories(ethcore PRIVATE "${UTILS_INCLUDE_DIR}")
 target_link_libraries(ethcore PUBLIC devcrypto devcore)
Index: ethereum-cpp-1.8.0/libethereum/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/libethereum/CMakeLists.txt
+++ ethereum-cpp-1.8.0/libethereum/CMakeLists.txt
@@ -2,5 +2,4 @@ file(GLOB sources "*.cpp" "*.h")
 
 add_library(ethereum ${sources})
 
-target_include_directories(ethereum PRIVATE "${UTILS_INCLUDE_DIR}")
 target_link_libraries(ethereum PUBLIC evm ethcore p2p devcrypto devcore jsoncpp PRIVATE Snappy::snappy Boost::fiber Boost::context)
Index: ethereum-cpp-1.8.0/rlp/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/rlp/CMakeLists.txt
+++ ethereum-cpp-1.8.0/rlp/CMakeLists.txt
@@ -1,3 +1,2 @@
 add_executable(rlp main.cpp)
-target_include_directories(rlp PRIVATE "${UTILS_INCLUDE_DIR}")
 target_link_libraries(rlp PRIVATE devcrypto devcore Boost::program_options)
Index: ethereum-cpp-1.8.0/test/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/test/CMakeLists.txt
+++ ethereum-cpp-1.8.0/test/CMakeLists.txt
@@ -39,7 +39,6 @@ set(unittest_sources
 )
 
 add_executable(aleth-unittests ${unittest_sources})
-target_include_directories(aleth-unittests PRIVATE ${UTILS_INCLUDE_DIR})
 target_link_libraries(aleth-unittests PRIVATE
     web3jsonrpc ethashseal devcrypto devcore
     GTest::GTest GTest::Main
@@ -117,7 +116,6 @@ hunter_add_package(yaml-cpp)
 find_package(yaml-cpp CONFIG REQUIRED)
 
 add_executable(testeth ${sources})
-target_include_directories(testeth PRIVATE ${UTILS_INCLUDE_DIR})
 target_link_libraries(testeth PRIVATE ethereum ethashseal web3jsonrpc devcrypto devcore aleth-buildinfo aleth-interpreter ${CRYPTOPP_LIBRARIES} yaml-cpp ${LIBJSONRPCCPP_CLIENT_LIBRARIES})
 install(TARGETS testeth DESTINATION ${CMAKE_INSTALL_BINDIR})
 
Index: ethereum-cpp-1.8.0/libdevcrypto/SecretStore.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/libdevcrypto/SecretStore.cpp
+++ ethereum-cpp-1.8.0/libdevcrypto/SecretStore.cpp
@@ -12,7 +12,7 @@
 #include <libdevcore/Guards.h>
 #include <libdevcore/SHA3.h>
 #include <libdevcore/FileSystem.h>
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcrypto/Exceptions.h>
 using namespace std;
 using namespace dev;
Index: ethereum-cpp-1.8.0/libethcore/KeyManager.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/libethcore/KeyManager.cpp
+++ ethereum-cpp-1.8.0/libethcore/KeyManager.cpp
@@ -7,7 +7,7 @@
 #include <thread>
 #include <mutex>
 #include <boost/filesystem.hpp>
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcore/Log.h>
 #include <libdevcore/Guards.h>
 #include <libdevcore/RLP.h>
Index: ethereum-cpp-1.8.0/rlp/main.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/rlp/main.cpp
+++ ethereum-cpp-1.8.0/rlp/main.cpp
@@ -2,7 +2,7 @@
 // Copyright 2015-2019 Aleth Authors.
 // Licensed under the GNU General Public License, Version 3.
 
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcore/Base64.h>
 #include <libdevcore/CommonIO.h>
 #include <libdevcore/RLP.h>
Index: ethereum-cpp-1.8.0/test/tools/jsontests/RLPTests.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/test/tools/jsontests/RLPTests.cpp
+++ ethereum-cpp-1.8.0/test/tools/jsontests/RLPTests.cpp
@@ -4,7 +4,7 @@
 
 /// @file
 /// RLP unit tests.
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcore/Common.h>
 #include <libdevcore/CommonIO.h>
 #include <libdevcore/Log.h>
Index: ethereum-cpp-1.8.0/test/tools/jsontests/StateTests.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/test/tools/jsontests/StateTests.cpp
+++ ethereum-cpp-1.8.0/test/tools/jsontests/StateTests.cpp
@@ -7,7 +7,7 @@
 #include <boost/filesystem/operations.hpp>
 #include <boost/test/unit_test.hpp>
 
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcore/CommonIO.h>
 #include <libethereum/BlockChain.h>
 #include <libethereum/State.h>
Index: ethereum-cpp-1.8.0/test/unittests/libdevcrypto/SecretStore.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/test/unittests/libdevcrypto/SecretStore.cpp
+++ ethereum-cpp-1.8.0/test/unittests/libdevcrypto/SecretStore.cpp
@@ -5,7 +5,7 @@
 #include <fstream>
 #include <boost/test/unit_test.hpp>
 #include <boost/filesystem.hpp>
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcrypto/SecretStore.h>
 #include <libdevcore/CommonIO.h>
 #include <libdevcore/TrieDB.h>
Index: ethereum-cpp-1.8.0/test/unittests/libdevcrypto/hexPrefix.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/test/unittests/libdevcrypto/hexPrefix.cpp
+++ ethereum-cpp-1.8.0/test/unittests/libdevcrypto/hexPrefix.cpp
@@ -4,7 +4,7 @@
 
 #include <fstream>
 #include <boost/test/unit_test.hpp>
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcore/Log.h>
 #include <libdevcore/CommonIO.h>
 #include <libdevcore/Base64.h>
Index: ethereum-cpp-1.8.0/test/unittests/libdevcrypto/trie.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/test/unittests/libdevcrypto/trie.cpp
+++ ethereum-cpp-1.8.0/test/unittests/libdevcrypto/trie.cpp
@@ -3,7 +3,7 @@
 // Licensed under the GNU General Public License, Version 3.
 #include <fstream>
 #include <boost/test/unit_test.hpp>
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcore/CommonIO.h>
 #include <libdevcore/TrieDB.h>
 #include <libdevcore/TrieHash.h>
Index: ethereum-cpp-1.8.0/test/unittests/libethereum/Genesis.cpp
===================================================================
--- ethereum-cpp-1.8.0.orig/test/unittests/libethereum/Genesis.cpp
+++ ethereum-cpp-1.8.0/test/unittests/libethereum/Genesis.cpp
@@ -8,7 +8,7 @@
 #include <fstream>
 #include <random>
 
-#include <json_spirit/JsonSpiritHeaders.h>
+#include <libdevcore/JsonSpiritHeaders.h>
 #include <libdevcore/CommonIO.h>
 #include <libethereum/BlockChain.h>
 #include <libethashseal/GenesisInfo.h>
Index: ethereum-cpp-1.8.0/aleth-vm/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/aleth-vm/CMakeLists.txt
+++ ethereum-cpp-1.8.0/aleth-vm/CMakeLists.txt
@@ -2,6 +2,4 @@ add_executable(aleth-vm main.cpp)
 
 target_link_libraries(aleth-vm PRIVATE ethereum evm ethashseal devcore Boost::program_options)
 
-target_include_directories(aleth-vm PRIVATE ../utils)
-
 install(TARGETS aleth-vm EXPORT alethTargets DESTINATION bin)
Index: ethereum-cpp-1.8.0/aleth/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/aleth/CMakeLists.txt
+++ ethereum-cpp-1.8.0/aleth/CMakeLists.txt
@@ -11,8 +11,6 @@ target_link_libraries(
     PRIVATE ethereum ethashseal evm web3jsonrpc webthree devcore Boost::program_options
 )
 
-target_include_directories(aleth PRIVATE ../utils)
-
 if(MINIUPNPC)
     target_compile_definitions(aleth PRIVATE ETH_MINIUPNPC)
 endif()
Index: ethereum-cpp-1.8.0/libdevcore/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/libdevcore/CMakeLists.txt
+++ ethereum-cpp-1.8.0/libdevcore/CMakeLists.txt
@@ -59,7 +59,7 @@ add_library(
 )
 
 # Needed to prevent including system-level boost headers:
-target_include_directories(devcore SYSTEM PUBLIC ${Boost_INCLUDE_DIR} PRIVATE ../utils)
+target_include_directories(devcore SYSTEM PUBLIC ${Boost_INCLUDE_DIR})
 
 target_link_libraries(devcore PUBLIC aleth-buildinfo Boost::filesystem Boost::system Boost::log Boost::thread Boost::program_options Threads::Threads ethash::ethash)
 
Index: ethereum-cpp-1.8.0/libethashseal/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/libethashseal/CMakeLists.txt
+++ ethereum-cpp-1.8.0/libethashseal/CMakeLists.txt
@@ -10,5 +10,4 @@ set(sources
 )
 
 add_library(ethashseal ${sources})
-target_include_directories(ethashseal PRIVATE ../utils)
 target_link_libraries(ethashseal PUBLIC ethereum ethcore)
Index: ethereum-cpp-1.8.0/libwebthree/CMakeLists.txt
===================================================================
--- ethereum-cpp-1.8.0.orig/libwebthree/CMakeLists.txt
+++ ethereum-cpp-1.8.0/libwebthree/CMakeLists.txt
@@ -1,3 +1,2 @@
 add_library(webthree WebThree.cpp WebThree.h)
-target_include_directories(webthree PRIVATE ../utils)
 target_link_libraries(webthree PUBLIC ethereum p2p devcore PRIVATE ethashseal)
openSUSE Build Service is sponsored by