Skip to content

Commit

Permalink
(conan-io#9299) Add a with_extras option to the ICU package
Browse files Browse the repository at this point in the history
* Add a with_extras option to the ICU package

ICU is configured with --disable-extras by default, and this commit makes
it possible to turn it on with the option "icu:with_extras=True".

* Gate environment settings on the options that need them.
  • Loading branch information
datalogics-robb authored and SSE4 committed Feb 21, 2022
1 parent d70e08a commit e597ced
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions recipes/icu/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ICUBase(ConanFile):
"with_dyload": [True, False],
"dat_package_file": "ANY",
"with_icuio": [True, False],
"with_extras": [True, False],
}
default_options = {
"shared": False,
Expand All @@ -36,6 +37,7 @@ class ICUBase(ConanFile):
"with_dyload": True,
"dat_package_file": None,
"with_icuio": True,
"with_extras": False,
}

_env_build = None
Expand Down Expand Up @@ -200,8 +202,7 @@ def _build_config_cmd(self):
"--prefix={0}".format(prefix),
"--disable-samples",
"--disable-layout",
"--disable-layoutex",
"--disable-extras"]
"--disable-layoutex"]

if not self.options.with_dyload:
args += ["--disable-dyload"]
Expand All @@ -212,6 +213,9 @@ def _build_config_cmd(self):
if not self.options.with_icuio:
args.append("--disable-icuio")

if not self.options.with_extras:
args.append("--disable-extras")

env_build = self._configure_autotools()
if tools.cross_building(self, skip_x64_x86=True):
if self.settings.os in ["iOS", "tvOS", "watchOS"]:
Expand Down Expand Up @@ -376,7 +380,7 @@ def package_info(self):
data_path = os.path.join(self.package_folder, "res", self._data_filename).replace("\\", "/")
self.output.info("Prepending to ICU_DATA runtime environment variable: {}".format(data_path))
self.runenv_info.prepend_path("ICU_DATA", data_path)
if self._enable_icu_tools:
if self._enable_icu_tools or self.options.with_extras:
self.buildenv_info.prepend_path("ICU_DATA", data_path)
# TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator
self.env_info.ICU_DATA.append(data_path)
Expand All @@ -398,6 +402,7 @@ def package_info(self):
self.cpp_info.components["icu-test"].libs = [self._lib_name("icutest")]
self.cpp_info.components["icu-test"].requires = ["icu-tu", "icu-uc"]

if self._enable_icu_tools or self.options.with_extras:
bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bin_path))
self.env_info.PATH.append(bin_path)
Expand Down

0 comments on commit e597ced

Please sign in to comment.