This commit is contained in:
bthomee
2025-12-05 08:47:40 -08:00
parent a7662a71b0
commit 47d9909d45

View File

@@ -150,26 +150,37 @@ Patched recipes</h3>
<p>To ensure our patched recipes are used, you must add our Conan remote at a higher index than the default Conan Center remote, so it is consulted first. You can do this by running:</p>
<div class="fragment"><div class="line">conan remote add --index 0 xrplf https://conan.ripplex.io</div>
</div><!-- fragment --><p>Alternatively, you can pull the patched recipes into the repository and use them locally:</p>
<div class="fragment"><div class="line">cd external</div>
<div class="fragment"><div class="line"># Extract the version number from the lockfile.</div>
<div class="line">function extract_version {</div>
<div class="line"> version=$(cat conan.lock | sed -nE &quot;s@.+${1}/(.+)#.+@\1@p&quot; | head -n1)</div>
<div class="line"> echo ${version}</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"># Define which recipes to export.</div>
<div class="line">recipes=(ed25519 grpc secp256k1 snappy soci)</div>
<div class="line"> </div>
<div class="line"># Selectively check out the recipes from our CCI fork.</div>
<div class="line">cd external</div>
<div class="line">mkdir -p conan-center-index</div>
<div class="line">cd conan-center-index</div>
<div class="line">git init</div>
<div class="line">git remote add origin git@github.com:XRPLF/conan-center-index.git</div>
<div class="line">git sparse-checkout init</div>
<div class="line">git sparse-checkout set recipes/ed25519</div>
<div class="line">git sparse-checkout add recipes/grpc</div>
<div class="line">git sparse-checkout add recipes/secp256k1</div>
<div class="line">git sparse-checkout add recipes/snappy</div>
<div class="line">git sparse-checkout add recipes/soci</div>
<div class="line">for recipe in ${recipes[@]}; do</div>
<div class="line"> echo &quot;Checking out ${recipe}...&quot;</div>
<div class="line"> git sparse-checkout add recipes/${recipe}/all</div>
<div class="line">done</div>
<div class="line">git fetch origin master</div>
<div class="line">git checkout master</div>
<div class="line">rm -rf .git</div>
<div class="line">cd ../..</div>
<div class="line">conan export --version 2015.03 external/conan-center-index/recipes/ed25519/all</div>
<div class="line">conan export --version 1.72.0 external/conan-center-index/recipes/grpc/all</div>
<div class="line">conan export --version 0.7.0 external/conan-center-index/recipes/secp256k1/all</div>
<div class="line">conan export --version 1.1.10 external/conan-center-index/recipes/snappy/all</div>
<div class="line">conan export --version 4.0.3 external/conan-center-index/recipes/soci/all</div>
<div class="line"> </div>
<div class="line"># Export the recipes into the local cache.</div>
<div class="line">for recipe in ${recipes[@]}; do</div>
<div class="line"> version=$(extract_version ${recipe})</div>
<div class="line"> echo &quot;Exporting ${recipe}/${version}...&quot;</div>
<div class="line"> conan export --version $(extract_version ${recipe}) \</div>
<div class="line"> external/conan-center-index/recipes/${recipe}/all</div>
<div class="line">done</div>
</div><!-- fragment --><p>In the case we switch to a newer version of a dependency that still requires a patch, it will be necessary for you to pull in the changes and re-export the updated dependencies with the newer version. However, if we switch to a newer version that no longer requires a patch, no action is required on your part, as the new recipe will be automatically pulled from the official Conan Center.</p>
<blockquote class="doxtable">
<p>&zwj;[!NOTE] You might need to add <code>--lockfile=""</code> to your <code>conan install</code> command to avoid automatic use of the existing <code>conan.lock</code> file when you run <code>conan export</code> manually on your machine </p>