Skip to content

Commit

Permalink
Merge pull request #1 from uilianries/libcurl
Browse files Browse the repository at this point in the history
Apply Conan conventions
  • Loading branch information
jgsogo authored Nov 18, 2019
2 parents 4b032b7 + 115315d commit e61b661
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
3 changes: 3 additions & 0 deletions recipes/libcurl/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"7.67.0":
sha256: 52af3361cf806330b88b4fe6f483b6844209d47ae196ac46da4de59bb361ab02
url: https://curl.haxx.se/download/curl-7.67.0.tar.gz
"7.66.0":
sha256: d0393da38ac74ffac67313072d7fe75b1fa1010eb5987f63f349b024a36b7ffb
url: https://curl.haxx.se/download/curl-7.66.0.tar.gz
Expand Down
28 changes: 15 additions & 13 deletions recipes/libcurl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class LibcurlConan(ConanFile):
description = "command line tool and library for transferring data with URLs"
topics = ("conan", "libcurl", "data-transfer")
url = "https://github.com/conan-io/conan-center-index"
homepage = "http://curl.haxx.se"
homepage = "https://curl.haxx.se"
license = "MIT"
exports_sources = ["lib_Makefile_add.am", "CMakeLists.txt"]
generators = "cmake", "pkg_config"
Expand Down Expand Up @@ -71,6 +71,7 @@ def imports(self):

def configure(self):
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd

# be careful with those flags:
# - with_openssl AND darwin_ssl uses darwin_ssl (to maintain recipe compatibilty)
Expand Down Expand Up @@ -341,8 +342,7 @@ def build_with_cmake(self):
cmake.build()

def package(self):
self.copy(pattern="COPYING*", dst="licenses", src=self._source_subfolder, ignore_case=True, keep_path=False)
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder)

# Execute install
if self.settings.compiler != "Visual Studio":
Expand All @@ -363,21 +363,25 @@ def package(self):
self.copy(pattern="*.def", dst="lib", keep_path=False)
self.copy(pattern="*.lib", dst="lib", keep_path=False)

self.copy("cacert.pem", dst="res")

# no need to distribute share folder (docs/man pages)
shutil.rmtree(os.path.join(self.package_folder, 'share'), ignore_errors=True)
# no need for pc files
# no need for pc files
shutil.rmtree(os.path.join(self.package_folder, 'lib', 'pkgconfig'), ignore_errors=True)
# no need for cmake files
# no need for cmake files
shutil.rmtree(os.path.join(self.package_folder, 'lib', 'cmake'), ignore_errors=True)
# Remove libtool files (*.la)
if os.path.isfile(os.path.join(self.package_folder, 'lib', 'libcurl.la')):
os.remove(os.path.join(self.package_folder, 'lib', 'libcurl.la'))
# library package should not contain executable
shutil.rmtree(os.path.join(self.package_folder, 'bin'), ignore_errors=True)

def package_info(self):
if self.settings.compiler != "Visual Studio":
self.cpp_info.libs = ['curl']
if self.settings.os == "Linux":
self.cpp_info.libs.extend(["rt", "pthread"])
self.cpp_info.system_libs.extend(["rt", "pthread"])
if self.options.with_libssh2:
self.cpp_info.libs.extend(["ssh2"])
if self.options.with_libidn:
Expand All @@ -388,21 +392,19 @@ def package_info(self):
self.cpp_info.libs.extend(["brotlidec"])
if self.settings.os == "Macos":
if self.options.with_ldap:
self.cpp_info.libs.extend(["ldap"])
self.cpp_info.system_libs.extend(["ldap"])
if self.options.darwin_ssl:
self.cpp_info.exelinkflags.append("-framework Cocoa")
self.cpp_info.exelinkflags.append("-framework Security")
self.cpp_info.sharedlinkflags = self.cpp_info.exelinkflags
self.cpp_info.frameworks.extend(["Cocoa", "Security"])
else:
self.cpp_info.libs = ['libcurl_imp'] if self.options.shared else ['libcurl']

if self.settings.os == "Windows":
# used on Windows for VS build, native and cross mingw build
self.cpp_info.libs.append('ws2_32')
self.cpp_info.system_libs.append('ws2_32')
if self.options.with_ldap:
self.cpp_info.libs.append("wldap32")
self.cpp_info.system_libs.append("wldap32")
if self.options.with_winssl:
self.cpp_info.libs.append("Crypt32")
self.cpp_info.system_libs.append("Crypt32")

if self.is_mingw:
# provide pthread for dependent packages
Expand Down

0 comments on commit e61b661

Please sign in to comment.