Skip to content

Commit

Permalink
Merge branch 'master' into pcre2/fix-pcre2-config
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur authored Nov 6, 2023
2 parents 95303ac + 7f54eb5 commit dc413e0
Show file tree
Hide file tree
Showing 56 changed files with 465 additions and 137 deletions.
90 changes: 49 additions & 41 deletions recipes/accellera-uvm-systemc/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,74 +1,80 @@
import os

from conan import ConanFile
from conans import AutoToolsBuildEnvironment
from conan.tools.files import get, rmdir, rm, copy, rename
from conan.tools.scm import Version
from conan.tools.build import check_min_cppstd
from conan.errors import ConanInvalidConfiguration
import os
from conan.tools.apple import is_apple_os
from conan.tools.build import check_min_cppstd
from conan.tools.files import get, rmdir, rm, copy, rename, replace_in_file
from conan.tools.gnu import Autotools, AutotoolsToolchain
from conan.tools.layout import basic_layout
from conan.tools.scm import Version

required_conan_version = ">=1.53.0"

required_conan_version = ">=1.50.0"

class UvmSystemC(ConanFile):
name = "accellera-uvm-systemc"
description = """Universal Verification Methodology for SystemC"""
homepage = "https://systemc.org/about/systemc-verification/uvm-systemc-faq"
url = "https://github.com/conan-io/conan-center-index"
description = "Universal Verification Methodology for SystemC"
license = "Apache-2.0"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://systemc.org/overview/uvm-systemc-faq"
topics = ("systemc", "verification", "tlm", "uvm")
settings = "os", "compiler", "build_type", "arch"

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"fPIC": [True, False],
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"fPIC": True,
"shared": False,
"fPIC": True,
}

@property
def _source_subfolder(self):
return "source_subfolder"
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
self.requires("systemc/2.3.3")

def build_requirements(self):
self.tool_requires("cmake/3.24.0")
self.requires("systemc/2.3.4", transitive_headers=True, transitive_libs=True)

def configure(self):
if self.options.shared:
del self.options.fPIC

def validate(self):
if self.settings.os == "Macos":
raise ConanInvalidConfiguration("Macos build not supported")
if self.settings.os == "Windows":
raise ConanInvalidConfiguration("Windows build not yet supported")
if self.settings.os == "Windows" or is_apple_os(self):
raise ConanInvalidConfiguration(f"{self.settings.os} build not supported")
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)
if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7":
raise ConanInvalidConfiguration("GCC < version 7 is not supported")

def source(self):
get(self, **self.conan_data["sources"][self.version],
strip_root=True, destination=self._source_subfolder)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = AutotoolsToolchain(self)
systemc_root = self.dependencies["systemc"].package_folder
tc.configure_args.append(f"--with-systemc={systemc_root}")
tc.generate()

def build(self):
autotools = AutoToolsBuildEnvironment(self)
args = [f"--with-systemc={self.deps_cpp_info['systemc'].rootpath}"]
if self.options.shared:
args.extend(["--enable-shared", "--disable-static"])
else:
args.extend(["--enable-static", "--disable-shared"])
autotools.configure(configure_dir=self._source_subfolder, args=args)
autotools = Autotools(self)
autotools.configure()
# Replace lib-linux64/ with lib/ for the systemc dependency
replace_in_file(self, os.path.join(self.build_folder, "src", "uvmsc", "Makefile"),
"-linux64", "")
autotools.make()

