No longer install .mo files for manual and manpages textdomains
But still build them just to check those po files for errors. This fixes #3522
This commit is contained in:
parent
8398873aa0
commit
83da28b4aa
3 changed files with 13 additions and 6 deletions
|
@ -722,6 +722,10 @@ def CopyFilter(fn):
|
|||
|
||||
env["copy_filter"] = CopyFilter
|
||||
|
||||
def MoFileFilter(fn):
|
||||
"Don't install .mo files for manual and manpages. They're built only to catch broken po files"
|
||||
return not "wesnoth-manual.mo" in str(fn) and not "wesnoth-manpages.mo" in str(fn)
|
||||
|
||||
linguas = Split(File("po/LINGUAS").get_contents().decode("utf-8"))
|
||||
|
||||
def InstallManpages(env, component):
|
||||
|
@ -737,7 +741,7 @@ env.InstallBinary(wesnoth)
|
|||
env.InstallData("datadir", "wesnoth", [Dir(sub) for sub in installable_subs])
|
||||
env.InstallData("docdir", "wesnoth", [Glob("doc/manual/*.html"), Dir("doc/manual/styles"), Dir("doc/manual/images")])
|
||||
if env["nls"]:
|
||||
env.InstallData("localedir", "wesnoth", Dir("translations"))
|
||||
env.InstallData("localedir", "wesnoth", Dir("translations"), copy_filter = MoFileFilter)
|
||||
env.InstallData("datadir", "wesnoth", "l10n-track")
|
||||
InstallManpages(env, "wesnoth")
|
||||
if have_client_prereqs and have_X and env["desktop_entry"]:
|
||||
|
|
|
@ -259,8 +259,11 @@ if(ENABLE_NLS)
|
|||
COMMENT "mo-update [${DOMAIN}-${LINGUA}]: Creating mo file."
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/${LOCALEDIR}/${LINGUA}/LC_MESSAGES/${DOMAIN}.mo
|
||||
list(FIND NORMAL_DOMAINS ${DOMAIN} IS_NORMAL_DOMAIN)
|
||||
if(IS_NORMAL_DOMAIN GREATER -1)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/${LOCALEDIR}/${LINGUA}/LC_MESSAGES/${DOMAIN}.mo
|
||||
DESTINATION ${LOCALE_INSTALL}/${LINGUA}/LC_MESSAGES)
|
||||
endif()
|
||||
|
||||
set(mo-update-SRC ${mo-update-SRC}
|
||||
${CMAKE_SOURCE_DIR}/${LOCALEDIR}/${LINGUA}/LC_MESSAGES/${DOMAIN}.mo
|
||||
|
|
|
@ -65,7 +65,7 @@ def InstallBinary(env, source):
|
|||
env.InstallAs(os.path.join(installdir, binary + env["program_suffix"]), source)
|
||||
)
|
||||
|
||||
def InstallData(env, datadir, component, source, subdir = ""):
|
||||
def InstallData(env, datadir, component, source, subdir = "", **kwargs):
|
||||
installdir = Dir(env.subst(os.path.join(env["destdir"], env[datadir].lstrip("/"), subdir)))
|
||||
sources = map(Entry, Flatten([source]))
|
||||
dirs = []
|
||||
|
@ -74,12 +74,12 @@ def InstallData(env, datadir, component, source, subdir = ""):
|
|||
dirs.append(source)
|
||||
else:
|
||||
if source.exists():
|
||||
env.Alias("install-" + component, env.Install(installdir, source))
|
||||
env.Alias("install-" + component, env.Install(installdir, source, **kwargs))
|
||||
if dirs:
|
||||
if len(dirs) == 1:
|
||||
install = env.InstallFiltered(installdir.path, dirs[0].path)
|
||||
install = env.InstallFiltered(installdir.path, dirs[0].path, **kwargs)
|
||||
else:
|
||||
install = [env.InstallFiltered(os.path.join(installdir.path, x.name), x.path) for x in dirs]
|
||||
install = [env.InstallFiltered(os.path.join(installdir.path, x.name, **kwargs), x.path) for x in dirs]
|
||||
AlwaysBuild(install)
|
||||
env.Alias("install-" + component, install)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue