summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamil <kamil@pkgsrc.org>2020-08-23 14:57:42 +0000
committerkamil <kamil@pkgsrc.org>2020-08-23 14:57:42 +0000
commit7991af254edd0039d1d6f3e4d3e49320d33f10b1 (patch)
treef80846cf9d3646ec4f213f84cbc5cb40d0b62e8a
parent69a15499007f82e8255991ba44094eecfa63e1d8 (diff)
downloadpkgsrc-7991af254edd0039d1d6f3e4d3e49320d33f10b1.tar.gz
ncspot: Call libc::setlocale() to fix printing of non-ASCII characters
Upstream bug report: https://github.com/hrkfdn/ncspot/issues/221 Analysis done by rvp @ UnitedBSD https://www.unitedbsd.com/d/233-spotify/54
-rw-r--r--audio/ncspot/Makefile3
-rw-r--r--audio/ncspot/distinfo5
-rw-r--r--audio/ncspot/patches/patch-Cargo.toml16
-rw-r--r--audio/ncspot/patches/patch-src_main.rs26
4 files changed, 44 insertions, 6 deletions
diff --git a/audio/ncspot/Makefile b/audio/ncspot/Makefile
index 95e84e36fa7..01ba8b8ce8b 100644
--- a/audio/ncspot/Makefile
+++ b/audio/ncspot/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2020/08/20 16:24:59 pin Exp $
+# $NetBSD: Makefile,v 1.2 2020/08/23 14:57:42 kamil Exp $
DISTNAME= ncspot-0.2.1
+PKGREVISION= 1
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_GITHUB:=hrkfdn/}
GITHUB_TAG= v${PKGVERSION_NOREV}
diff --git a/audio/ncspot/distinfo b/audio/ncspot/distinfo
index a2f61f5279f..122ab3436f5 100644
--- a/audio/ncspot/distinfo
+++ b/audio/ncspot/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1 2020/08/20 17:56:10 pin Exp $
+$NetBSD: distinfo,v 1.2 2020/08/23 14:57:42 kamil Exp $
SHA1 (addr2line-0.13.0.crate) = c7a6843df774a95b4db5a5511b58ab22c44f228a
RMD160 (addr2line-0.13.0.crate) = 22c733c5358313e9ca7fb95d1dbd695d03fcb552
@@ -1560,4 +1560,5 @@ SHA1 (xi-unicode-0.2.1.crate) = a7e8a8e9860652c65a55686568762f812fb3886a
RMD160 (xi-unicode-0.2.1.crate) = 1d50fd64d44638e4d44f154c4dc4f56bb7f3ce50
SHA512 (xi-unicode-0.2.1.crate) = cd5dde20cde2c9180247df4f6912139a436f7ab71ef86dac66418c0459df665c09fc3c5b497f8157a6209da32b3e9fda5f50d1ef06c1c8cc2557c4b90363e586
Size (xi-unicode-0.2.1.crate) = 88229 bytes
-SHA1 (patch-Cargo.toml) = 67719b3b51ecbb424b67d34b53688a71bcf480f1
+SHA1 (patch-Cargo.toml) = df5ac3791121c92707f34df5cc0ef31cab7785df
+SHA1 (patch-src_main.rs) = 3e9dcb8341463460c480e309cc782f23edece48c
diff --git a/audio/ncspot/patches/patch-Cargo.toml b/audio/ncspot/patches/patch-Cargo.toml
index b7d32eefb54..2d1e6c602b7 100644
--- a/audio/ncspot/patches/patch-Cargo.toml
+++ b/audio/ncspot/patches/patch-Cargo.toml
@@ -1,10 +1,20 @@
-$NetBSD: patch-Cargo.toml,v 1.1 2020/08/20 16:24:59 pin Exp $
+$NetBSD: patch-Cargo.toml,v 1.2 2020/08/23 14:57:43 kamil Exp $
Use portaudio by default
---- Cargo.toml.orig 2020-07-17 22:02:08.000000000 +0000
+Use libc for setlocale() to fix non-ASCII character printing.
+https://github.com/hrkfdn/ncspot/issues/221
+
+--- Cargo.toml.orig 2020-08-13 08:27:21.000000000 +0000
+++ Cargo.toml
-@@ -48,11 +48,5 @@ version = "0.15"
+@@ -42,17 +42,12 @@ clipboard = { version = "0.5", optional
+ url = "1.7"
+ strum = "0.17.1"
+ strum_macros = "0.17.1"
++libc = "0.2"
+
+ [dependencies.cursive]
+ version = "0.15"
default-features = false
[features]
diff --git a/audio/ncspot/patches/patch-src_main.rs b/audio/ncspot/patches/patch-src_main.rs
new file mode 100644
index 00000000000..161fecf43b1
--- /dev/null
+++ b/audio/ncspot/patches/patch-src_main.rs
@@ -0,0 +1,26 @@
+$NetBSD: patch-src_main.rs,v 1.1 2020/08/23 14:57:43 kamil Exp $
+
+Use libc for setlocale() to fix non-ASCII character printing.
+https://github.com/hrkfdn/ncspot/issues/221
+
+--- src/main.rs.orig 2020-08-13 08:27:21.000000000 +0000
++++ src/main.rs
+@@ -47,6 +47,8 @@ use clap::{App, Arg};
+ use cursive::traits::Identifiable;
+ use cursive::{Cursive, CursiveExt};
+
++use std::ffi::CString;
++
+ use librespot_core::authentication::Credentials;
+ use librespot_core::cache::Cache;
+ use librespot_playback::audio_backend;
+@@ -141,6 +143,9 @@ struct UserDataInner {
+ }
+
+ fn main() {
++ unsafe {
++ libc::setlocale(libc::LC_ALL, CString::new("").unwrap().as_ptr());
++ }
+ let backends = {
+ let backends: Vec<&str> = audio_backend::BACKENDS.iter().map(|b| b.0).collect();
+ format!("Audio backends: {}", backends.join(", "))