Commit e221f98a authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜
Browse files

gettext-tools.recipe: Don't use built msgmerge on Windows

It hangs randomly during configure, and makes unattended builds
annoying. This is the workaround that people have been doing manually
for years on Windows.

Eventually, we will get rid of this entirely once we move to Meson.
parent 55f588ad
......@@ -78,6 +78,8 @@ def realpath(path):
return oldrealpath(path).replace('\\', '/')
if sys.platform.startswith('win'):
# FIXME: replace all usage of os.path.join with pathlib.PurePath.as_posix()
# instead of doing this brittle monkey-patching.
os.path.join = join
os.path.expanduser = expanduser
os.path.abspath = abspath
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import shutil
from pathlib import Path
from cerbero.utils import shell
class Recipe(recipe.Recipe):
......@@ -21,3 +24,17 @@ class Recipe(recipe.Recipe):
if self.config.target_platform == Platform.WINDOWS:
self.configure_options += ' --enable-threads=win32'
self.append_env['LDFLAGS'] = '-liconv'
def post_install(self):
if self.config.platform == Platform.WINDOWS:
# The msgmerge built by us randomly hangs on Windows when called
# during configure, so replace it with the msgmerge from MSYS-MinGW
# which works fine.
build_tools_bin = Path(self.config.build_tools_prefix) / 'bin'
msys_mingw_bindir = Path(shutil.which('mingw-get')).parent
msys_msgmerge = msys_mingw_bindir / 'msgmerge.exe'
if msys_msgmerge.is_file():
if (build_tools_bin / 'msgmerge.exe').is_file():
os.replace(str(build_tools_bin / 'msgmerge.exe'),
str(build_tools_bin / 'msgmerge.exe.bck'))
shutil.copy(str(msys_msgmerge), str(build_tools_bin))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment