Skip to content

Commit

Permalink
Remove libcurl dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Mar 24, 2021
1 parent bc4a458 commit ca8fe7e
Show file tree
Hide file tree
Showing 15 changed files with 9 additions and 92 deletions.
1 change: 0 additions & 1 deletion INSTALL-centos.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions INSTALL-ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -71,7 +70,7 @@ By default the install directory is `<antares_checkout_dir>/../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.
Expand Down Expand Up @@ -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
```
4 changes: 1 addition & 3 deletions INSTALL-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]
Expand All @@ -100,7 +98,7 @@ By default the install directory is `<antares_checkout_dir>/../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.
Expand Down
1 change: 0 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 1 addition & 10 deletions THANKS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected])"
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

Expand All @@ -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)
Michel Doquet (project initiator)
2 changes: 1 addition & 1 deletion docker/centos8-ortools
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&\
Expand Down
2 changes: 1 addition & 1 deletion docker/ubuntu-ortools
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
9 changes: 2 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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")
Expand Down
3 changes: 0 additions & 3 deletions src/distrib/win32/sourcefiles.inc.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -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\*.*
10 changes: 0 additions & 10 deletions src/ext/ext changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 0 additions & 10 deletions src/internet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

30 changes: 0 additions & 30 deletions src/internet/hello_web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include "licensetimer.h"
#include "base64/cencode.h"
#include "decrypt.hxx"
#include <curl/curl.h>
#include <fstream>

using namespace Yuni;
Expand Down Expand Up @@ -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<class PredicateT>
static void IterateAllLicenseActivationKeys(uint version, const PredicateT& callback)
Expand Down
1 change: 0 additions & 1 deletion src/libs/antares/proxy/proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "../../../internet/license.h"
#include "../../../internet/base64/cencode.h"
#include "../../../internet/decrypt.hxx"
#include <curl/curl.h>
#include <sstream>
#include <yuni/core/utils/hexdump.h>

Expand Down
7 changes: 0 additions & 7 deletions src/script_compilation
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions src/ui/simulator/windows/about/aboutbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down

0 comments on commit ca8fe7e

Please sign in to comment.