mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Check against str for conf_info bash path
This commit is contained in:
parent
f1936dc37c
commit
fc26413347
1 changed files with 8 additions and 11 deletions
19
conanfile.py
19
conanfile.py
|
@ -276,7 +276,7 @@ class CuraConan(ConanFile):
|
||||||
self.requires(req)
|
self.requires(req)
|
||||||
|
|
||||||
def build_requirements(self):
|
def build_requirements(self):
|
||||||
if self.settings_build.os != "Windows" or self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool):
|
if self.settings_build.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type = str):
|
||||||
self.tool_requires("gettext/0.21")
|
self.tool_requires("gettext/0.21")
|
||||||
|
|
||||||
def layout(self):
|
def layout(self):
|
||||||
|
@ -289,16 +289,13 @@ class CuraConan(ConanFile):
|
||||||
self.cpp.package.resdirs = ["resources", "plugins", "packaging", "pip_requirements"] # pip_requirements should be the last item in the list
|
self.cpp.package.resdirs = ["resources", "plugins", "packaging", "pip_requirements"] # pip_requirements should be the last item in the list
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
if self.settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool):
|
if self.settings_build.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type = str):
|
||||||
return
|
for po_file in self.source_path.joinpath("resources", "i18n").glob("**/*.po"):
|
||||||
# FIXME: once m4, autoconf, automake are Conan V2 ready self.win_bash = True # We need gettext, which requires the bash environment
|
mo_file = self.build_path.joinpath(po_file.with_suffix('.mo').relative_to(self.source_path))
|
||||||
|
mkdir(self, str(unix_path(self, mo_file.parent)))
|
||||||
|
self.run(f"msgfmt {po_file} -o {mo_file} -f", env="conanbuild", run_environment=True)
|
||||||
|
|
||||||
for po_file in self.source_path.joinpath("resources", "i18n").glob("**/*.po"):
|
# FIXME: once m4, autoconf, automake are Conan V2 ready self.win_bash = None
|
||||||
mo_file = self.build_path.joinpath(po_file.with_suffix('.mo').relative_to(self.source_path))
|
|
||||||
mkdir(self, str(unix_path(self, mo_file.parent)))
|
|
||||||
self.run(f"msgfmt {po_file} -o {mo_file} -f", env="conanbuild", run_environment=True)
|
|
||||||
|
|
||||||
# FIXME: once m4, autoconf, automake are Conan V2 ready self.win_bash = None
|
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
cura_run_envvars = self._cura_run_env.vars(self, scope = "run")
|
cura_run_envvars = self._cura_run_env.vars(self, scope = "run")
|
||||||
|
@ -318,7 +315,7 @@ class CuraConan(ConanFile):
|
||||||
entitlements_file = entitlements_file if self.settings.os == "Macos" else "None")
|
entitlements_file = entitlements_file if self.settings.os == "Macos" else "None")
|
||||||
|
|
||||||
# Update the po files
|
# Update the po files
|
||||||
if self.settings_build.os != "Windows" or self.conf.get("tools.microsoft.bash:path", default = False, check_type = bool):
|
if self.settings_build.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type = str):
|
||||||
for po_file in self.source_path.joinpath("resources", "i18n").glob("**/*.po"):
|
for po_file in self.source_path.joinpath("resources", "i18n").glob("**/*.po"):
|
||||||
pot_file = self.source_path.joinpath("resources", "i18n", po_file.with_suffix('.pot').name)
|
pot_file = self.source_path.joinpath("resources", "i18n", po_file.with_suffix('.pot').name)
|
||||||
mkdir(self, str(unix_path(self, pot_file.parent)))
|
mkdir(self, str(unix_path(self, pot_file.parent)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue