desura / Desurium

Free online games platform (juegos gratis), with an open source client. LGPL repo for Desura client. Potentially out of date. See https://github.com/desura/desura-app for newest (LGPL) client.
https://www.desura.com/es
GNU General Public License v3.0
268 stars 44 forks source link

Desurium build fails if local libcurl < 7.19 #661

Closed nat-goodspeed closed 10 years ago

nat-goodspeed commented 10 years ago

Trying to build Desurium on MacBook Pro whose /usr/local/include/curl/curlver.h contains:

define LIBCURL_VERSION "7.18.0"

produces (at least) the following errors:

/Users/nat/desura/Desurium/src/static/util/code/UtilWeb.cpp:654:35: error: use of undeclared identifier 'CURLOPT_USERNAME' curl_easy_setopt(m_pCurlHandle, CURLOPT_USERNAME, m_szUser.c_str()); /Users/nat/desura/Desurium/src/static/util/code/UtilWeb.cpp:657:35: error: use of undeclared identifier 'CURLOPT_PASSWORD' curl_easy_setopt(m_pCurlHandle, CURLOPT_PASSWORD, m_szPass.c_str());

Is it worth introducing CMake logic to check version, and if < 7.19, download and build libcurl? Or at least produce an error message about minimum required libcurl version?

Put differently: how likely is it that any other interested parties will have a libcurl install < 7.19?

nat-goodspeed commented 10 years ago

Hmm! The following patch at least produces the suggested error message:

index 2da73dd..d5ee84c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,7 +146,7 @@ if(NOT BUILD_ONLY_CEF)
   find_package(Boost COMPONENTS date_time filesystem thread system ${Boost_ADDITION_LIBS})

   if(NOT WITH_ARES OR APPLE)
-    find_package(CURL ${REQUIRED_IF_OPTION})
+    find_package(CURL 7.19 ${REQUIRED_IF_OPTION})
   endif()

   if(NOT WIN32)

Output on my system:

-- Could NOT find CURL: Found unsuitable version "7.18.0", but required is at least "7.19" (found /usr/local/lib/libcurl.dylib)

That seems worth doing.

Moreover, the ensuing output suggests that CMake went on to try to build CURL, but failed for lack of cares:

CMake Error at /Applications/CMake 2.8-12.app/Contents/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find cares (missing: CARES_INCLUDE_DIR CARES_LIBRARIES) Call Stack (most recent call first): /Applications/CMake 2.8-12.app/Contents/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE) cmake/modules/Findcares.cmake:22 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) cmake/modules/BuildCURL.cmake:5 (find_package) CMakeLists.txt:307 (include)

So if cares were already present, could we assume that the patch above would Do The Right Thing: fetching and building a sufficiently recent libcurl?

karolherbst commented 10 years ago

I am sure this version is that much outdated, that you have to fear so many security holes, that you should upgrade libcurl. Whcih version of mac os x are you using?

karolherbst commented 10 years ago

And this c-ares thing will go away in the future: https://github.com/desura/Desurium/pull/618