From a7a422c3c505416d889273465660ae384dc4833f Mon Sep 17 00:00:00 2001 From: Jihadist Date: Thu, 16 Feb 2023 20:16:19 +0300 Subject: [PATCH] fixes --- recipes/krb5/all/conandata.yml | 4 ++++ recipes/krb5/all/conanfile.py | 6 +++--- recipes/krb5/all/test_package/conanfile.py | 20 +++++++++++++------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/recipes/krb5/all/conandata.yml b/recipes/krb5/all/conandata.yml index 70ed724439a454..d684ac2a40a535 100644 --- a/recipes/krb5/all/conandata.yml +++ b/recipes/krb5/all/conandata.yml @@ -5,4 +5,8 @@ sources: patches: "1.18.2": - patch_file: "patches/1.18.2-0001-use-PKG_CHECK_MODULES-for-openssl.patch" + patch_type: "conan" + patch_description: "use-PKG_CHECK_MODULES-for-openssl" - patch_file: "patches/1.18.2-0003-no-html+tests.patch" + patch_type: "conan" + patch_description: "no-html+tests" diff --git a/recipes/krb5/all/conanfile.py b/recipes/krb5/all/conanfile.py index 239d872afcb38f..de4279fa5c086b 100644 --- a/recipes/krb5/all/conanfile.py +++ b/recipes/krb5/all/conanfile.py @@ -2,10 +2,10 @@ from conans import tools from conan.tools.env import VirtualBuildEnv from conan.errors import ConanInvalidConfiguration -from conan.tools.files import copy, get, rm, rmdir, chdir, replace_in_file, export_conandata_patches, apply_conandata_patches +from conan.tools.files import copy, get, rmdir, chdir, replace_in_file, export_conandata_patches, apply_conandata_patches from conan.tools.gnu import Autotools, AutotoolsToolchain,AutotoolsDeps, PkgConfigDeps from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.microsoft import is_msvc from contextlib import contextmanager import glob import os @@ -45,7 +45,7 @@ class Krb5Conan(ConanFile): exports_sources = "patches/*" def layout(self): - basic_layout(self) + basic_layout(self, src_folder="src") @property def _settings_build(self): diff --git a/recipes/krb5/all/test_package/conanfile.py b/recipes/krb5/all/test_package/conanfile.py index 261d65b1a6aff6..23c0291e76c1fd 100644 --- a/recipes/krb5/all/test_package/conanfile.py +++ b/recipes/krb5/all/test_package/conanfile.py @@ -1,13 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "pkg_config" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build_requirements(self): - self.build_requires("pkgconf/1.9.3") + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -15,7 +21,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings, skip_x64_x86=True): - 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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun")