From 2b1b1d6dc2fd8b4bc1c714c8eff4f9c87007636a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= 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 -Date: Wed, 18 Dec 2019 18:26:02 -0600 -Subject: [PATCH 3/4] musl-_nl_msg_cat_cntr - -Signed-off-by: Nathan Owens ---- - 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 - #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?= 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?= 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?= 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