-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
62 lines (53 loc) · 2.27 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from conans import ConanFile, CMake, AutoToolsBuildEnvironment, tools
import shutil
class SpeexdspConan(ConanFile):
name = "speexdsp"
version = "1.2.0"
license = "BSD"
author = "Chris Collins <[email protected]>"
url = "https://git.sysadninjas.net/conan/speexdsp"
description = "SpeexDSP Audio Processing Library"
topics = ("audio preprocessing", "audio", "sound")
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
}
generators = "cmake"
exports_sources = "cmake-build-src/*"
def source(self):
tools.get('http://downloads.us.xiph.org/releases/speex/speexdsp-%s.tar.gz'%self.version)
shutil.copy("cmake-build-src/CMakeLists.txt", "speexdsp-%s/"%self.version)
def _configure_cmake(self):
cmake = CMake(self, parallel=False)
cmake.configure(source_folder="speexdsp-%s"%self.version)
return cmake
def build(self):
if self.settings.os == 'Windows' or self.settings.os == 'Macos':
cmake = self._configure_cmake()
cmake.build()
else:
autotools = AutoToolsBuildEnvironment(self)
autotools.fpic = self.options.fPIC
config_args=['--with-fft=smallft']
if self.options.shared:
config_args+=['--enable-shared=true', '--enable-static=false']
else:
config_args+=['--enable-shared=false', '--enable-static=true']
autotools.configure(configure_dir='speexdsp-%s'%self.version, args=config_args)
autotools.make()
def package(self):
self.copy("*.h", dst="include", src="speexdsp-%s/include"%self.version)
self.copy("speexdsp_config_types.h", dst="include/speex", src="include/speex", keep_path=False)
self.copy("*.lib", dst="lib", keep_path=False)
self.copy("*.exp", dst="lib", keep_path=False)
self.copy("*.dll", dst="bin", keep_path=False)
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.dylib", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)
def package_info(self):
self.cpp_info.libs = ["speexdsp"]