Skip to content

Commit 451d7b2

Browse files
committed
allow overloading of recipe origin using env vars
1 parent 222bdab commit 451d7b2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

distribute.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,14 @@ function run_get_packages() {
431431

432432
for module in $MODULES; do
433433
# download dependencies for this module
434+
# check if there is not an overload from environment
435+
module_dir=$(eval "echo \$P4A_${module}_DIR")
436+
if [ "$module_dir" ]
437+
then
438+
debug "\$P4A_${module}_DIR is not empty, using $module_dir dir instead of downloading"
439+
cp -rf $module_dir $directory
440+
continue
441+
fi
434442
debug "Download package for $module"
435443

436444
url="URL_$module"

docs/source/usage.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ You can include other modules (or "recipes") to compile using `-m`::
1919

2020
For a full list, refer to :ref:`recipes`
2121

22+
.. note::
23+
24+
Recipes download a defined version of their needed package from the
25+
internet, and build from it, if you know what you are doing, and want to
26+
override that, you can export the env variable `P4A_recipe_name_DIR` and
27+
this directory will be copied and used instead.
28+
2229
Available options to `distribute.sh`::
2330

2431
-d directory Name of the distribution directory

0 commit comments

Comments
 (0)