widelands: link against libintl on musl.

Close: #24037
This commit is contained in:
Érico Rolim 2020-08-03 21:58:14 -03:00 committed by Đoàn Trần Công Danh
parent f30695a41c
commit 64533ef2dc
3 changed files with 21 additions and 38 deletions

View file

@ -1,24 +0,0 @@
--- src/base/i18n.cc 2016-11-10 08:28:01.000000000 +0100
+++ src/base/i18n.cc 2017-12-19 07:16:43.225723387 +0100
@@ -45,7 +45,9 @@
#endif
#endif
+#if defined(__GLIBC__)
extern int _nl_msg_cat_cntr;
+#endif
namespace i18n {
@@ -302,9 +304,11 @@
locale = lang;
}
+#if defined(__GLIBC__)
/* Finally make changes known. */
++_nl_msg_cat_cntr;
#endif
+#endif
SETLOCALE(LC_ALL, ""); // call to libintl

View file

@ -1,6 +1,8 @@
--- CMakeLists.txt 2020-07-12 21:33:44.000000000 +0200 diff --git a/CMakeLists.txt b/CMakeLists.txt
+++ CMakeLists.txt 2020-07-19 08:28:28.360260489 +0200 index 018d9ea0..827bf33e 100644
@@ -312,19 +312,14 @@ --- CMakeLists.txt
+++ CMakeLists.txt
@@ -312,19 +312,15 @@ IF (WIN32)
endif (CMAKE_SIZEOF_VOID_P EQUAL 4) endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
endif (WIN32) endif (WIN32)
@ -10,15 +12,17 @@
- if (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD") - if (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD")
- find_library(EXECINFO_LIBRARY NAMES execinfo) - find_library(EXECINFO_LIBRARY NAMES execinfo)
- endif (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD") - endif (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD")
+# Find libexecinfo for musl -
+find_library(EXECINFO_LIBRARY NAMES execinfo)
- # OpenBSD needs the X11 include directory in order to find GL/glu.h - # OpenBSD needs the X11 include directory in order to find GL/glu.h
- if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") - if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
- find_package(X11 REQUIRED) - find_package(X11 REQUIRED)
- include_directories(${X11_INCLUDE_DIR}) - include_directories(${X11_INCLUDE_DIR})
- endif () - endif ()
-endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") -endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+# Find libexecinfo and libintl for musl
+find_library(EXECINFO_LIBRARY NAMES execinfo)
+find_library(INTL_LIBRARY NAMES intl)
+
+# OpenBSD needs the X11 include directory in order to find GL/glu.h +# OpenBSD needs the X11 include directory in order to find GL/glu.h
+if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") +if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+ find_package(X11 REQUIRED) + find_package(X11 REQUIRED)
@ -27,17 +31,20 @@
if (NOT DEFINED WL_VERSION) if (NOT DEFINED WL_VERSION)
include (${CMAKE_SOURCE_DIR}/cmake/BzrRevision.cmake) include (${CMAKE_SOURCE_DIR}/cmake/BzrRevision.cmake)
--- src/CMakeLists.txt 2020-07-12 21:33:44.000000000 +0200 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+++ src/CMakeLists.txt 2020-07-19 08:28:57.894258728 +0200 index 31f5a76e..1f27495f 100644
@@ -140,9 +140,9 @@ --- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -140,9 +140,9 @@ wl_library(widelands_options
logic_filesystem_constants logic_filesystem_constants
) )
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") -if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+if (EXECINFO_LIBRARY) - target_link_libraries(widelands_ball_of_mud ${EXECINFO_LIBRARY})
target_link_libraries(widelands_ball_of_mud ${EXECINFO_LIBRARY})
-endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") -endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+endif (EXECINFO_LIBRARY) +if (EXECINFO_LIBRARY OR INTL_LIBRARY)
+ target_link_libraries(widelands_ball_of_mud ${EXECINFO_LIBRARY} ${INTL_LIBRARY})
+endif (EXECINFO_LIBRARY OR INTL_LIBRARY)
if (WIN32) if (WIN32)
target_link_libraries(widelands_ball_of_mud wsock32) target_link_libraries(widelands_ball_of_mud wsock32)

View file

@ -1,7 +1,7 @@
# Template file for 'widelands' # Template file for 'widelands'
pkgname=widelands pkgname=widelands
version=21 version=21
revision=1 revision=2
wrksrc="${pkgname}-build${version}" wrksrc="${pkgname}-build${version}"
build_style=cmake build_style=cmake
configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@ -21,7 +21,7 @@ checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
CXXFLAGS="-DU_USING_ICU_NAMESPACE=1" CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
makedepends+=" libexecinfo-devel" makedepends+=" libexecinfo-devel gettext-devel"
fi fi
if [ "$CROSS_BUILD" ]; then if [ "$CROSS_BUILD" ]; then