diff --git a/SConstruct b/SConstruct index a60fcfec1ef..c783c4f61b6 100755 --- a/SConstruct +++ b/SConstruct @@ -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"]: diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index ee249a63cc8..3187d216d15 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -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 diff --git a/scons/install.py b/scons/install.py index 28b2c4dd8e6..87043e82bc3 100644 --- a/scons/install.py +++ b/scons/install.py @@ -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)