Updated conanfiles to work with release 1.0 of conan.io.

This commit is contained in:
Eyck Jentzsch 2018-02-22 20:35:06 +00:00
parent 2f922aae4f
commit 895abb8766
11 changed files with 188 additions and 78 deletions

View File

@ -13,13 +13,13 @@ to build all variations run
``` ```
cd Seasocks cd Seasocks
CONAN_USER=<username> CONAN_CHANNEL=<channel name> python build.py CONAN_USERNAME=<username> CONAN_CHANNEL=<channel name> python build.py
``` ```
to build a specific variant run the following commands: to build a specific variant run the following commands:
``` ```
conan test_package Seasocks/1.3.2@<username>/<channel name> -s build_type=<build type> -s compiler.libcxx=<libstdc++ variant> conan create . Seasocks/1.3.2@<username>/<channel name> -s build_type=<build type> -s compiler.libcxx=<libstdc++ variant>
``` ```
## SystemC ## SystemC
@ -28,13 +28,13 @@ download the SystemC distribution from http://www.accellera.org/downloads/standa
``` ```
cd SystemC cd SystemC
CONAN_USER=<usernam> CONAN_CHANNEL=<channel name> python build.py CONAN_USERNAME=<username> CONAN_CHANNEL=<channel name> python build.py
``` ```
to build a specific variant run the following command to build a specific variant run the following command
``` ```
conan test_package SystemC/2.3.2@minres/<channel name> -o SystemC:stdcxx=<c++ std variant> -s build_type=<build type> conan create . SystemC/2.3.2@minres/<channel name> -o stdcxx=<c++ std variant> -s build_type=<build type>
``` ```
where <c++ std variant> is one of 98, 11, or 14 where <c++ std variant> is one of 98, 11, or 14
@ -45,13 +45,13 @@ download the SystemC distribution from http://www.accellera.org/downloads/standa
``` ```
cd SystemCVerification cd SystemCVerification
CONAN_USER=<usernam> CONAN_CHANNEL=<channel name> python build.py CONAN_USERNAME=<username> CONAN_CHANNEL=<channel name> python build.py
``` ```
to build a specific variant run the following command to build a specific variant run the following command
``` ```
conan test_package SystemCVerification/2.0.0.a@minres/<channel name> -o SystemC:stdcxx=<c++ std variant> -s build_type=<build type> conan create . SystemCVerification/2.0.1a@minres/<channel name> -o stdcxx=<c++ std variant> -s build_type=<build type>
``` ```
where <c++ std variant> is one of 98, 11, or 14 where <c++ std variant> is one of 98, 11, or 14

View File

