-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathconanfile.py
More file actions
70 lines (58 loc) · 2.41 KB
/
conanfile.py
File metadata and controls
70 lines (58 loc) · 2.41 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /usr/bin/env python3
# type: ignore
# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.files import get
from conan.tools.gnu import PkgConfig
from conan.tools.system.package_manager import Apt, Zypper, Yum
class ZZipLibRecipe(ConanFile):
# generators = "CMakeToolchain", "CMakeDeps"
settings = "os", "compiler", "build_type", "arch"
name = "zziplib"
version = "0.13.81"
URL = "https://github.com/gdraheim/zziplib/"
license = "NA"
def system_requirements(self) -> None:
apt = Apt(self)
apt.install(["zlib1g-dev"])
yum = Yum(self)
yum.install(["zlib-devel"])
zypper = Zypper(self)
zypper.install(["zlib-devel"])
def package_info(self) -> None:
zlib_config = PkgConfig(self, 'zlib')
zlib_config.fill_cpp_info(self.cpp_info, is_system=True)
self.output.error("LIBS:", self.cpp_info.libs)
self.output.error("LIBS:", self.cpp_info.system_libs)
def source(self) -> None:
# Please, be aware that using the head of the branch instead of an immutable tag
# or commit is a bad practice and not allowed by Conan
get(self, F"https://github.com/gdraheim/zziplib/archive/refs/tags/v{self.version}.zip",
strip_root=True)
def requirements(self) -> None:
# self.requires("zlib/[>=1.2]")
if self.settings.os == "Windows": # pylint: disable=no-member
self.requires("base64/0.4.0")
self.output.error("REQUIRES:")
def build_requirements(self) -> None:
self.tool_requires("cmake/[>=3.10]") # pylint: disable=not-callable
def layout(self) -> None:
cmake_layout(self)
def generate(self) -> None:
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
# tc.variables["MYVAR"] = "MYVAR_VALUE"
tc.preprocessor_definitions["ZZIP_MANPAGES"] = "OFF"
tc.preprocessor_definitions["ZZIP_INSTALL_BINS"] = "OFF"
tc.preprocessor_definitions["ZZIP_TESTCVE"] = "OFF"
tc.preprocessor_definitions["VERBOSE"] = "ON"
tc.generate()
def build(self) -> None:
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self) -> None:
cmake = CMake(self)
cmake.install()