Skip to content

Commit

Permalink
daggy: fix compilation error when YAML disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Apr 20, 2024
1 parent 1df20f0 commit 37d7601
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
9 changes: 9 additions & 0 deletions recipes/daggy/2.1/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ sources:
"2.1.2":
url: "https://github.com/synacker/daggy/archive/refs/tags/2.1.2.tar.gz"
sha256: "d3b244fcb06cf5b749d19ca9d678aebbaa43a7e8c8208d99c15a58e140e49493"
patches:
"2.1.3":
- patch_file: "patches/001-fix-disabled-yaml.patch"
patch_description: "Fix compilation error when YAML is disabled"
patch_type: "bugfix"

Check warning on line 12 in recipes/daggy/2.1/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

'patch_type' should have 'patch_source' as per https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patch_type it is expected to have a source (e.g. a URL) to where it originates from to help with reviewing and consumers to evaluate patches
"2.1.2":
- patch_file: "patches/001-fix-disabled-yaml.patch"
patch_description: "Fix compilation error when YAML is disabled"
patch_type: "bugfix"

Check warning on line 16 in recipes/daggy/2.1/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

'patch_type' should have 'patch_source' as per https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patch_type it is expected to have a source (e.g. a URL) to where it originates from to help with reviewing and consumers to evaluate patches
6 changes: 5 additions & 1 deletion recipes/daggy/2.1/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv, VirtualRunEnv
from conan.tools.files import copy, get
from conan.tools.files import copy, get, export_conandata_patches, apply_conandata_patches
from conan.tools.scm import Version

required_conan_version = ">=1.60.0 <2 || >=2.0.5"
Expand Down Expand Up @@ -50,6 +50,9 @@ def _compilers_minimum_version(self):
"clang": "8",
"apple-clang": "10",
}

def export_sources(self):
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
Expand Down Expand Up @@ -120,6 +123,7 @@ def generate(self):
tc.generate()

def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure(build_script_folder=os.path.join(self.source_folder, "src"))
cmake.build()
Expand Down
11 changes: 11 additions & 0 deletions recipes/daggy/2.1/patches/001-fix-disabled-yaml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/DaggyCore/Sources.cpp
+++ src/DaggyCore/Sources.cpp
@@ -371,7 +371,7 @@
}

#else
-std::optional<daggy::Sources> daggy::sources::convertors::yaml(const QString& data, QString& error)
+std::optional<daggy::Sources> daggy::sources::convertors::yaml(const QString& data, QString& error) noexcept
{
error = "yaml not supported";
return {};

0 comments on commit 37d7601

Please sign in to comment.