@ -26,8 +26,9 @@ conan_basic_setup()''')
def build(self): def build(self):
cmake = CMake(self, parallel=True) cmake = CMake(self, parallel=True)
self.run('cmake seasocks %s' % cmake.command_line) cmake.configure(source_folder="seasocks")
self.run("cmake --build . --target install %s" % cmake.build_config) cmake.build()
cmake.install()
#def package(self): #def package(self):
# nothing to do here now # nothing to do here now

View File

@ -3,13 +3,17 @@ import os
class SeasocksTestConan(ConanFile): class SeasocksTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch" settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = "shared=True"
generators = "cmake" generators = "cmake"
build_requires = "Catch/1.9.2@uilianries/stable" build_requires = "Catch/1.9.2@uilianries/stable"
def configure(self):
self.options["Seasocks"].shared = self.options.shared
def build(self): def build(self):
cmake = CMake(self) cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package" cmake.configure()
cmake.configure(source_dir=self.conanfile_directory, build_dir="./")
cmake.build() cmake.build()
def imports(self): def imports(self):

View File

@ -2,13 +2,11 @@ from conan.packager import ConanMultiPackager
if __name__ == "__main__": if __name__ == "__main__":
builder = ConanMultiPackager() builder = ConanMultiPackager()
cxxstds = ['98','11','14']
archs = ['x86', 'x86_64'] archs = ['x86', 'x86_64']
types = ['Debug','Release'] types = ['Debug','Release']
#configs = [[i,j,k] for i in cxxstds for j in archs for k in types] cxxstds = ['98', '11','14']
#for triple in configs: shared = [True,False]
# builder.add(settings={"arch": triple[1], "build_type":triple[2]}, options={"SystemC:stdcxx" : triple[0]}, env_vars={}, build_requires={}) configs = [[i,k,s] for i in cxxstds for k in types for s in shared]
configs = [[i,k] for i in cxxstds for k in types]
for triple in configs: for triple in configs:
builder.add(settings={"build_type":triple[1]}, options={"SystemC:stdcxx" : triple[0]}, env_vars={}, build_requires={}) builder.add(settings={"build_type":triple[1]}, options={"stdcxx" : triple[0], "shared" : triple[2]}, env_vars={}, build_requires={})
builder.run() builder.run()

View File

@ -1,7 +1,7 @@
from conans import ConanFile, CMake from conans import ConanFile, CMake
class SeasocksConan(ConanFile): class SystemCConan(ConanFile):
name = "SystemC" name = "SystemC"
version = "2.3.2" version = "2.3.2"
license = "Apache 2.0 License" license = "Apache 2.0 License"
@ -11,24 +11,28 @@ class SeasocksConan(ConanFile):
options = {"shared": [True, False], "stdcxx":[98,11,14]} options = {"shared": [True, False], "stdcxx":[98,11,14]}
default_options = "shared=True","stdcxx=98" default_options = "shared=True","stdcxx=98"
generators = "cmake" generators = "cmake"
source_subfolder = "systemc-2.3.2"
exports_sources = "systemc-2.3.2/*" exports_sources = "systemc-2.3.2/*"
# def build_id(self):
# self.info_build.settings.build_type = "Any"
# def source(self):
# self.run("git clone https://github.com/Minres/SystemCLanguage.git")
# self.run("cd SystemCLanguage && git checkout master")
def build(self): def build(self):
cmake = CMake(self, parallel=True) cmake = CMake(self, parallel=True)
cmake.configure(source_dir="%s/systemc-2.3.2" % self.source_folder) cmake.configure(
shared = "-DBUILD_SHARED_LIBS=ON" if self.options.shared else "-DBUILD_SHARED_LIBS=OFF" source_folder=self.source_subfolder,
self.run('cmake systemc-2.3.2 %s %s -DCMAKE_CXX_STANDARD=%s' % (cmake.command_line, shared, self.options.stdcxx)) args=[
# self.run("cmake --build . %s" % cmake.build_config) "-DBUILD_SHARED_LIBS=ON" if self.options.shared else "-DBUILD_SHARED_LIBS=OFF",
self.run("cmake --build . --target install %s" % cmake.build_config) '-DCMAKE_CXX_STANDARD=%s' % self.options.stdcxx
]
)
cmake.build()
cmake.install()
def package(self):
# Headers
#self.copy(pattern="*.h", dst="include", src="package/include", keep_path=True)
# Libs
#self.copy(pattern="*", dst="lib", src="package/lib", keep_path=False)
def package_info(self): def package_info(self):
self.cpp_info.libs = ["systemc"] self.cpp_info.libs = ["systemc", "pthread"]

View File

@ -3,16 +3,19 @@ import os
class SystemcTestConan(ConanFile): class SystemcTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch" settings = "os", "compiler", "build_type", "arch"
options = {"stdcxx":[98,11,14], "shared":[True,False]}
default_options = "stdcxx=98","shared=True"
generators = "cmake" generators = "cmake"
def configure(self):
self.options["SystemC"].stdcxx = self.options.stdcxx
self.options["SystemC"].shared = self.options.shared
def build(self): def build(self):
cxxstd = self.options["SystemC"].stdcxx
cmake = CMake(self) cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package" cmake.definitions["CMAKE_CXX_STANDARD"] = self.options["SystemC"].stdcxx
cmake.configure(source_dir=self.conanfile_directory, build_dir="./") cmake.configure()
#cmake.build() cmake.build()
self.run('cmake %s %s -DCMAKE_CXX_STANDARD=%s' % (self.conanfile_directory, cmake.command_line, cxxstd))
self.run("cmake --build . %s" % cmake.build_config)
def imports(self): def imports(self):
self.copy("*.dll", dst="bin", src="bin") self.copy("*.dll", dst="bin", src="bin")

View File

@ -2,13 +2,10 @@ from conan.packager import ConanMultiPackager
if __name__ == "__main__": if __name__ == "__main__":
builder = ConanMultiPackager() builder = ConanMultiPackager()
cxxstds = ['98','11','14']
archs = ['x86', 'x86_64'] archs = ['x86', 'x86_64']
types = ['Debug','Release'] types = ['Debug','Release']
#configs = [[i,j,k] for i in cxxstds for j in archs for k in types] cxxstds = ['98','11','14']
#for triple in configs:
# builder.add(settings={"arch": triple[1], "build_type":triple[2]}, options={"SystemCVerification:stdcxx" : triple[0]}, env_vars={}, build_requires={})
configs = [[i,k] for i in cxxstds for k in types] configs = [[i,k] for i in cxxstds for k in types]
for triple in configs: for triple in configs:
builder.add(settings={"build_type":triple[1]}, options={"SystemCVerification:stdcxx" : triple[0]}, env_vars={}, build_requires={}) builder.add(settings={"build_type":triple[1]}, options={"stdcxx" : triple[0]}, env_vars={}, build_requires={})
builder.run() builder.run()

View File

@ -1,59 +1,57 @@
from conans import ConanFile, tools, AutoToolsBuildEnvironment from conans import ConanFile, tools, AutoToolsBuildEnvironment
import os
class SystemcverificationConan(ConanFile): class SystemcverificationConan(ConanFile):
name = "SystemCVerification" name = "SystemCVerification"
version = "2.0.0a" version = "2.0.1"
folder = "scv-2.0.0a-20161019"
license = "Apache 2.0 License" license = "Apache 2.0 License"
url = "https://github.com/Minres/conan-recipes/blob/master/SystemCVerification" url = "https://github.com/Minres/conan-recipes/blob/master/SystemCVerification"
description = "The SystemC Verification (SCV) library provides a common set of APIs that are used as a basis to verification activities with SystemC" description = "The SystemC Verification (SCV) library provides a common set of APIs that are used as a basis to verification activities with SystemC"
settings = "os", "compiler", "build_type", "arch" settings = "os", "compiler", "build_type", "arch"
options = {"stdcxx":[98,11,14]} options = {"stdcxx":[98,11,14]}
default_options = "stdcxx=98" default_options = "stdcxx=98"
generators = "txt" generators = "gcc"
exports_sources = "scv-2.0.0a-20161019/*" source_subfolder = "scv-2.0.1"
exports_sources = "scv-2.0.1/*"
requires = "SystemC/2.3.2@minres/stable" requires = "SystemC/2.3.2@minres/stable"
def configure(self): def configure(self):
self.options["SystemC"].stdcxx = self.options.stdcxx self.options["SystemC"].stdcxx = self.options.stdcxx
# Maybe in windows we know that OpenSSL works better as shared (false)
#if self.settings.os == "Windows":
# self.options["OpenSSL"].shared = True
# Or adjust any other available option
# self.options["Poco"].other_option = "foo"
def build(self): def build(self):
env_build = AutoToolsBuildEnvironment(self) env_build = AutoToolsBuildEnvironment(self)
if self.options.stdcxx == "14": if self.options.stdcxx == "14":
env_build.cxx_flags = "-std=c++14" env_build.cxx_flags = "-std=gnu++14"
elif self.options.stdcxx == "11": elif self.options.stdcxx == "11":
env_build.cxx_flags = "-std=c++11" env_build.cxx_flags = "-std=gnu++11"
elif self.options.stdcxx == "98": elif self.options.stdcxx == "98":
env_build.cxx_flags = "-std=c++98" env_build.cxx_flags = "-std=gnu++98"
#env_build.libs.append("pthread") env_build.fpic = True
#env_build.defines.append("NEW_DEFINE=23") tools.mkdir("build")
with tools.chdir("build"):
self.output.info(env_build.vars) env_build.configure(
with tools.environment_append(env_build.vars): configure_dir=os.path.join(self.source_folder, self.source_subfolder),
self.run("cd %s && mkdir _build" % self.folder) args=[
configure_command = 'cd %s/_build && env && ../configure --prefix=%s/_install --with-systemc=%s --disable-debug --disable-opt' '--prefix=%s' % os.path.join(self.source_folder, 'install'),
self.output.info(configure_command % (self.folder, self.build_folder, self.deps_cpp_info["SystemC"].rootpath)) '--with-systemc=%s' % self.deps_cpp_info["SystemC"].rootpath,
self.run(configure_command % (self.folder, self.build_folder, self.deps_cpp_info["SystemC"].rootpath)) '--disable-debug',
self.run("cd %s/_build && make -j && make install" % self.folder) '--disable-opt'
]
)
env_build.make()
env_build.make(args=["install"])
#env_build.make(args=["check"])
def package(self): def package(self):
# Headers # Headers
self.copy(pattern="*.h", dst="include", src="_install/include", keep_path=True) self.copy(pattern="*.h", dst="include", src="install/include", keep_path=True)
# Libs # Libs
self.copy(pattern="*", dst="lib", src="_install/lib-linux", keep_path=False) self.copy(pattern="*", dst="lib", src="install/lib-linux", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-linux64", keep_path=False) self.copy(pattern="*", dst="lib", src="install/lib-linux64", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-macosx", keep_path=False) self.copy(pattern="*", dst="lib", src="install/lib-macosx", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-macosx64", keep_path=False) self.copy(pattern="*", dst="lib", src="install/lib-macosx64", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-cygwin", keep_path=False) self.copy(pattern="*", dst="lib", src="install/lib-cygwin", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-mingw", keep_path=False) self.copy(pattern="*", dst="lib", src="install/lib-mingw", keep_path=False)
def package_info(self): def package_info(self):
self.cpp_info.libs = ["scv"] self.cpp_info.libs = ["scv"]

View File

@ -0,0 +1,95 @@
diff -rupN scv-2.0.0a-20161019/configure scv-2.0.0a-20161019-patched/configure
--- scv-2.0.0a-20161019/configure 2016-10-19 23:25:31.000000000 +0200
+++ scv-2.0.0a-20161019-patched/configure 2017-10-28 17:00:36.367027496 +0200
@@ -16136,7 +16136,7 @@ sparc)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$SPARC_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$SPARC_GNU_CFLAGS"
@@ -16152,8 +16152,8 @@ sparc)
echo 'setting library options for g++ on Solaris'
;;
'') echo 'setting compiler flags for NOT g++'
- AM_CXXFLAGS="$SPARC_CC_CXXFLAGS"
- CXXFLAGS="$SUN_CC_OPT $SUN_CC_DBG"
+ AM_CXXFLAGS="$SPARC_CC_CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $SUN_CC_OPT $SUN_CC_DBG"
CXXFLAGS_DEBUG="$DEF_SUN_CC_DBG"
CXXFLAGS_OPT="$DEF_SUN_CC_OPT"
AM_CFLAGS="$SPARC_CC_CFLAGS"
@@ -16173,7 +16173,7 @@ hppa*)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$HPPA_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$HPPA_GNU_CFLAGS"
@@ -16192,7 +16192,7 @@ hppa*)
;;
'') echo 'setting compiler flags and defines for HP aCC'
AM_CXXFLAGS="$HPPA_ACC_CXXFLAGS"
- CXXFLAGS="$HP_ACC_OPT $HP_ACC_DBG"
+ CXXFLAGS="$CXXFLAGS $HP_ACC_OPT $HP_ACC_DBG"
CXXFLAGS_DEBUG="$DEF_HP_ACC_DBG"
CXXFLAGS_OPT="$DEF_HP_ACC_OPT"
AM_CFLAGS="$HPPA_ACC_XFLAGS"
@@ -16216,7 +16216,7 @@ powerpc*)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16235,7 +16235,7 @@ powerpc*)
;;
'') echo 'setting compiler flags for NOT g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16256,7 +16256,7 @@ i[3456]86*)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16275,7 +16275,7 @@ i[3456]86*)
;;
'') echo 'setting compiler flags for NOT g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16296,7 +16296,7 @@ x86_64*)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16315,7 +16315,7 @@ x86_64*)
;;
'') echo 'setting compiler flags for NOT g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"

View File

@ -1,18 +1,28 @@
from conans import ConanFile, CMake from conans import ConanFile, CMake
import os import os
import pprint
class SystemcverificationTestConan(ConanFile): class SystemcverificationTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch" settings = "os", "compiler", "build_type", "arch"
options = {"stdcxx":[98,11,14]}
default_options = "stdcxx=98"
generators = "cmake" generators = "cmake"
requires = "SystemC/2.3.2@minres/stable"
def configure(self):
self.options["SystemCVerification"].stdcxx = self.options.stdcxx
if self.settings.compiler == 'gcc' and self.settings.compiler.version > 5:
self.output.info("Forcing use of libstdc++11")
self.settings.compiler.libcxx='libstdc++11'
def build(self): def build(self):
cxxstd = self.options["SystemC"].stdcxx
cmake = CMake(self) cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package" # Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package"
cmake.configure(source_dir=self.conanfile_directory, build_dir="./") cmake.configure(
#cmake.build() args=[
self.run('cmake %s %s -DCMAKE_CXX_STANDARD=%s' % (self.conanfile_directory, cmake.command_line, cxxstd)) '-DCMAKE_CXX_STANDARD=%s' % self.options.stdcxx
self.run("cmake --build . %s" % cmake.build_config) ])
cmake.build()
def imports(self): def imports(self):
self.copy("*.dll", dst="bin", src="bin") self.copy("*.dll", dst="bin", src="bin")