snapper: link against libintl on musl.

This commit is contained in:
Érico Rolim 2020-08-03 21:27:52 -03:00 committed by Đoàn Trần Công Danh
parent 06a2d45de2
commit 4903a7e8fe
2 changed files with 4 additions and 61 deletions

View file

@ -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

View file

@ -1,7 +1,7 @@
# Template file for 'snapper'
pkgname=snapper
version=0.8.12
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() {