Skip to content

Commit

Permalink
Document changes in patches (#2207)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed Sep 6, 2021
1 parent 5cff249 commit 66ef630
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions reference/conanfile/tools/files.rst
Expand Up @@ -13,11 +13,11 @@ conan.tools.files.patch()
def patch(conanfile, base_path=None, patch_file=None, patch_string=None,
strip=0, fuzz=False, **kwargs):
Applies a diff from file (*patch_file*) or string (*patch_string*) in *base_path* directory. If
*base_path* is not passed it is applied in the current directory.
Applies a diff from file (*patch_file*) or string (*patch_string*) in the ``conanfile.source_folder`` directory.
The folder containing the sources can be customized with the ``self.folders`` attribute in the :ref:`layout(self)
method<layout_folders_reference>`.

Parameters:
- **base_path**: Base path where the patch should be applied.
- **patch_file**: Patch file that should be applied.
- **patch_string**: Patch string that should be applied.
- **strip**: Number of folders to be stripped from the path.
Expand All @@ -44,9 +44,7 @@ Example of ``conandata.yml`` without versions defined:
patches:
- patch_file: "patches/0001-buildflatbuffers-cmake.patch"
base_path: "source_subfolder"
- patch_file: "patches/0002-implicit-copy-constructor.patch"
base_path: "source_subfolder"
patch_type: backport
patch_source: https://github.com/google/flatbuffers/pull/5650
patch_description: Needed to build with modern clang compilers.
Expand All @@ -58,15 +56,12 @@ Example of ``conandata.yml`` with different patches for different versions:
patches:
"1.11.0":
- patch_file: "patches/0001-buildflatbuffers-cmake.patch"
base_path: "source_subfolder"
- patch_file: "patches/0002-implicit-copy-constructor.patch"
base_path: "source_subfolder"
patch_type: backport
patch_source: https://github.com/google/flatbuffers/pull/5650
patch_description: Needed to build with modern clang compilers.
"1.12.0":
- patch_file: "patches/0001-buildflatbuffers-cmake.patch"
base_path: "source_subfolder"
conan.tools.rename()
--------------------
Expand Down

0 comments on commit 66ef630

Please sign in to comment.