-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathconanfile.py
42 lines (31 loc) · 1.52 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, tools
import os
class LibnameConan(ConanFile):
name = "libname"
version = "0.0.0"
description = "Keep it short"
# topics can get used for searches, GitHub topics, Bintray tags etc. Add here keywords about the library
topics = ("conan", "libname", "logging")
url = "https://github.com/bincrafters/conan-libname"
homepage = "https://github.com/original_author/original_lib"
author = "Bincrafters <[email protected]>"
license = "MIT" # Indicates license type of the packaged library; please use SPDX Identifiers https://spdx.org/licenses/
no_copy_source = True
# Packages the license for the conanfile.py
exports = ["LICENSE.md"]
# Custom attributes for Bincrafters recipe conventions
_source_subfolder = "source_subfolder"
def source(self):
source_url = "https://github.com/libauthor/libname"
tools.get("{0}/archive/v{1}.tar.gz".format(source_url, self.version), sha256="Please-provide-a-checksum")
extracted_dir = self.name + "-" + self.version
#Rename to "source_folder" is a convention to simplify later steps
os.rename(extracted_dir, self._source_subfolder)
def package(self):
include_folder = os.path.join(self._source_subfolder, "include")
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
self.copy(pattern="*", dst="include", src=include_folder)
def package_id(self):
self.info.header_only()