git: 157ae5bb91f7 - main - games/widelands: add NLS option

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Tue, 15 Mar 2022 11:50:40 UTC
The branch main has been updated by amdmi3:

URL: https://cgit.FreeBSD.org/ports/commit/?id=157ae5bb91f76b01a33fb770445b67534363dd34

commit 157ae5bb91f76b01a33fb770445b67534363dd34
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-03-14 19:25:40 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-03-15 11:50:05 +0000

    games/widelands: add NLS option
---
 games/widelands/Makefile                   |  3 ++-
 games/widelands/files/patch-CMakeLists.txt | 16 ++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/games/widelands/Makefile b/games/widelands/Makefile
index 2222c3eacf5f..606629812a1a 100644
--- a/games/widelands/Makefile
+++ b/games/widelands/Makefile
@@ -30,10 +30,11 @@ CMAKE_ARGS=	-DWL_INSTALL_BASEDIR="${PREFIX}" \
 PORTDATA=	*
 PORTDOCS=	*
 
-OPTIONS_DEFINE=	DOCS LTO TEST
+OPTIONS_DEFINE=	DOCS LTO NLS TEST
 OPTIONS_DEFAULT=LTO
 
 LTO_CMAKE_ON=	-DUSE_FLTO_IF_AVAILABLE:STRING="yes"
+NLS_CMAKE_BOOL=	OPTION_BUILD_TRANSLATIONS
 TEST_CMAKE_BOOL=OPTION_BUILD_TESTS
 
 post-patch:
diff --git a/games/widelands/files/patch-CMakeLists.txt b/games/widelands/files/patch-CMakeLists.txt
index 855e522366d1..b72857536aa1 100644
--- a/games/widelands/files/patch-CMakeLists.txt
+++ b/games/widelands/files/patch-CMakeLists.txt
@@ -124,3 +124,19 @@
    CONFIGURATIONS Debug
    COMPONENT DocFiles
    PATTERN "CMakeLists.txt" EXCLUDE
+@@ -482,6 +436,7 @@ install(
+ 
+ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${WL_INSTALL_DATADIR}/locale)
+ 
++if(OPTION_BUILD_TRANSLATIONS)
+ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+@@ -489,6 +444,7 @@ install(
+   CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
++endif()
+ 
+ if (UNIX AND NOT APPLE)
+   add_subdirectory(xdg)