Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Use libintl on musl when necessary
@ 2020-08-04  1:16 ericonr
  2020-08-04  1:18 ` [PR PATCH] [Updated] " ericonr
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ericonr @ 2020-08-04  1:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

There is a new pull request by ericonr against master on the void-packages repository

https://github.com/ericonr/void-packages libintl
https://github.com/void-linux/void-packages/pull/24037

Use libintl on musl when necessary
Based on #24030 

@sgn 

A patch file from https://github.com/void-linux/void-packages/pull/24037.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libintl-24037.patch --]
[-- Type: text/x-diff, Size: 12292 bytes --]

From 2b1b1d6dc2fd8b4bc1c714c8eff4f9c87007636a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 3 Aug 2020 21:27:52 -0300
Subject: [PATCH 1/4] snapper: link against libintl on musl.

---
 .../patches/0003-musl-_nl_msg_cat_cntr.patch  | 60 -------------------
 srcpkgs/snapper/template                      |  5 +-
 2 files changed, 4 insertions(+), 61 deletions(-)
 delete mode 100644 srcpkgs/snapper/patches/0003-musl-_nl_msg_cat_cntr.patch

diff --git a/srcpkgs/snapper/patches/0003-musl-_nl_msg_cat_cntr.patch b/srcpkgs/snapper/patches/0003-musl-_nl_msg_cat_cntr.patch
deleted file mode 100644
index 303e79d709c..00000000000
--- a/srcpkgs/snapper/patches/0003-musl-_nl_msg_cat_cntr.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 554bf69b4cfb5e91a20f0df0ac0fef918648fb48 Mon Sep 17 00:00:00 2001
-From: Nathan Owens <ndowens04@gmail.com>
-Date: Wed, 18 Dec 2019 18:26:02 -0600
-Subject: [PATCH 3/4] musl-_nl_msg_cat_cntr
-
-Signed-off-by: Nathan Owens <ndowens04@gmail.com>
----
- snapper/Regex.cc | 17 ++++++++++++-----
- 1 file changed, 12 insertions(+), 5 deletions(-)
-
-diff --git a/snapper/Regex.cc b/snapper/Regex.cc
-index da8f862..6b2cd2d 100644
---- snapper/Regex.cc
-+++ snapper/Regex.cc
-@@ -21,9 +21,9 @@
- 
- #include <stdexcept>
- #include "snapper/Regex.h"
--
-+#ifdef __GLIBC__
- extern int _nl_msg_cat_cntr;
--
-+#endif
- 
- namespace snapper
- {
-@@ -40,8 +40,10 @@ Regex::Regex (const string& pattern, int cflags, unsigned int nm)
- 	regerror(errcode, &rx, error, esize);
- 	throw std::runtime_error(string("Regex compilation error: ") + error);
-     }
-+#ifdef __GLIBC__
-     my_nl_msg_cat_cntr = _nl_msg_cat_cntr;
--    rm = new regmatch_t[nm];
-+#endif
-+	rm = new regmatch_t[nm];
- }
- 
- 
-@@ -55,11 +57,16 @@ Regex::~Regex ()
- bool
- Regex::match (const string& str, int eflags) const
- {
--    if (my_nl_msg_cat_cntr != _nl_msg_cat_cntr) {
-+#ifdef __GLIBC__
-+    if (my_nl_msg_cat_cntr != _nl_msg_cat_cntr)
-+#endif
-+    {
- 	regfree (&rx);
- 	regcomp (&rx, pattern.c_str (), cflags);
-+#ifdef __GLIBC__
- 	my_nl_msg_cat_cntr = _nl_msg_cat_cntr;
--    }
-+#endif
-+	}
- 
-     last_str = str;
- 
--- 
-2.24.1
-
diff --git a/srcpkgs/snapper/template b/srcpkgs/snapper/template
index 5afe48cf797..ab67d48cb89 100644
--- a/srcpkgs/snapper/template
+++ b/srcpkgs/snapper/template
@@ -1,7 +1,7 @@
 # Template file for 'snapper'
 pkgname=snapper
 version=0.8.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-zypp --with-conf=/etc/conf.d"
 conf_files="/etc/conf.d/snapper"
@@ -22,6 +22,9 @@ case "$XBPS_TARGET_MACHINE" in
 	*-musl)	# We define MUSL_LIBC to pick the correct return type
 		# for strerror_r(2) which is int (XSI-compliant)
 		CXXFLAGS="-DMUSL_LIBC=1"
+		# We also link against libintl
+		makedepends+=" gettext-devel"
+		LDFLAGS="-lintl"
 esac
 
 pre_configure() {

From 9d0fb97a0ce915bacf02de202acbc203090f6c7b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 3 Aug 2020 21:39:44 -0300
Subject: [PATCH 2/4] anope: link against libintl on musl.

---
 srcpkgs/anope/patches/fix-musl-cross.patch | 23 ----------------------
 srcpkgs/anope/template                     |  7 ++++++-
 2 files changed, 6 insertions(+), 24 deletions(-)
 delete mode 100644 srcpkgs/anope/patches/fix-musl-cross.patch

diff --git a/srcpkgs/anope/patches/fix-musl-cross.patch b/srcpkgs/anope/patches/fix-musl-cross.patch
deleted file mode 100644
index 6e6050aed50..00000000000
--- a/srcpkgs/anope/patches/fix-musl-cross.patch
+++ /dev/null
@@ -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
- 
-
diff --git a/srcpkgs/anope/template b/srcpkgs/anope/template
index 227d8226c68..ed3ec51d33d 100644
--- a/srcpkgs/anope/template
+++ b/srcpkgs/anope/template
@@ -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

From 6d00759e714d02ab12c9fa5ce900c0075ad958cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 3 Aug 2020 21:56:09 -0300
Subject: [PATCH 3/4] workrave: link against libintl on musl.

Use LDFLAGS instead of configure.ac patch.
Use python3-cheetah3 instead of python-cheetah.
---
 srcpkgs/workrave/patches/configure_ac.patch   | 11 ---------
 .../patches/musl-nl_msg_cat_cntr.patch        | 23 -------------------
 srcpkgs/workrave/template                     |  7 +++++-
 3 files changed, 6 insertions(+), 35 deletions(-)
 delete mode 100644 srcpkgs/workrave/patches/configure_ac.patch
 delete mode 100644 srcpkgs/workrave/patches/musl-nl_msg_cat_cntr.patch

diff --git a/srcpkgs/workrave/patches/configure_ac.patch b/srcpkgs/workrave/patches/configure_ac.patch
deleted file mode 100644
index 641b1b07615..00000000000
--- a/srcpkgs/workrave/patches/configure_ac.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./configure.ac.orig	2015-11-02 15:12:56.227947986 -0500
-+++ ./configure.ac	2015-11-02 15:13:00.392948034 -0500
-@@ -323,6 +323,8 @@
- 
- AM_CONDITIONAL(HAVE_DSOUND, test "x$have_dsound" = "xyes")
- 
-+AC_CHECK_LIB(intl, gettext)
-+
- dnl
- dnl OSX specific checks
- dnl
diff --git a/srcpkgs/workrave/patches/musl-nl_msg_cat_cntr.patch b/srcpkgs/workrave/patches/musl-nl_msg_cat_cntr.patch
deleted file mode 100644
index 9f7cf197098..00000000000
--- a/srcpkgs/workrave/patches/musl-nl_msg_cat_cntr.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Avoid glibc-specific libintl symbol on musl.
-
---- common/src/Locale.cc
-+++ common/src/Locale.cc
-@@ -34,7 +34,9 @@
- 
- #include "locale.inc"
- 
-+#if defined(__GLIBC__)
- extern "C" int _nl_msg_cat_cntr;
-+#endif
- 
- Locale::LanguageMap Locale::languages_native_locale;
- 
-@@ -102,7 +104,7 @@ Locale::set_locale(const std::string &code)
-       g_unsetenv("LANG");
-     }
- 
--#ifndef PLATFORM_OS_WIN32_NATIVE
-+#if defined(__GLIBC__)
-     ++_nl_msg_cat_cntr;
- #endif
- }
diff --git a/srcpkgs/workrave/template b/srcpkgs/workrave/template
index a07d5358be9..27cbdaedcf1 100644
--- a/srcpkgs/workrave/template
+++ b/srcpkgs/workrave/template
@@ -9,7 +9,7 @@ build_helper="gir"
 configure_args="--disable-static --disable-gnome --disable-gsettings
  $(vopt_enable pulseaudio pulse)"
 hostmakedepends="automake autoconf-archive gettext-devel intltool python3-Jinja2
-pkg-config python-cheetah libtool"
+pkg-config python3-cheetah3 libtool"
 makedepends="boost-devel gtkmm-devel libSM-devel libXtst-devel libXScrnSaver-devel
  $(vopt_if pulseaudio pulseaudio-devel)"
 short_desc="Program that assists in the recovery and prevention of RSI"
@@ -21,6 +21,11 @@ checksum=31a090b48c67c5a2ccb73fb56633f182fcc6d7aca5ec6376146671c72fda1444
 
 build_options="pulseaudio"
 
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	makedepends+=" gettext-devel"
+	LDFLAGS="-lintl"
+fi
+
 pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }

From 629ae9f961e253851bcd93ca699e532af1760b88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 3 Aug 2020 21:58:14 -0300
Subject: [PATCH 4/4] widelands: link against libintl on musl.

---
 .../patches/fix_nl_msg_cat_cntr.patch         | 24 --------------
 .../{musl-execinfo.patch => musl.patch}       | 31 ++++++++++++-------
 srcpkgs/widelands/template                    |  2 +-
 3 files changed, 20 insertions(+), 37 deletions(-)
 delete mode 100644 srcpkgs/widelands/patches/fix_nl_msg_cat_cntr.patch
 rename srcpkgs/widelands/patches/{musl-execinfo.patch => musl.patch} (66%)

diff --git a/srcpkgs/widelands/patches/fix_nl_msg_cat_cntr.patch b/srcpkgs/widelands/patches/fix_nl_msg_cat_cntr.patch
deleted file mode 100644
index 06097d2c51e..00000000000
--- a/srcpkgs/widelands/patches/fix_nl_msg_cat_cntr.patch
+++ /dev/null
@@ -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
- 
diff --git a/srcpkgs/widelands/patches/musl-execinfo.patch b/srcpkgs/widelands/patches/musl.patch
similarity index 66%
rename from srcpkgs/widelands/patches/musl-execinfo.patch
rename to srcpkgs/widelands/patches/musl.patch
index 15467dcae0e..507297e01be 100644
--- a/srcpkgs/widelands/patches/musl-execinfo.patch
+++ b/srcpkgs/widelands/patches/musl.patch
@@ -1,6 +1,8 @@
---- CMakeLists.txt	2020-07-12 21:33:44.000000000 +0200
-+++ CMakeLists.txt	2020-07-19 08:28:28.360260489 +0200
-@@ -312,19 +312,14 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 018d9ea0..827bf33e 100644
+--- CMakeLists.txt
++++ CMakeLists.txt
+@@ -312,19 +312,15 @@ IF (WIN32)
    endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
  endif (WIN32)
  
@@ -10,15 +12,17 @@
 -  if (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD")
 -    find_library(EXECINFO_LIBRARY NAMES execinfo)
 -  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
 -  if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
 -    find_package(X11 REQUIRED)
 -    include_directories(${X11_INCLUDE_DIR})
 -  endif ()
 -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
 +if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
 +  find_package(X11 REQUIRED)
@@ -27,17 +31,20 @@
  
  if (NOT DEFINED WL_VERSION)
    include (${CMAKE_SOURCE_DIR}/cmake/BzrRevision.cmake)
---- src/CMakeLists.txt	2020-07-12 21:33:44.000000000 +0200
-+++ src/CMakeLists.txt	2020-07-19 08:28:57.894258728 +0200
-@@ -140,9 +140,9 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 31f5a76e..1f27495f 100644
+--- src/CMakeLists.txt
++++ src/CMakeLists.txt
+@@ -140,9 +140,9 @@ wl_library(widelands_options
      logic_filesystem_constants
  )
  
 -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 (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)
    target_link_libraries(widelands_ball_of_mud wsock32)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index f8b35faaedc..a2ac72d70dd 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -21,7 +21,7 @@ checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" libexecinfo-devel"
+	makedepends+=" libexecinfo-devel gettext-devel"
 fi
 
 if [ "$CROSS_BUILD" ]; then

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Updated] Use libintl on musl when necessary
  2020-08-04  1:16 [PR PATCH] Use libintl on musl when necessary ericonr
@ 2020-08-04  1:18 ` ericonr
  2020-08-04  1:31 ` [PR REVIEW] " sgn
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-08-04  1:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

There is an updated pull request by ericonr against master on the void-packages repository

https://github.com/ericonr/void-packages libintl
https://github.com/void-linux/void-packages/pull/24037

Use libintl on musl when necessary
Based on #24030 

@sgn 

A patch file from https://github.com/void-linux/void-packages/pull/24037.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libintl-24037.patch --]
[-- Type: text/x-diff, Size: 12957 bytes --]

From 2b1b1d6dc2fd8b4bc1c714c8eff4f9c87007636a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 3 Aug 2020 21:27:52 -0300
Subject: [PATCH 1/4] snapper: link against libintl on musl.

---
 .../patches/0003-musl-_nl_msg_cat_cntr.patch  | 60 -------------------
 srcpkgs/snapper/template                      |  5 +-
 2 files changed, 4 insertions(+), 61 deletions(-)
 delete mode 100644 srcpkgs/snapper/patches/0003-musl-_nl_msg_cat_cntr.patch

diff --git a/srcpkgs/snapper/patches/0003-musl-_nl_msg_cat_cntr.patch b/srcpkgs/snapper/patches/0003-musl-_nl_msg_cat_cntr.patch
deleted file mode 100644
index 303e79d709c..00000000000
--- a/srcpkgs/snapper/patches/0003-musl-_nl_msg_cat_cntr.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 554bf69b4cfb5e91a20f0df0ac0fef918648fb48 Mon Sep 17 00:00:00 2001
-From: Nathan Owens <ndowens04@gmail.com>
-Date: Wed, 18 Dec 2019 18:26:02 -0600
-Subject: [PATCH 3/4] musl-_nl_msg_cat_cntr
-
-Signed-off-by: Nathan Owens <ndowens04@gmail.com>
----
- snapper/Regex.cc | 17 ++++++++++++-----
- 1 file changed, 12 insertions(+), 5 deletions(-)
-
-diff --git a/snapper/Regex.cc b/snapper/Regex.cc
-index da8f862..6b2cd2d 100644
---- snapper/Regex.cc
-+++ snapper/Regex.cc
-@@ -21,9 +21,9 @@
- 
- #include <stdexcept>
- #include "snapper/Regex.h"
--
-+#ifdef __GLIBC__
- extern int _nl_msg_cat_cntr;
--
-+#endif
- 
- namespace snapper
- {
-@@ -40,8 +40,10 @@ Regex::Regex (const string& pattern, int cflags, unsigned int nm)
- 	regerror(errcode, &rx, error, esize);
- 	throw std::runtime_error(string("Regex compilation error: ") + error);
-     }
-+#ifdef __GLIBC__
-     my_nl_msg_cat_cntr = _nl_msg_cat_cntr;
--    rm = new regmatch_t[nm];
-+#endif
-+	rm = new regmatch_t[nm];
- }
- 
- 
-@@ -55,11 +57,16 @@ Regex::~Regex ()
- bool
- Regex::match (const string& str, int eflags) const
- {
--    if (my_nl_msg_cat_cntr != _nl_msg_cat_cntr) {
-+#ifdef __GLIBC__
-+    if (my_nl_msg_cat_cntr != _nl_msg_cat_cntr)
-+#endif
-+    {
- 	regfree (&rx);
- 	regcomp (&rx, pattern.c_str (), cflags);
-+#ifdef __GLIBC__
- 	my_nl_msg_cat_cntr = _nl_msg_cat_cntr;
--    }
-+#endif
-+	}
- 
-     last_str = str;
- 
--- 
-2.24.1
-
diff --git a/srcpkgs/snapper/template b/srcpkgs/snapper/template
index 5afe48cf797..ab67d48cb89 100644
--- a/srcpkgs/snapper/template
+++ b/srcpkgs/snapper/template
@@ -1,7 +1,7 @@
 # Template file for 'snapper'
 pkgname=snapper
 version=0.8.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-zypp --with-conf=/etc/conf.d"
 conf_files="/etc/conf.d/snapper"
@@ -22,6 +22,9 @@ case "$XBPS_TARGET_MACHINE" in
 	*-musl)	# We define MUSL_LIBC to pick the correct return type
 		# for strerror_r(2) which is int (XSI-compliant)
 		CXXFLAGS="-DMUSL_LIBC=1"
+		# We also link against libintl
+		makedepends+=" gettext-devel"
+		LDFLAGS="-lintl"
 esac
 
 pre_configure() {

From 9aa72f6ce9c350f477c91cd6b98f993c9692d70d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 3 Aug 2020 21:39:44 -0300
Subject: [PATCH 2/4] anope: link against libintl on musl.

---
 srcpkgs/anope/patches/fix-musl-cross.patch | 23 ----------------------
 srcpkgs/anope/template                     |  9 +++++++--
 2 files changed, 7 insertions(+), 25 deletions(-)
 delete mode 100644 srcpkgs/anope/patches/fix-musl-cross.patch

diff --git a/srcpkgs/anope/patches/fix-musl-cross.patch b/srcpkgs/anope/patches/fix-musl-cross.patch
deleted file mode 100644
index 6e6050aed50..00000000000
--- a/srcpkgs/anope/patches/fix-musl-cross.patch
+++ /dev/null
@@ -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
- 
-
diff --git a/srcpkgs/anope/template b/srcpkgs/anope/template
index 227d8226c68..42b05622161 100644
--- a/srcpkgs/anope/template
+++ b/srcpkgs/anope/template
@@ -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

From 1ae82ecb8031158c54a4636dca2ebc90ac7ab6c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 3 Aug 2020 21:56:09 -0300
Subject: [PATCH 3/4] workrave: link against libintl on musl.

Use LDFLAGS instead of configure.ac patch.
Use python3-cheetah3 instead of python-cheetah.
---
 srcpkgs/workrave/patches/configure_ac.patch   | 11 ---------
 .../patches/musl-nl_msg_cat_cntr.patch        | 23 -------------------
 srcpkgs/workrave/template                     |  9 ++++++--
 3 files changed, 7 insertions(+), 36 deletions(-)
 delete mode 100644 srcpkgs/workrave/patches/configure_ac.patch
 delete mode 100644 srcpkgs/workrave/patches/musl-nl_msg_cat_cntr.patch

diff --git a/srcpkgs/workrave/patches/configure_ac.patch b/srcpkgs/workrave/patches/configure_ac.patch
deleted file mode 100644
index 641b1b07615..00000000000
--- a/srcpkgs/workrave/patches/configure_ac.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./configure.ac.orig	2015-11-02 15:12:56.227947986 -0500
-+++ ./configure.ac	2015-11-02 15:13:00.392948034 -0500
-@@ -323,6 +323,8 @@
- 
- AM_CONDITIONAL(HAVE_DSOUND, test "x$have_dsound" = "xyes")
- 
-+AC_CHECK_LIB(intl, gettext)
-+
- dnl
- dnl OSX specific checks
- dnl
diff --git a/srcpkgs/workrave/patches/musl-nl_msg_cat_cntr.patch b/srcpkgs/workrave/patches/musl-nl_msg_cat_cntr.patch
deleted file mode 100644
index 9f7cf197098..00000000000
--- a/srcpkgs/workrave/patches/musl-nl_msg_cat_cntr.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Avoid glibc-specific libintl symbol on musl.
-
---- common/src/Locale.cc
-+++ common/src/Locale.cc
-@@ -34,7 +34,9 @@
- 
- #include "locale.inc"
- 
-+#if defined(__GLIBC__)
- extern "C" int _nl_msg_cat_cntr;
-+#endif
- 
- Locale::LanguageMap Locale::languages_native_locale;
- 
-@@ -102,7 +104,7 @@ Locale::set_locale(const std::string &code)
-       g_unsetenv("LANG");
-     }
- 
--#ifndef PLATFORM_OS_WIN32_NATIVE
-+#if defined(__GLIBC__)
-     ++_nl_msg_cat_cntr;
- #endif
- }
diff --git a/srcpkgs/workrave/template b/srcpkgs/workrave/template
index a07d5358be9..733e6d13f79 100644
--- a/srcpkgs/workrave/template
+++ b/srcpkgs/workrave/template
@@ -1,7 +1,7 @@
 # Template file for 'workrave'
 pkgname=workrave
 version=1.10.34
-revision=1
+revision=2
 _realversion="${version//./_}"
 wrksrc="${pkgname}-${_realversion}"
 build_style=gnu-configure
@@ -9,7 +9,7 @@ build_helper="gir"
 configure_args="--disable-static --disable-gnome --disable-gsettings
  $(vopt_enable pulseaudio pulse)"
 hostmakedepends="automake autoconf-archive gettext-devel intltool python3-Jinja2
-pkg-config python-cheetah libtool"
+pkg-config python3-cheetah3 libtool"
 makedepends="boost-devel gtkmm-devel libSM-devel libXtst-devel libXScrnSaver-devel
  $(vopt_if pulseaudio pulseaudio-devel)"
 short_desc="Program that assists in the recovery and prevention of RSI"
@@ -21,6 +21,11 @@ checksum=31a090b48c67c5a2ccb73fb56633f182fcc6d7aca5ec6376146671c72fda1444
 
 build_options="pulseaudio"
 
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	makedepends+=" gettext-devel"
+	LDFLAGS="-lintl"
+fi
+
 pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }

From 401d628af34def15fe83b9420e3c32b7131c9182 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 3 Aug 2020 21:58:14 -0300
Subject: [PATCH 4/4] widelands: link against libintl on musl.

---
 .../patches/fix_nl_msg_cat_cntr.patch         | 24 --------------
 .../{musl-execinfo.patch => musl.patch}       | 31 ++++++++++++-------
 srcpkgs/widelands/template                    |  4 +--
 3 files changed, 21 insertions(+), 38 deletions(-)
 delete mode 100644 srcpkgs/widelands/patches/fix_nl_msg_cat_cntr.patch
 rename srcpkgs/widelands/patches/{musl-execinfo.patch => musl.patch} (66%)

diff --git a/srcpkgs/widelands/patches/fix_nl_msg_cat_cntr.patch b/srcpkgs/widelands/patches/fix_nl_msg_cat_cntr.patch
deleted file mode 100644
index 06097d2c51e..00000000000
--- a/srcpkgs/widelands/patches/fix_nl_msg_cat_cntr.patch
+++ /dev/null
@@ -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
- 
diff --git a/srcpkgs/widelands/patches/musl-execinfo.patch b/srcpkgs/widelands/patches/musl.patch
similarity index 66%
rename from srcpkgs/widelands/patches/musl-execinfo.patch
rename to srcpkgs/widelands/patches/musl.patch
index 15467dcae0e..507297e01be 100644
--- a/srcpkgs/widelands/patches/musl-execinfo.patch
+++ b/srcpkgs/widelands/patches/musl.patch
@@ -1,6 +1,8 @@
---- CMakeLists.txt	2020-07-12 21:33:44.000000000 +0200
-+++ CMakeLists.txt	2020-07-19 08:28:28.360260489 +0200
-@@ -312,19 +312,14 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 018d9ea0..827bf33e 100644
+--- CMakeLists.txt
++++ CMakeLists.txt
+@@ -312,19 +312,15 @@ IF (WIN32)
    endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
  endif (WIN32)
  
@@ -10,15 +12,17 @@
 -  if (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD")
 -    find_library(EXECINFO_LIBRARY NAMES execinfo)
 -  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
 -  if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
 -    find_package(X11 REQUIRED)
 -    include_directories(${X11_INCLUDE_DIR})
 -  endif ()
 -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
 +if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
 +  find_package(X11 REQUIRED)
@@ -27,17 +31,20 @@
  
  if (NOT DEFINED WL_VERSION)
    include (${CMAKE_SOURCE_DIR}/cmake/BzrRevision.cmake)
---- src/CMakeLists.txt	2020-07-12 21:33:44.000000000 +0200
-+++ src/CMakeLists.txt	2020-07-19 08:28:57.894258728 +0200
-@@ -140,9 +140,9 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 31f5a76e..1f27495f 100644
+--- src/CMakeLists.txt
++++ src/CMakeLists.txt
+@@ -140,9 +140,9 @@ wl_library(widelands_options
      logic_filesystem_constants
  )
  
 -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 (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)
    target_link_libraries(widelands_ball_of_mud wsock32)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index f8b35faaedc..061040d9ae4 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=1
+revision=2
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -21,7 +21,7 @@ checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" libexecinfo-devel"
+	makedepends+=" libexecinfo-devel gettext-devel"
 fi
 
 if [ "$CROSS_BUILD" ]; then

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR REVIEW] Use libintl on musl when necessary
  2020-08-04  1:16 [PR PATCH] Use libintl on musl when necessary ericonr
  2020-08-04  1:18 ` [PR PATCH] [Updated] " ericonr
@ 2020-08-04  1:31 ` sgn
  2020-08-04  1:31 ` sgn
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2020-08-04  1:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/24037#discussion_r464747209

Comment:
Anyway, does:
```
LDFLAGS="-lexecinfo -lintl"
```
works? If yes, it would be easier for us than patching 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR REVIEW] Use libintl on musl when necessary
  2020-08-04  1:16 [PR PATCH] Use libintl on musl when necessary ericonr
  2020-08-04  1:18 ` [PR PATCH] [Updated] " ericonr
  2020-08-04  1:31 ` [PR REVIEW] " sgn
@ 2020-08-04  1:31 ` sgn
  2020-08-04  1:33 ` ericonr
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2020-08-04  1:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/24037#discussion_r464746864

Comment:
`find_package(Intl, REQUIRED)` would be better, I think.
I didn't dig into it, though.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR REVIEW] Use libintl on musl when necessary
  2020-08-04  1:16 [PR PATCH] Use libintl on musl when necessary ericonr
                   ` (2 preceding siblings ...)
  2020-08-04  1:31 ` sgn
@ 2020-08-04  1:33 ` ericonr
  2020-08-05 16:29 ` ericonr
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-08-04  1:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/24037#discussion_r464747873

Comment:
I tried first with only `-lintl` and CMake completely ignored it. That's why I changed the patch :/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use libintl on musl when necessary
  2020-08-04  1:16 [PR PATCH] Use libintl on musl when necessary ericonr
                   ` (3 preceding siblings ...)
  2020-08-04  1:33 ` ericonr
@ 2020-08-05 16:29 ` ericonr
  2020-08-06 13:43 ` [PR REVIEW] " sgn
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-08-05 16:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/24037#issuecomment-669296191

Comment:
I will try to split the PR to let the CI finish. widelands is kind of stupid with this.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR REVIEW] Use libintl on musl when necessary
  2020-08-04  1:16 [PR PATCH] Use libintl on musl when necessary ericonr
                   ` (4 preceding siblings ...)
  2020-08-05 16:29 ` ericonr
@ 2020-08-06 13:43 ` sgn
  2020-08-07  0:41 ` sgn
  2020-08-07 11:31 ` [PR PATCH] [Closed]: " sgn
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2020-08-06 13:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/24037#discussion_r466421668

Comment:
CMake doesn't ignore it.
`cmake` just makes it hard to use correctly.
They pass `$LDFLAGS` before `*.a`, by order of filename, it couldn't file symbols in those libs.

`cmake` is `cmake`.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use libintl on musl when necessary
  2020-08-04  1:16 [PR PATCH] Use libintl on musl when necessary ericonr
                   ` (5 preceding siblings ...)
  2020-08-06 13:43 ` [PR REVIEW] " sgn
@ 2020-08-07  0:41 ` sgn
  2020-08-07 11:31 ` [PR PATCH] [Closed]: " sgn
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2020-08-07  0:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/24037#issuecomment-670259219

Comment:
On 2020-08-05 16:29:41+0000, Érico Nogueira Rolim <notifications@github.com> wrote:
> I will try to split the PR to let the CI finish. widelands is kind of stupid with this.

Not necessary, I split it into four branches here:

https://travis-ci.org/github/sgn/void-packages/builds/715687552
https://travis-ci.org/github/sgn/void-packages/builds/715687616
https://travis-ci.org/github/sgn/void-packages/builds/715687706
https://travis-ci.org/github/sgn/void-packages/builds/715687792

-- 
Danh


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Closed]: Use libintl on musl when necessary
  2020-08-04  1:16 [PR PATCH] Use libintl on musl when necessary ericonr
                   ` (6 preceding siblings ...)
  2020-08-07  0:41 ` sgn
@ 2020-08-07 11:31 ` sgn
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2020-08-07 11:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

There's a closed pull request on the void-packages repository

Use libintl on musl when necessary
https://github.com/void-linux/void-packages/pull/24037

Description:
Based on #24030 

@sgn 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-08-07 11:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04  1:16 [PR PATCH] Use libintl on musl when necessary ericonr
2020-08-04  1:18 ` [PR PATCH] [Updated] " ericonr
2020-08-04  1:31 ` [PR REVIEW] " sgn
2020-08-04  1:31 ` sgn
2020-08-04  1:33 ` ericonr
2020-08-05 16:29 ` ericonr
2020-08-06 13:43 ` [PR REVIEW] " sgn
2020-08-07  0:41 ` sgn
2020-08-07 11:31 ` [PR PATCH] [Closed]: " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).