[patches folder][] in the KiCad source. These patches are named by the platform name they should
be applied against.
-## OpenSSL Secure Socket Layer Library ## {#openssl}
-
-The [OpenSSL][] library is only required when the KiCad build is configured with the Github plugin
-enabled. See the [KiCad Build Configuration Options](#build_opts)` section for more information.
-Please note that KiCad will download and build version 1.0.1e of OpenSSL by default. You should
-probably use the version of OpenSSL installed on your system as it will most likely be more up to
-date and contain the latest security fixes.
-
## GLEW OpenGL Extension Wrangler Library ## {#glew}
The [OpenGL Extension Wrangler][GLEW] is an OpenGL helper library used by the KiCad graphics
mingw-w64-x86_64-boost \
mingw-w64-x86_64-cairo \
mingw-w64-x86_64-glew \
- mingw-w64-x86_64-openssl \
+ mingw-w64-x86_64-curl \
mingw-w64-x86_64-wxPython \
mingw-w64-x86_64-wxWidgets
cd kicad-source
-DCMAKE_PREFIX_PATH=/mingw64 \
-DCMAKE_INSTALL_PREFIX=/mingw64 \
-DDEFAULT_INSTALL_PATH=/mingw64 \
- -DOPENSSL_ROOT_DIR=/mingw64 \
-DKICAD_SKIP_BOOST=ON \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
[wxWidgets]: http://wxwidgets.org/
[patches folder]: http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/files/head:/patches/
[Boost]: http://www.boost.org/
-[OpenSSL]: https://www.openssl.org/
[GLEW]: http://glew.sourceforge.net/
[GLUT]: https://www.opengl.org/resources/libraries/glut/
[Cairo]: http://cairographics.org/
* @brief EDA_BASE_FRAME class implementation.
*/
+#include <kicad_curl/kicad_curl.h> /* Include before any wx file */
#include <wx/aboutdlg.h>
#include <wx/fontdlg.h>
#include <wx/clipbrd.h>
<< ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
<< ( BOOST_VERSION % 100 ) << wxT( "\n" );
+ msg_version << KICAD_CURL::GetSimpleVersion() << wxT( "\n" );
+
msg_version << wxT( " USE_WX_GRAPHICS_CONTEXT=" );
#ifdef USE_WX_GRAPHICS_CONTEXT
msg_version << wxT( "ON\n" );
}
+std::string KICAD_CURL::GetSimpleVersion()
+{
+ curl_version_info_data *info = curl_version_info(CURLVERSION_NOW);
+
+ std::string res;
+
+ if( info->version )
+ {
+ res += "libcurl version: " + std::string(info->version);
+ }
+
+ res += " (";
+ if( info->features & CURL_VERSION_SSL )
+ {
+ res += "with SSL - ";
+ res += std::string(info->ssl_version);
+ }
+ else
+ {
+ res += "without SSL";
+ }
+ res += ")";
+
+ return res;
+}
+
bool KICAD_CURL::m_initialized = false;
\ No newline at end of file
THROW_IO_ERROR( "Unable to initialize CURL session" );
}
- m_Buffer.payload = (char*)malloc( 1 );
- m_Buffer.size = 0;
+ m_Buffer.Payload = (char*)malloc( 1 );
+ m_Buffer.Size = 0;
curl_easy_setopt( m_CURL, CURLOPT_WRITEFUNCTION, write_callback );
curl_easy_setopt( m_CURL, CURLOPT_WRITEDATA, (void *)&m_Buffer );
KICAD_CURL_EASY::~KICAD_CURL_EASY()
{
- free(m_Buffer.payload);
+ free(m_Buffer.Payload);
curl_easy_cleanup(m_CURL);
}
struct KICAD_EASY_CURL_BUFFER *p = ( struct KICAD_EASY_CURL_BUFFER * ) userp;
/* expand buffer */
- p->payload = (char *) realloc( p->payload, p->size + realsize + 1 );
+ p->Payload = (char *) realloc( p->Payload, p->Size + realsize + 1 );
/* check buffer */
- if ( p->payload == NULL )
+ if ( p->Payload == NULL )
{
wxLogError( wxT( "Failed to expand buffer in curl_callback" ) );
/* free buffer */
- free( p->payload );
+ free( p->Payload );
return -1;
}
/* copy contents to buffer */
- memcpy( &(p->payload[p->size]), contents, realsize );
+ memcpy( &(p->Payload[p->Size]), contents, realsize );
/* set new buffer size */
- p->size += realsize;
+ p->Size += realsize;
/* ensure null termination */
- p->payload[p->size] = 0;
+ p->Payload[p->Size] = 0;
/* return size */
return realsize;
curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
}
- if( m_Buffer.size > 0 )
+ if( m_Buffer.Size > 0 )
{
- free( m_Buffer.payload );
- m_Buffer.payload = (char*)malloc( 1 );
- m_Buffer.size = 0;
+ free( m_Buffer.Payload );
+ m_Buffer.Payload = (char*)malloc( 1 );
+ m_Buffer.Size = 0;
}
CURLcode res = curl_easy_perform( m_CURL );
*/
static std::string GetVersion();
+ /**
+ * Function GetSimpleVersion
+ * Reports back curl version only and SSL library support
+ *
+ * @return std::string - Generated version string
+ */
+ static std::string GetSimpleVersion();
private:
static bool m_initialized;
};
*/
struct KICAD_EASY_CURL_BUFFER
{
- char* payload;
- size_t size;
+ char* Payload;
+ size_t Size;
};
* @param aArg is the argument being passed to CURL, ensure it is the right type per manual
* @return CURLcode - CURL error code, will return CURLE_OK unless a problem was encountered
*/
- template <typename T> CURLcode SetOption( CURLoption aOption, T aArg )
+ template <typename T> CURLcode SetOption( CURLoption aOption, T aArg )
{
return curl_easy_setopt( m_CURL, aOption, aArg );
}
add_library( github_plugin STATIC ${GITHUB_PLUGIN_SRCS} )
-# No, you don't get github without boost and openssl. Boost_LIBRARIES now moved up
-# into CMakeLists.txt for pcbnew and cvpcb:
target_link_libraries( github_plugin
common
)
bool GITHUB_GETLIBLIST::remoteGetJSON( const std::string& aFullURLCommand, wxString* aMsgError )
{
KICAD_CURL_EASY kcurl;
-
+
wxLogDebug( wxT( "Attempting to download: " ) + aFullURLCommand );
kcurl.SetURL(aFullURLCommand);
try
{
kcurl.Perform();
- m_image.assign(kcurl.GetBuffer()->payload, kcurl.GetBuffer()->size);
+ m_image.reserve( kcurl.GetBuffer()->Size );
+ m_image.assign( kcurl.GetBuffer()->Payload, kcurl.GetBuffer()->Size );
return true;
}
catch( const IO_ERROR& ioe )
try
{
kcurl.Perform();
- m_zip_image.assign(kcurl.GetBuffer()->payload, kcurl.GetBuffer()->size);
+ m_zip_image.reserve( kcurl.GetBuffer()->Size );
+ m_zip_image.assign( kcurl.GetBuffer()->Payload, kcurl.GetBuffer()->Size );
}
catch( const IO_ERROR& ioe )
{