This repository was archived by the owner on Oct 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconanfile.py
More file actions
56 lines (47 loc) · 2.11 KB
/
Copy pathconanfile.py
File metadata and controls
56 lines (47 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from conans import ConanFile, AutoToolsBuildEnvironment, tools
import os
class LibmicrohttpdConan(ConanFile):
name = "libmicrohttpd"
version = "0.9.59"
description = "A small C library that is supposed to make it easy to run an HTTP server"
url = "https://github.com/bincrafters/conan-libmicrohttpd"
homepage = "https://www.gnu.org/software/libmicrohttpd/"
license = "LGPL-2.1"
settings = "os", "arch", "compiler", "build_type"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {'shared': False, 'fPIC': True}
_source_subfolder = "source_subfolder"
autotools = None
def config_options(self):
if self.settings.os == 'Windows':
del self.options.fPIC
def configure(self):
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd
def source(self):
source_url = "https://ftp.gnu.org/gnu/libmicrohttpd"
tools.get("{0}/libmicrohttpd-{1}.tar.gz".format(source_url, self.version))
extracted_dir = self.name + "-" + self.version
os.rename(extracted_dir, self._source_subfolder)
def configure_autotools(self):
if self.autotools is None:
self.autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
args = ['--disable-static' if self.options.shared else '--disable-shared']
args.append('--disable-doc')
args.append('--disable-examples')
args.append('--disable-curl')
self.autotools.configure(args=args)
return self.autotools
def build(self):
with tools.chdir(self._source_subfolder):
autotools = self.configure_autotools()
autotools.make()
def package(self):
self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder)
with tools.chdir(self._source_subfolder):
autotools = self.configure_autotools()
autotools.install()
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
if self.settings.os == "Linux":
self.cpp_info.libs.append("pthread")