From ca8fe7e9feef8899d83510d3cc6178ad06b62874 Mon Sep 17 00:00:00 2001 From: Florian Omnes Date: Wed, 24 Mar 2021 14:53:08 +0100 Subject: [PATCH] Remove libcurl dependency --- INSTALL-centos.md | 1 - INSTALL-ubuntu.md | 7 +++-- INSTALL-windows.md | 4 +-- INSTALL.md | 1 - THANKS.txt | 11 +------- docker/centos8-ortools | 2 +- docker/ubuntu-ortools | 2 +- src/CMakeLists.txt | 9 ++----- src/distrib/win32/sourcefiles.inc.nsh | 3 --- src/ext/ext changelog.txt | 10 ------- src/internet/CMakeLists.txt | 10 ------- src/internet/hello_web.cpp | 30 --------------------- src/libs/antares/proxy/proxy.cpp | 1 - src/script_compilation | 7 ----- src/ui/simulator/windows/about/aboutbox.cpp | 3 --- 15 files changed, 9 insertions(+), 92 deletions(-) diff --git a/INSTALL-centos.md b/INSTALL-centos.md index 1639ff618f..62dad211ed 100644 --- a/INSTALL-centos.md +++ b/INSTALL-centos.md @@ -53,7 +53,6 @@ pip3 install -r src/tests/examples/requirements.txt ## [Dependencies](#deps) ANTARES depends on several mandatory libraries. - - [CURL](https://github.com/curl/curl) - [Sirius Solver](https://github.com/AntaresSimulatorTeam/sirius-solver/tree/Antares_VCPKG) (fork from [RTE](https://github.com/rte-france/sirius-solver/tree/Antares_VCPKG)) - [OR-Tools](https://github.com/AntaresSimulatorTeam/or-tools/tree/rte_dev_sirius) (fork from [RTE](https://github.com/rte-france/or-tools/tree/rte_dev_sirius) based on official OR-Tools github) - [wxWidgets](https://github.com/wxWidgets/wxWidgets) diff --git a/INSTALL-ubuntu.md b/INSTALL-ubuntu.md index 07434bf410..7033b02fd1 100644 --- a/INSTALL-ubuntu.md +++ b/INSTALL-ubuntu.md @@ -34,7 +34,6 @@ pip3 install -r src/src/tests/examples/requirements.txt ## [Dependencies](#deps) ANTARES depends on several mandatory libraries. - - [CURL](https://github.com/curl/curl) - [Sirius Solver](https://github.com/AntaresSimulatorTeam/sirius-solver/tree/Antares_VCPKG) (fork from [RTE](https://github.com/rte-france/sirius-solver/tree/Antares_VCPKG)) - [OR-Tools](https://github.com/AntaresSimulatorTeam/or-tools/tree/rte_dev_sirius) (fork from [RTE](https://github.com/rte-france/or-tools/tree/rte_dev_sirius) based on official OR-Tools github) - [wxWidgets](https://github.com/wxWidgets/wxWidgets) @@ -49,7 +48,7 @@ The install procedure can be done #### Command to install dependencies ``` -sudo apt install uuid-dev libcurl4-openssl-dev libwxgtk3.0-gtk3-dev libboost-test-dev libboost-filesystem-dev libboost-regex-dev libboost-dev +sudo apt install uuid-dev libwxgtk3.0-gtk3-dev libboost-test-dev libboost-filesystem-dev libboost-regex-dev libboost-dev ``` ### [Automatic librairies compilation from git](#git_compil) @@ -71,7 +70,7 @@ By default the install directory is `/../rte-antares-deps- Note : > `DEPS_INSTALL_DIR` is added to `CMAKE_PREFIX_PATH` -> If the dependency install directory contains CURL, OPENSSL or wxWidgets pre-compiled libraries an additionnal option must be used at configure time `-DUSE_PRECOMPILED_EXT=ON` +> If the dependency install directory contains wxWidgets pre-compiled libraries an additionnal option must be used at configure time `-DUSE_PRECOMPILED_EXT=ON` ### Pre-compiled libraries download : release version only You can download pre-compiled antares-deps archive from [Antares dependencies compilation repository](https://github.com/AntaresSimulatorTeam/antares-deps/releases/tag/v1.1.0). Only release version are available. @@ -188,5 +187,5 @@ cpack -G TGZ . There are still some system libraries that must be installed if you want to use *ANTARES*: ``` -sudo apt-get install libcurl4 libwxgtk3.0-gtk3-0v5 +sudo apt-get install libwxgtk3.0-gtk3-0v5 ``` diff --git a/INSTALL-windows.md b/INSTALL-windows.md index 8ee4daa6b2..beac77ca9c 100644 --- a/INSTALL-windows.md +++ b/INSTALL-windows.md @@ -32,7 +32,6 @@ pip install -r src/tests/examples/requirements.txt ## [Dependencies](#deps) ANTARES depends on several mandatory libraries. - - [CURL](https://github.com/curl/curl) - [Sirius Solver](https://github.com/AntaresSimulatorTeam/sirius-solver/tree/Antares_VCPKG) (fork from [RTE](https://github.com/rte-france/sirius-solver/tree/Antares_VCPKG)) - [OR-Tools](https://github.com/AntaresSimulatorTeam/or-tools/tree/rte_dev_sirius) (fork from [RTE](https://github.com/rte-france/or-tools/tree/rte_dev_sirius) based on official OR-Tools github) - [wxWidgets](https://github.com/wxWidgets/wxWidgets) @@ -73,7 +72,6 @@ Note : #### 2 Install dependencies ``` cd [vcpkg_root] -vcpkg install curl:[vcpg-triplet] vcpkg install wxwidgets:[vcpg-triplet] vcpkg install boost-test:[vcpg-triplet] vcpkg install boost-filesystem:[vcpg-triplet] @@ -100,7 +98,7 @@ By default the install directory is `/../rte-antares-deps- Note : > `DEPS_INSTALL_DIR` is added to `CMAKE_PREFIX_PATH` -> If the dependency install directory contains CURL or wxWidgets pre-compiled libraries an additionnal option must be used at configure time `-DUSE_PRECOMPILED_EXT=ON` +> If the dependency install directory contains wxWidgets pre-compiled libraries an additionnal option must be used at configure time `-DUSE_PRECOMPILED_EXT=ON` ### Pre-compiled libraries download : release version only You can download pre-compiled antares-deps archive from [Antares dependencies compilation repository](https://github.com/AntaresSimulatorTeam/antares-deps/releases/tag/v1.1.0). Only release version are available. diff --git a/INSTALL.md b/INSTALL.md index ee8d247eb1..9fe6111f97 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -51,7 +51,6 @@ Git version must be above 2.15 for external dependencies build because `--ignore ## [Dependencies](#deps) *ANTARES* depends on severals mandatory libraries. - - [CURL](https://github.com/curl/curl) - [Sirius Solver](https://github.com/AntaresSimulatorTeam/sirius-solver/tree/Antares_VCPKG) (fork from [RTE](https://github.com/rte-france/sirius-solver/tree/Antares_VCPKG)) - [OR-Tools](https://github.com/AntaresSimulatorTeam/or-tools/tree/rte_dev_sirius) (fork from [RTE](https://github.com/rte-france/or-tools/tree/rte_dev_sirius) based on official OR-Tools github) - [wxWidgets](https://github.com/wxWidgets/wxWidgets) diff --git a/THANKS.txt b/THANKS.txt index ac7c9720a8..7e585615ca 100644 --- a/THANKS.txt +++ b/THANKS.txt @@ -8,15 +8,6 @@ are distributed along with Antares_Simulator with NO WARRANTY: Wxwidgets 3.0.2 Copyright (c) 1998-2017 The wxWidget Team license: wxWindows Library License,V3.1 https://spdx.org/licenses/wxWindows.html -libCurl 7.51.0 Copyright (c) 1996-2017 Daniel Stenberg et al -license: curl license https://spdx.org/licenses/curl.html - -OpenSSL 1.1.0 Copyright (c) 1998-2016 The OpenSSL Project -"This product includes software developed by the OpenSSL Project -for use in the OpenSSL Toolkit (http://www.openssl.org/)" -"This product includes software written by Tim Hudson (tjh@cryptsoft.com)" -license: OpenSSL license and SSLeay license https://spdx.org/licenses/OpenSSL.html - libYuni 1.1.0 https://github.com/libyuni license: Mozilla Public License 2.0 https://spdx.org/licenses/MPL-2.0.html @@ -42,4 +33,4 @@ Special thanks are due to a few Authors without whom Antares_Simulator would not Papa Ndiaye (system map editor, constraints builder, power flow physics) Guillaume Pierre (parallel computing, generic power storage facility modelling) Sylvain Marandon (also author of the Antares_Data_Organizer application) - Michel Doquet (project initiator) \ No newline at end of file + Michel Doquet (project initiator) diff --git a/docker/centos8-ortools b/docker/centos8-ortools index c6eff53fc4..b492469288 100644 --- a/docker/centos8-ortools +++ b/docker/centos8-ortools @@ -9,7 +9,7 @@ RUN yum install -y epel-release # Install requirements RUN yum install -y git redhat-lsb-core gcc gcc-c++ make \ wget \ - unzip libcurl-devel wxGTK3-devel libuuid-devel boost-devel boost-test boost-filesystem boost-regex + unzip wxGTK3-devel libuuid-devel boost-devel boost-test boost-filesystem boost-regex # Install CMake3 RUN wget https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3.tar.gz &&\ diff --git a/docker/ubuntu-ortools b/docker/ubuntu-ortools index 321e48993e..3c820fe7e7 100644 --- a/docker/ubuntu-ortools +++ b/docker/ubuntu-ortools @@ -9,7 +9,7 @@ RUN apt-get update -y --fix-missing RUN apt-get install -y build-essential git cmake \ wget \ unzip \ - libssl-dev libuuid1 uuid-dev libssh2-1 libssh2-1-dev libidn2-dev libidn11 libidn11-dev libwxgtk3.0-gtk3-dev libcurl4-openssl-dev libb64-dev \ + libssl-dev libuuid1 uuid-dev libssh2-1 libssh2-1-dev libidn2-dev libidn11 libidn11-dev libwxgtk3.0-gtk3-dev libb64-dev \ libboost-test-dev libboost-filesystem-dev libboost-regex-dev libboost-dev diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ebd5e41b2d..20271b7321 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -194,11 +194,6 @@ message(STATUS "CMAKE_PREFIX_PATH : ${CMAKE_PREFIX_PATH}") # Build Needed dependencies add_subdirectory(antares-deps) -# Define needed external library - -#libcurl -find_package(CURL REQUIRED) - #Add needed definition in case of external dependencies compilation include (antares-deps/cmake/additionnal-definitions.cmake) @@ -366,8 +361,8 @@ else() set(CPACK_PACKAGE_VERSION_MINOR ${ANTARES_VERSION_LO}) set(CPACK_PACKAGE_VERSION_PATCH ${ANTARES_VERSION_REVISION}) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "libcurl4,libwxgtk3.0-gtk3-0v5") - set(CPACK_RPM_PACKAGE_REQUIRES "curl,wxGTK3") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "libwxgtk3.0-gtk3-0v5") + set(CPACK_RPM_PACKAGE_REQUIRES "wxGTK3") set(CPACK_RPM_PACKAGE_AUTOREQPROV "0") configure_file("distrib/unix/packages.cmake" "distrib/unix/packages.sh") diff --git a/src/distrib/win32/sourcefiles.inc.nsh b/src/distrib/win32/sourcefiles.inc.nsh index ba90c7b269..0b0ed64b9a 100644 --- a/src/distrib/win32/sourcefiles.inc.nsh +++ b/src/distrib/win32/sourcefiles.inc.nsh @@ -20,8 +20,5 @@ File /r ${ANTARES_SRC_DIR}\..\resources\*.* ; TODO For now build_deps source are not provided -;${SetOutPath} "$INSTDIR\Sources\src\build_deps\curl\source" -;File /nonfatal /r /x builds .git ${ANTARES_SRC_DIR}\..\src\build_deps\curl\source\*.* - ;${SetOutPath} "$INSTDIR\Sources\src\build_deps\wxWidgets\source" ;File /nonfatal /r /x .git ${ANTARES_SRC_DIR}\..\src\build_deps\wxWidgets\source\*.* \ No newline at end of file diff --git a/src/ext/ext changelog.txt b/src/ext/ext changelog.txt index 6be6826172..4069ac3acd 100644 --- a/src/ext/ext changelog.txt +++ b/src/ext/ext changelog.txt @@ -23,13 +23,3 @@ ms\do_ms nmake -f ms\nt.mak nmake -f ms\nt.mak install -libcurl build options -x86: -"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat" -cd ${ANTARES}\src\ext\libcurl\winbuild -nmake /f Makefile.vc mode=static VC=14 WITH_SSL=static WITH_DEVEL=../../openssl/vc-release-x86 ENABLE_SSPI=no ENABLE_IDN=no ENABLE_WINSSL=no GEN_PDB=no DEBUG=no MACHINE=x86 - -x64: -"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" -cd ${ANTARES}\src\ext\libcurl\winbuild -nmake /f Makefile.vc mode=static VC=14 ENABLE_SSPI=no ENABLE_IDN=no ENABLE_WINSSL=no GEN_PDB=no DEBUG=no MACHINE=x64 diff --git a/src/internet/CMakeLists.txt b/src/internet/CMakeLists.txt index b796537198..17d362a8a6 100644 --- a/src/internet/CMakeLists.txt +++ b/src/internet/CMakeLists.txt @@ -20,22 +20,12 @@ target_include_directories(libantares-license PRIVATE ${CMAKE_SOURCE_DIR}/ext/yuni/src ${CMAKE_SOURCE_DIR}/libs - PUBLIC - ${CURL_INCLUDE_DIRS} ) target_link_libraries(libantares-license PRIVATE yuni-static-core PUBLIC - ${CURL_LIBRARIES} base64 ) -if(WIN32 OR WIN64) -#VCPKG define CURL::libcurl -target_link_libraries(libantares-license - PUBLIC - CURL::libcurl - ) -endif() diff --git a/src/internet/hello_web.cpp b/src/internet/hello_web.cpp index ca73fa1b07..fbde1a87b0 100644 --- a/src/internet/hello_web.cpp +++ b/src/internet/hello_web.cpp @@ -45,7 +45,6 @@ #include "licensetimer.h" #include "base64/cencode.h" #include "decrypt.hxx" -#include #include using namespace Yuni; @@ -144,35 +143,6 @@ static inline void Fremoverootca() std::remove(filename.c_str()); } -#ifndef NDEBUG -// Debug mode for the license manager -inline CURLcode curlDebugPerform(CURL* x) -{ - auto tempname = tmpnam(NULL); - auto pFile = fopen(tempname, "w"); - curl_easy_setopt(x, CURLOPT_VERBOSE, 1); - curl_easy_setopt(x, CURLOPT_STDERR, pFile); - auto code = curl_easy_perform(x); - // TODO : removed because cause crashes on windows (maybe related to curl version tested - // (7.53.1) : does curl close file handle ? fclose(pFile); - std::ifstream filestream(tempname); - string ligne; - if (filestream) // si l'ouverture a fonctionné - { - while (getline(filestream, ligne)) - { - logs.debug() << ligne; - } - } - filestream.close(); - remove(tempname); - return code; -} - -#define CURL_PERFORM(x) curlDebugPerform(x) -#else -#define CURL_PERFORM(x) curl_easy_perform(x) -#endif template static void IterateAllLicenseActivationKeys(uint version, const PredicateT& callback) diff --git a/src/libs/antares/proxy/proxy.cpp b/src/libs/antares/proxy/proxy.cpp index d4dcb31ec0..9769185f37 100644 --- a/src/libs/antares/proxy/proxy.cpp +++ b/src/libs/antares/proxy/proxy.cpp @@ -37,7 +37,6 @@ #include "../../../internet/license.h" #include "../../../internet/base64/cencode.h" #include "../../../internet/decrypt.hxx" -#include #include #include diff --git a/src/script_compilation b/src/script_compilation index 9e30c81057..abca8cb18c 100755 --- a/src/script_compilation +++ b/src/script_compilation @@ -8,13 +8,6 @@ git submodule update --init --recursive cd src/ext -#CURL -cd ../libcurl -./buildconf -export LIBS="-ldl -lpthread" -./configure --disable-shared --disable-ldap --without-libidn --without-libssh2 --without-zlib -make - #export CC=/usr/local/gcc/4.8/bin/gcc-4.8 #export CXX=/usr/local/gcc/4.8/bin/g++-4.8 diff --git a/src/ui/simulator/windows/about/aboutbox.cpp b/src/ui/simulator/windows/about/aboutbox.cpp index a4ecfbc827..115dc2a241 100644 --- a/src/ui/simulator/windows/about/aboutbox.cpp +++ b/src/ui/simulator/windows/about/aboutbox.cpp @@ -74,9 +74,6 @@ are distributed along with Antares_Simulator with NO WARRANTY:\n\ Wxwidgets 3.0.2 Copyright (c) 1998-2017 The wxWidget Team\n\ license: wxWindows Library License,V3.1 https://spdx.org/licenses/wxWindows.html\n\ \n\ -libCurl 7.51.0 Copyright (c) 1996-2017 Daniel Stenberg et al \n\ -license: curl license https://spdx.org/licenses/curl.html\n\ -\n\ libYuni 1.1.0 https://github.com/libyuni \n\ license: Mozilla Public License 2.0 https://spdx.org/licenses/MPL-2.0.html\n\ \n\