summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cerbero/hacks.py2
-rw-r--r--recipes/build-tools/gettext-tools.recipe21
2 files changed, 10 insertions, 13 deletions
diff --git a/cerbero/hacks.py b/cerbero/hacks.py
index 52ea2d3b..fa28145d 100644
--- a/cerbero/hacks.py
+++ b/cerbero/hacks.py
@@ -121,8 +121,6 @@ def realpath(path):
if sys.platform.startswith('win'):
os.environ = _Environ(os.environ)
- # 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
diff --git a/recipes/build-tools/gettext-tools.recipe b/recipes/build-tools/gettext-tools.recipe
index 41bb03c9..73c6b6be 100644
--- a/recipes/build-tools/gettext-tools.recipe
+++ b/recipes/build-tools/gettext-tools.recipe
@@ -1,8 +1,5 @@
# -*- 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):
name = 'gettext-tools'
@@ -30,11 +27,13 @@ class Recipe(recipe.Recipe):
# 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))
+ build_tools_bin = os.path.join(self.config.build_tools_prefix, 'bin')
+ msys_mingw_bindir = os.path.dirname(shutil.which('mingw-get'))
+ msys_msgmerge = os.path.join(msys_mingw_bindir, 'msgmerge.exe')
+ if os.path.isfile(msys_msgmerge):
+ built_msgmerge = os.path.join(build_tools_bin, 'msgmerge.exe')
+ if os.path.isfile(built_msgmerge):
+ if os.path.isfile(built_msgmerge + '.bck'):
+ os.remove(built_msgmerge + '.bck')
+ os.rename(built_msgmerge, built_msgmerge + '.bck')
+ shutil.copy(msys_msgmerge, build_tools_bin)