def package(self):
copy(self, "LICENSE", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses"))
copy(self, "NOTICE", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses"))
copy(self, "COPYING", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses"))
autotools = AutoToolsBuildEnvironment(self)
for license in ["LICENSE", "NOTICE", "COPYING"]:
copy(self, license,
src=self.source_folder,
dst=os.path.join(self.package_folder, "licenses"))

autotools = Autotools(self)
autotools.install()

rmdir(self, os.path.join(self.package_folder, "docs"))
rmdir(self, os.path.join(self.package_folder, "examples"))
rm(self, "AUTHORS", self.package_folder)
Expand All @@ -80,7 +86,9 @@ def package(self):
rm(self, "RELEASENOTES", self.package_folder)
rm(self, "README", self.package_folder)
rm(self, "INSTALL", self.package_folder)
rename(self, os.path.join(self.package_folder, "lib-linux64"), os.path.join(self.package_folder, "lib"))
rename(self,
os.path.join(self.package_folder, "lib-linux64"),
os.path.join(self.package_folder, "lib"))
rm(self, "libuvm-systemc.la", os.path.join(self.package_folder, "lib"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))

Expand Down
6 changes: 2 additions & 4 deletions recipes/accellera-uvm-systemc/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(accellera-uvm-systemc REQUIRED CONFIG)

add_executable(${PROJECT_NAME} example.cpp)
target_link_libraries(${PROJECT_NAME} accellera-uvm-systemc::accellera-uvm-systemc)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
26 changes: 17 additions & 9 deletions recipes/accellera-uvm-systemc/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import cmake_layout, CMake
import os

from conans import ConanFile, CMake
from conan.tools.build import cross_building

class UvmSystemcTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"

class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"

def requirements(self):
self.requires(self.tested_reference_str)

def layout(self):
cmake_layout(self)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindir, "test_package")
self.run(bin_path, env="conanrun")
9 changes: 7 additions & 2 deletions recipes/accellera-uvm-systemc/all/test_package/example.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#include "uvmsc/base/uvm_version.h"
#include "systemc"
#include <iostream>

using namespace uvm;

// Required for linking with SystemC
int sc_main(int, char*[])
{
return 0;
}

int main(int, char*[])
{
std::cout << "uvm-systemc version " << uvm_revision_string() << " loaded successfully.";

return 0;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.15)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/
${CMAKE_CURRENT_BINARY_DIR}/test_package/)
18 changes: 18 additions & 0 deletions recipes/accellera-uvm-systemc/all/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os

from conans import ConanFile, CMake
from conan.tools.build import cross_building

class UvmSystemcTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
22 changes: 18 additions & 4 deletions recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -437,7 +437,12 @@ IF(HUNTER_ENABLED)
@@ -437,10 +437,14 @@ IF(HUNTER_ENABLED)
set(ASSIMP_BUILD_MINIZIP TRUE)
ELSE(HUNTER_ENABLED)
IF ( NOT ASSIMP_BUILD_ZLIB )
Expand All @@ -10,11 +10,25 @@
+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER)
+ find_package(ZLIB REQUIRED)
+ endif()
+ set(ZLIB_FOUND TRUE)
ENDIF( NOT ASSIMP_BUILD_ZLIB )

IF( NOT ZLIB_FOUND )
@@ -470,14 +475,14 @@ ENDIF(HUNTER_ENABLED)
- IF( NOT ZLIB_FOUND )
+ IF(0)
MESSAGE(STATUS "compiling zlib from sources")
INCLUDE(CheckIncludeFile)
INCLUDE(CheckTypeSize)
@@ -461,23 +465,23 @@ ELSE(HUNTER_ENABLED)
SET(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib)
# need to ensure we don't link with system zlib or minizip as well.
SET(ASSIMP_BUILD_MINIZIP 1)
- ELSE(NOT ZLIB_FOUND)
+ ELSE()
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
SET(ZLIB_LIBRARIES_LINKED -lz)
- ENDIF(NOT ZLIB_FOUND)
+ ENDIF()
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
ENDIF(HUNTER_ENABLED)

IF( NOT IOS )
IF( NOT ASSIMP_BUILD_MINIZIP )
Expand Down
18 changes: 14 additions & 4 deletions recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -465,7 +465,12 @@ ELSE()
@@ -459,16 +459,20 @@ IF(ASSIMP_HUNTER_ENABLED)
set(ASSIMP_BUILD_MINIZIP TRUE)
ELSE()
# If the zlib is already found outside, add an export in case assimpTargets can't find it.
- IF( ZLIB_FOUND )
+ IF(0)
INSTALL( TARGETS zlib zlibstatic
EXPORT "${TARGETS_EXPORT_NAME}")
ENDIF()

IF ( NOT ASSIMP_BUILD_ZLIB )
Expand All @@ -10,11 +17,14 @@
+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER)
+ find_package(ZLIB REQUIRED)
+ endif()
+ set(ZLIB_FOUND TRUE)
ENDIF()

IF( NOT ZLIB_FOUND )
@@ -498,12 +503,14 @@ ENDIF()
- IF( NOT ZLIB_FOUND )
+ IF(0)
MESSAGE(STATUS "compiling zlib from sources")
INCLUDE(CheckIncludeFile)
INCLUDE(CheckTypeSize)
@@ -498,12 +502,14 @@ ENDIF()

