anope: link against libintl on musl.

This commit is contained in:
Érico Rolim 2020-08-03 21:39:44 -03:00 committed by Đoàn Trần Công Danh
parent 4903a7e8fe
commit b3c580af58
2 changed files with 7 additions and 25 deletions

View File

@ -1,23 +0,0 @@
diff --git a/src/language.cpp b/src/language.cpp
index 8b7b0ee..9a97093 100644
--- src/language.cpp
+++ src/language.cpp
@@ -75,7 +75,7 @@ const char *Language::Translate(const NickCore *nc, const char *string)
#if GETTEXT_FOUND
-#ifdef __USE_GNU_GETTEXT
+#if defined(__USE_GNU_GETTEXT) && defined(_nl_msg_cat_cntr)
extern "C" int _nl_msg_cat_cntr;
#endif
@@ -87,7 +87,7 @@ const char *Language::Translate(const char *lang, const char *string)
if (!lang || !*lang)
lang = Config->DefLanguage.c_str();
-#ifdef __USE_GNU_GETTEXT
+#if defined(__USE_GNU_GETTEXT) && defined(_nl_msg_cat_cntr)
++_nl_msg_cat_cntr;
#endif

View File

@ -1,7 +1,7 @@
# Template file for 'anope'
pkgname=anope
version=2.0.7
revision=1
revision=2
wrksrc="${pkgname}-${version}-source"
build_style=cmake
configure_args="-DINSTDIR=../install -DRUNGROUP=_anope -DDEFUMASK=077
@ -20,6 +20,11 @@ make_dirs="
/var/lib/anope 755 _anope _anope
/var/log/anope 755 _anope _anope"
if [ "$XBPS_TARGET_LIBC" = musl ]; then
makedepends+=" gettext-devel"
LDFLAGS="-lintl"
fi
pre_configure() {
# prevent cmake from building include/version and running
# because it breaks cross compiling (cmake can't differentiate
@ -49,7 +54,7 @@ do_install() {
vbin bin/services anopeservices
for conffile in conf/*example.conf; do
vsconf ${conffile}
vsconf ${conffile}
done
vmkdir /usr/share/anope