pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/i3status i3status: Fix up sunaudio support an...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f0d20b0b6843
branches:  trunk
changeset: 412757:f0d20b0b6843
user:      nia <nia%pkgsrc.org@localhost>
date:      Wed Mar 11 23:28:21 2020 +0000

description:
i3status: Fix up sunaudio support and link to my PR

diffstat:

 sysutils/i3status/Makefile                          |   4 +-
 sysutils/i3status/distinfo                          |   4 +-
 sysutils/i3status/patches/patch-src_print__volume.c |  39 ++++++++++++++++++++-
 3 files changed, 42 insertions(+), 5 deletions(-)

diffs (89 lines):

diff -r 175e9559f157 -r f0d20b0b6843 sysutils/i3status/Makefile
--- a/sysutils/i3status/Makefile        Wed Mar 11 23:09:09 2020 +0000
+++ b/sysutils/i3status/Makefile        Wed Mar 11 23:28:21 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.13 2020/03/11 22:46:36 nia Exp $
+# $NetBSD: Makefile,v 1.14 2020/03/11 23:28:21 nia Exp $
 
 DISTNAME=      i3status-2.13
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    sysutils
 MASTER_SITES=  https://i3wm.org/i3status/
 EXTRACT_SUFX=  .tar.bz2
diff -r 175e9559f157 -r f0d20b0b6843 sysutils/i3status/distinfo
--- a/sysutils/i3status/distinfo        Wed Mar 11 23:09:09 2020 +0000
+++ b/sysutils/i3status/distinfo        Wed Mar 11 23:28:21 2020 +0000
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.4 2020/03/11 22:46:36 nia Exp $
+$NetBSD: distinfo,v 1.5 2020/03/11 23:28:21 nia Exp $
 
 SHA1 (i3status-2.13.tar.bz2) = b09fd2f322046daaca22f60cf6bfc7dbebea1b11
 RMD160 (i3status-2.13.tar.bz2) = 8432809add78a0086ce8181160528f5e34b7c0d3
 SHA512 (i3status-2.13.tar.bz2) = 6dadff19e53499d169ba4f491e1f821014b4f92fc3c93d7947c85cbbbdeaba538d02bd8ab98fe266a8f80756a287fd5803ec77a8cd874d50082b5cad309875c2
 Size (i3status-2.13.tar.bz2) = 201409 bytes
 SHA1 (patch-Makefile.in) = e50ed614d41a1bcef33feb6414322affa5e20a92
-SHA1 (patch-src_print__volume.c) = 68dd7489b9e7748edf2e326ffb8d320788960c42
+SHA1 (patch-src_print__volume.c) = b855472d429f17491c7441924e0aca9ce4ee6190
 SHA1 (patch-src_print__wireless__info.c) = 7039b7fbd2f43b798763793cd4296035610eeee0
 SHA1 (patch-src_pulse.c) = bfc5265c5c11f3a56e9b88c936b9856245b998f4
diff -r 175e9559f157 -r f0d20b0b6843 sysutils/i3status/patches/patch-src_print__volume.c
--- a/sysutils/i3status/patches/patch-src_print__volume.c       Wed Mar 11 23:09:09 2020 +0000
+++ b/sysutils/i3status/patches/patch-src_print__volume.c       Wed Mar 11 23:28:21 2020 +0000
@@ -1,7 +1,9 @@
-$NetBSD: patch-src_print__volume.c,v 1.1 2020/03/11 22:46:36 nia Exp $
+$NetBSD: patch-src_print__volume.c,v 1.2 2020/03/11 23:28:21 nia Exp $
 
 Use sunaudio on NetBSD.
 
+https://github.com/i3/i3status/pull/391
+
 --- src/print_volume.c.orig    2019-01-23 08:03:56.000000000 +0000
 +++ src/print_volume.c
 @@ -21,7 +21,7 @@
@@ -22,6 +24,15 @@
      /* Try PulseAudio first */
  
      /* If the device name has the format "pulse[:N]" where N is the
+@@ -248,7 +248,7 @@ void print_volume(yajl_gen json_gen, cha
+     snd_mixer_selem_id_free(sid);
+ 
+ #endif
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+     char *mixerpath;
+     char defaultmixer[] = "/dev/mixer";
+     int mixfd, vol, devmask = 0;
 @@ -272,7 +272,7 @@ void print_volume(yajl_gen json_gen, cha
      if (mixer_idx > 0)
          free(mixerpath);
@@ -31,3 +42,29 @@
      int oclass_idx = -1, master_idx = -1, master_mute_idx = -1;
      int master_next = AUDIO_MIXER_LAST;
      mixer_devinfo_t devinfo, devinfo2;
+@@ -327,15 +327,17 @@ void print_volume(yajl_gen json_gen, cha
+         vol = (int)vinfo.un.value.level[AUDIO_MIXER_LEVEL_MONO];
+     }
+ 
+-    vinfo.dev = master_mute_idx;
+-    vinfo.type = AUDIO_MIXER_ENUM;
+-    if (ioctl(mixfd, AUDIO_MIXER_READ, &vinfo) == -1)
+-        goto out;
++    if (master_mute_idx != -1) {
++        vinfo.dev = master_mute_idx;
++        vinfo.type = AUDIO_MIXER_ENUM;
++        if (ioctl(mixfd, AUDIO_MIXER_READ, &vinfo) == -1)
++            goto out;
+ 
+-    if (master_mute_idx != -1 && vinfo.un.ord) {
+-        START_COLOR("color_degraded");
+-        fmt = fmt_muted;
+-        pbval = 0;
++        if (vinfo.un.ord) {
++            START_COLOR("color_degraded");
++            fmt = fmt_muted;
++            pbval = 0;
++        }
+     }
+ 
+ #else



Home | Main Index | Thread Index | Old Index