IF( NOT IOS )
IF( NOT ASSIMP_BUILD_MINIZIP )
Expand Down
18 changes: 14 additions & 4 deletions recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -466,7 +466,12 @@ ELSE()
@@ -460,16 +460,20 @@ IF(ASSIMP_HUNTER_ENABLED)
set(ASSIMP_BUILD_MINIZIP TRUE)
ELSE()
# If the zlib is already found outside, add an export in case assimpTargets can't find it.
- IF( ZLIB_FOUND )
+ IF(0)
INSTALL( TARGETS zlib zlibstatic
EXPORT "${TARGETS_EXPORT_NAME}")
ENDIF()

IF ( NOT ASSIMP_BUILD_ZLIB )
Expand All @@ -10,11 +17,14 @@
+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER)
+ find_package(ZLIB REQUIRED)
+ endif()
+ set(ZLIB_FOUND TRUE)
ENDIF()

IF( NOT ZLIB_FOUND )
@@ -499,12 +504,14 @@ ENDIF()
- IF( NOT ZLIB_FOUND )
+ IF(0)
MESSAGE(STATUS "compiling zlib from sources")
INCLUDE(CheckIncludeFile)
INCLUDE(CheckTypeSize)
@@ -499,12 +503,14 @@ ENDIF()

IF( NOT IOS )
IF( NOT ASSIMP_BUILD_MINIZIP )
Expand Down
18 changes: 14 additions & 4 deletions recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -488,7 +488,12 @@ ELSE()
@@ -482,16 +482,20 @@ IF(ASSIMP_HUNTER_ENABLED)
set(ASSIMP_BUILD_MINIZIP TRUE)
ELSE()
# If the zlib is already found outside, add an export in case assimpTargets can't find it.
- IF( ZLIB_FOUND )
+ IF(0)
INSTALL( TARGETS zlib zlibstatic
EXPORT "${TARGETS_EXPORT_NAME}")
ENDIF()

IF ( NOT ASSIMP_BUILD_ZLIB )
Expand All @@ -10,11 +17,14 @@
+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER)
+ find_package(ZLIB REQUIRED)
+ endif()
+ set(ZLIB_FOUND TRUE)
ENDIF()

IF( NOT ZLIB_FOUND )
@@ -521,12 +526,14 @@ ENDIF()
- IF( NOT ZLIB_FOUND )
+ IF(0)
MESSAGE(STATUS "compiling zlib from sources")
INCLUDE(CheckIncludeFile)
INCLUDE(CheckTypeSize)
@@ -521,12 +525,14 @@ ENDIF()

IF( NOT IOS )
IF( NOT ASSIMP_BUILD_MINIZIP )
Expand Down
2 changes: 1 addition & 1 deletion recipes/aws-c-cal/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def requirements(self):
elif Version(self.version) <= "0.5.20":
self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True)
else:
self.requires("aws-c-common/0.9.0", transitive_headers=True, transitive_libs=True)
self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True)
if self._needs_openssl:
self.requires("openssl/[>=1.1 <4]")

Expand Down
3 changes: 3 additions & 0 deletions recipes/aws-c-common/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.9.6":
url: "https://github.com/awslabs/aws-c-common/archive/v0.9.6.tar.gz"
sha256: "5c30cc066a7f05fb8e4728f93aeed0e0e2698197a6df76237ac4e1200977d090"
"0.9.3":
url: "https://github.com/awslabs/aws-c-common/archive/v0.9.3.tar.gz"
sha256: "389eaac7f64d7d5a91ca3decad6810429eb5a65bbba54798b9beffcb4d1d1ed6"
Expand Down
2 changes: 2 additions & 0 deletions recipes/aws-c-common/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.9.6":
folder: all
"0.9.3":
folder: all
"0.9.0":
Expand Down
2 changes: 1 addition & 1 deletion recipes/aws-c-compression/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def requirements(self):
if Version(self.version) <= "0.2.15":
self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True)
else:
self.requires("aws-c-common/0.9.0", transitive_headers=True, transitive_libs=True)
self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True)

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down
Loading

0 comments on commit dc413e0

Please sign in to comment.