Skip to content

Commit

Permalink
Merge pull request #3 from uilianries/testing/1.10.2
Browse files Browse the repository at this point in the history
Testing/1.10.2
  • Loading branch information
uilianries authored Sep 7, 2017
2 parents 004d13d + bc7a526 commit a099acc
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 25 deletions.
24 changes: 1 addition & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ env:
- CONAN_UPLOAD_ONLY_WHEN_STABLE: "TRUE"
- CONAN_STABLE_BRANCH_PATTERN: "release/*"
- CONAN_TOTAL_PAGES: 2
- CONAN_ARCHS: x86_64

linux: &linux
os: linux
Expand Down Expand Up @@ -50,29 +51,6 @@ matrix:
- <<: *linux
env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=lasote/conanclang40 CONAN_CURRENT_PAGE=2

- <<: *osx
osx_image: xcode7.3
env: CONAN_APPLE_CLANG_VERSIONS=7.3 CONAN_CURRENT_PAGE=1

- <<: *osx
osx_image: xcode7.3
env: CONAN_APPLE_CLANG_VERSIONS=7.3 CONAN_CURRENT_PAGE=2

- <<: *osx
osx_image: xcode8.2
env: CONAN_APPLE_CLANG_VERSIONS=8.0 CONAN_CURRENT_PAGE=1

- <<: *osx
osx_image: xcode8.2
env: CONAN_APPLE_CLANG_VERSIONS=8.0 CONAN_CURRENT_PAGE=2

- <<: *osx
osx_image: xcode8.3
env: CONAN_APPLE_CLANG_VERSIONS=8.1 CONAN_CURRENT_PAGE=1

- <<: *osx
osx_image: xcode8.3
env: CONAN_APPLE_CLANG_VERSIONS=8.1 CONAN_CURRENT_PAGE=2

install:
- chmod +x .travis/install.sh
Expand Down
11 changes: 11 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import copy
from conan.packager import ConanMultiPackager


if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(shared_option_name="resiprocate:shared")
extra_builds = copy.deepcopy(builder.builds)
for settings, options, env_vars, build_requires in extra_builds:
options["resiprocate:with_popt"] = True
options["resiprocate:with_geoip"] = True
options["resiprocate:with_repro"] = True
options["resiprocate:with_tfm"] = True
options["resiprocate:with_mysql"] = True
options["resiprocate:with_ssl"] = True
options["resiprocate:enable_ipv6"] = True
builder.builds.extend(extra_builds)
builder.run()
67 changes: 65 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class ResiprocateConan(ConanFile):
author = "Uilian Ries <uilianries@gmail.com>"
description = "C++ implementation of SIP, ICE, TURN and related protocols"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = "shared=True"
options = {"shared": [True, False], "with_popt": [True,False], "with_geoip": [True, False], "with_repro": [True, False], "with_tfm": [True, False], "with_mysql": [True, False], "with_ssl": [True, False], "enable_ipv6": [True, False]}
default_options = "shared=True", "with_popt=False", "with_geoip=False", "with_repro=False", "with_tfm=False", "with_mysql=False", "with_ssl=False", "enable_ipv6=False"
generators = "cmake"
exports = "LICENSE"
release_name = "%s-%s" % (name, version)
Expand All @@ -21,12 +21,54 @@ class ResiprocateConan(ConanFile):
def source(self):
tools.get("https://www.resiprocate.org/files/pub/reSIProcate/releases/resiprocate-%s.tar.gz" % self.version)

def requirements(self):
if self.options.with_ssl:
self.requires.add("OpenSSL/1.0.2l@conan/stable")

def configure(self):
if self.options.with_tfm:
self.options.with_repro = True
if self.options.with_repro:
self.options.with_popt = True

def system_requirements(self):
if self.settings.os == "Linux":
package_names = []
if self.options.with_popt:
package_names.append("libpopt-dev")
if self.options.with_geoip:
package_names.append("libgeoip-dev")
if self.options.with_repro:
package_names.append("libdb5.3++-dev")
package_names.append("libcajun-dev")
if self.options.with_tfm or self.options.with_ssl:
package_names.append("libboost-system-dev")
if self.options.with_tfm:
package_names.append("libcppunit-dev")
package_names.append("libnetxx-dev")
if self.options.with_mysql:
package_names.append("libmysqlclient-dev")
if self.options.with_ssl:
package_names.append("libasio-dev")
if package_names:
package_manager = tools.SystemPackageTool()
package_manager.install(packages=' '.join(package_names))

def build(self):
tools.replace_in_file(os.path.join(self.release_name, "configure.ac"), 'AC_SUBST(LIBMYSQL_LIBADD, "-lmysqlclient_r")', 'AC_SUBST(LIBMYSQL_LIBADD, "-lmysqlclient")')
tools.replace_in_file(os.path.join(self.release_name, "configure"), 'LIBMYSQL_LIBADD="-lmysqlclient_r"', 'LIBMYSQL_LIBADD="-lmysqlclient"')
env_build = AutoToolsBuildEnvironment(self)
env_build.fpic = True
env_build.cxx_flags.append("-w")
with tools.environment_append(env_build.vars):
configure_args = ['--prefix=%s' % self.install_dir]
configure_args.append("--with-popt" if self.options.with_popt else "")
configure_args.append("--with-geoip" if self.options.with_geoip else "")
configure_args.append("--with-repro" if self.options.with_repro else "")
configure_args.append("--with-tfm" if self.options.with_tfm else "")
configure_args.append("--with-mysql" if self.options.with_mysql else "")
configure_args.append("--with-ssl" if self.options.with_ssl else "")
configure_args.append("--enable-ipv6" if self.options.enable_ipv6 else "")
configure_args.append("--enable-silent-rules")
with tools.chdir(self.release_name):
env_build.configure(args=configure_args)
Expand All @@ -38,13 +80,34 @@ def build(self):
def package(self):
self.copy("LICENSE", src=self.release_name, dst=".", keep_path=False)
self.copy(pattern="*", dst="include", src=os.path.join(self.install_dir, "include"))
self.copy(pattern="*", dst="bin", src=os.path.join(self.install_dir, "sbin"), keep_path=False)
if self.options.shared:
self.copy(pattern="*.so*", dst="lib", src=os.path.join(self.install_dir, "lib"), keep_path=False)
self.copy(pattern="*.dylib", dst="lib", src=os.path.join(self.install_dir, "lib"), keep_path=False)
else:
self.copy(pattern="*.a", dst="lib", src=os.path.join(self.install_dir, "lib"), keep_path=False)
self.copy(pattern="*.la", dst="lib", src=os.path.join(self.install_dir, "lib"), keep_path=False)

def package_info(self):
self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
self.cpp_info.libs = ["resip", "rutil", "dum", "resipares"]
if self.settings.os == "Linux":
self.cpp_info.libs.append("pthread")
if self.options.with_popt:
self.cpp_info.libs.append("popt")
if self.options.with_geoip:
self.cpp_info.libs.append("GeoIP")
if self.options.with_mysql:
self.cpp_info.libs.append("mysqlclient")
if self.options.with_repro:
self.cpp_info.libs.append("db")
self.cpp_info.libs.append("repro")
if self.options.with_ssl or self.options.with_tfm:
self.cpp_info.libs.append("boost_system")
if self.options.with_tfm:
self.cpp_info.libs.append("tfm")
self.cpp_info.libs.append("tfmrepro")
self.cpp_info.libs.append("cppunit")
self.cpp_info.libs.append("Netxx")
if self.options.with_ssl:
self.cpp_info.libs.append("reTurnClient")

0 comments on commit a099acc

Please sign in to comment.