diff options
author | George Joseph <gjoseph@digium.com> | 2016-09-24 18:05:02 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2016-09-25 13:40:35 -0500 |
commit | 0ab443007b4ca9207011cf16e31ceefd7ce98bcb (patch) | |
tree | 5278facd4ec93dd662830b317c793cb3b8330df8 /res | |
parent | 9b0e6f9c8616fa81ec8e11c6fe45a6f6c07c387d (diff) |
build_tools: Add ability to download variants to download_externals
Some external packages have multiple variants that apply to different
builds of asterisk. The DPMA for instance has a "bundled" variant that
needs to be downloaded if asterisk was configured with
--with-pjproject-bundled.
There are 2 ways to specify variants:
If you need the user to make the decision about which variant to
download, simply create multiple menuselect "member" entries like so...
<member name="res_digium_phone" displayname="..snipped..">
<support_level>external</support_level>
<depend>xmlstarlet</depend>
<depend>bash</depend>
<defaultenabled>no</defaultenabled>
</member>
<member name="res_digium_phone-bundled" displayname="..snipped..">
<support_level>external</support_level>
<depend>xmlstarlet</depend>
<depend>bash</depend>
<defaultenabled>no</defaultenabled>
</member>
Note that the second entry has "-<variant>" appended to the name.
You can then use the existing menuselect facilities to restrict which
members to enable or disable. Youy probably don't want the user to
enable multiple at the same time.
If you want to hide the details of the variants, the better way to
do it is to create 1 member with "variant" elements.
<member name="res_digium_phone" displayname="..snipped..">
<support_level>external</support_level>
<depend>xmlstarlet</depend>
<depend>bash</depend>
<defaultenabled>no</defaultenabled>
<member_data>
<downloader>
<variants>
<variant tag="bundled"
condition='[[ "$PJPROJECT_BUNDLED" = "yes" ]]'/>
</variants>
</downloader>
</member_data>
</member>
The condition must be a bash expression suitable for use with an "if"
statement. Any environment variable can be used plus those available
in makeopts.
In this case, if asterisk was configured with --with-pjproject-bundled
the bundled variant will be automatically downloaded. Otherwise the
normal version will be downloaded.
Change-Id: I4de23e06d4492b0a65e105c8369966547d0faa3e
Diffstat (limited to 'res')
-rw-r--r-- | res/res.xml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/res/res.xml b/res/res.xml index e9cb5f962..a340cc2fd 100644 --- a/res/res.xml +++ b/res/res.xml @@ -3,4 +3,11 @@ <depend>xmlstarlet</depend> <depend>bash</depend> <defaultenabled>no</defaultenabled> + <member_data> + <downloader> + <variants> + <variant tag="bundled" condition='[[ "$PJPROJECT_BUNDLED" = "yes" ]]'/> + </variants> + </downloader> + </member_data> </member> |