-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconanfile.py
44 lines (37 loc) · 1.82 KB
/
conanfile.py
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
from conans import ConanFile, AutoToolsBuildEnvironment, tools
import os
class ApacheaprutilConan(ConanFile):
name = "apache-apr-util"
version = "1.6.1"
license = "Apache-2.0"
url = "https://github.com/mkovalchik/conan-apache-apr-util"
settings = "os", "compiler", "build_type", "arch"
requires = "apache-apr/1.6.5@mkovalchik/stable"
options = {"shared": [True, False]}
default_options = "shared=False"
lib_name = name + "-" + version
def source(self):
file_ext = ".tar.gz" if not self.settings.os == "Windows" else "-win32-src.zip"
tools.download("https://www-us.apache.org/dist//apr/apr-util-" + self.version + file_ext, self.lib_name + file_ext)
tools.unzip(self.lib_name + file_ext)
def build(self):
env_build = AutoToolsBuildEnvironment(self)
with tools.environment_append(env_build.vars):
configure_command = "./configure"
if self.settings.os == "Windows":
configure_command += ".bat"
configure_command += " --prefix=" + os.getcwd()
configure_command += " --with-apr=" + self.deps_cpp_info["apache-apr"].rootpath
with tools.chdir("apr-util-" + self.version):
self.run(configure_command)
self.run("make -j " + str(max(tools.cpu_count() - 1, 1)))
self.run("make install")
def package(self):
self.copy("*.so*", dst="lib", src="lib", keep_path=False)
self.copy("*.a", dst="lib", src="lib", keep_path=False)
self.copy("*.h", dst="include", src="include", keep_path=True)
self.copy("apr-1-config", dst="bin", src="bin", keep_path=False)
def package_info(self):
self.cpp_info.includedirs = ["include", "include/apr-1"]
self.cpp_info.bindirs = ["bin"]
self.cpp_info.libs = ["aprutil-1"]