[gentoo-commits] repo/gentoo:master commit in: media-sound/pnmixer/files/, media-sound/pnmixer/

2021-02-28 Thread Andreas Sturmlechner
commit: 778f492d269a30b95d5d85222d96e005e518f087
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Fri Feb 26 19:03:49 2021 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Sun Feb 28 12:26:13 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=778f492d

media-sound/pnmixer: Various upstream fixes and port to EAPI-7

Package-Manager: Portage-3.0.15, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner  gentoo.org>

 ...pnmixer-0.7.2-fix-assert-if-volume-gt-100.patch | 37 ++
 .../pnmixer-0.7.2-fix-possible-garbage-value.patch | 38 ++
 .../files/pnmixer-0.7.2-fix-possible-memleak.patch | 21 
 media-sound/pnmixer/pnmixer-0.7.2-r1.ebuild| 59 ++
 4 files changed, 155 insertions(+)

diff --git 
a/media-sound/pnmixer/files/pnmixer-0.7.2-fix-assert-if-volume-gt-100.patch 
b/media-sound/pnmixer/files/pnmixer-0.7.2-fix-assert-if-volume-gt-100.patch
new file mode 100644
index 000..6fd28572f90
--- /dev/null
+++ b/media-sound/pnmixer/files/pnmixer-0.7.2-fix-assert-if-volume-gt-100.patch
@@ -0,0 +1,37 @@
+From 7eed10b2bd4650dadbc2c98f435d2bb10de7f75e Mon Sep 17 00:00:00 2001
+From: Arnaud Rebillout 
+Date: Mon, 19 Jun 2017 20:02:01 +0700
+Subject: [PATCH] Clip volume between 0 and 100 (thx to yunake) #162
+
+---
+ src/audio.c | 13 -
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/audio.c b/src/audio.c
+index 750f20f..06b245c 100644
+--- a/src/audio.c
 b/src/audio.c
+@@ -437,11 +437,22 @@ gdouble
+ audio_get_volume(Audio *audio)
+ {
+   AlsaCard *soundcard = audio->soundcard;
++  gdouble volume;
+ 
+   if (!soundcard)
+   return 0;
+ 
+-  return alsa_card_get_volume(soundcard);
++  volume = alsa_card_get_volume(soundcard);
++
++  /* With PulseAudio, it is perfectly possible for the volume to go above 
100%.
++   * Since we don't really expect or handle that, let's clip it right now.
++   */
++  if (volume < 0)
++  volume = 0;
++  if (volume > 100)
++  volume = 100;
++
++  return volume;
+ }
+ 
+ /**

diff --git 
a/media-sound/pnmixer/files/pnmixer-0.7.2-fix-possible-garbage-value.patch 
b/media-sound/pnmixer/files/pnmixer-0.7.2-fix-possible-garbage-value.patch
new file mode 100644
index 000..e85dcedd233
--- /dev/null
+++ b/media-sound/pnmixer/files/pnmixer-0.7.2-fix-possible-garbage-value.patch
@@ -0,0 +1,38 @@
+From c8577027aa4597c8f194a84a73982aa0ce7f2dd0 Mon Sep 17 00:00:00 2001
+From: Julian Ospald 
+Date: Mon, 19 Feb 2018 20:06:26 +0100
+Subject: [PATCH] MEM: fix possible garbage value wrt #174
+
+Not sure if the clang static analyzer has trouble
+with g_memdup() or if there is something more serious
+going on. Good old g_malloc() works too though.
+---
+ src/ui-tray-icon.c | 6 --
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/ui-tray-icon.c b/src/ui-tray-icon.c
+index 27b35f3..23ba947 100644
+--- a/src/ui-tray-icon.c
 b/src/ui-tray-icon.c
+@@ -166,9 +166,11 @@ pixbuf_array_free(GdkPixbuf **pixbufs)
+ static GdkPixbuf **
+ pixbuf_array_new(int size)
+ {
+-  GdkPixbuf *pixbufs[N_VOLUME_PIXBUFS];
++  GdkPixbuf **pixbufs;
+   gboolean system_theme;
+ 
++  pixbufs = g_new0(GdkPixbuf *, N_VOLUME_PIXBUFS);
++
+   DEBUG("Building pixbuf array (requesting size %d)", size);
+ 
+   system_theme = prefs_get_boolean("SystemTheme", FALSE);
+@@ -202,7 +204,7 @@ pixbuf_array_new(int size)
+   pixbufs[VOLUME_HIGH] = pixbuf_new_from_file("pnmixer-high.png");
+   }
+ 
+-  return g_memdup(pixbufs, sizeof pixbufs);
++  return pixbufs;
+ }
+ 
+ /* Tray icon volume meter */

diff --git a/media-sound/pnmixer/files/pnmixer-0.7.2-fix-possible-memleak.patch 
b/media-sound/pnmixer/files/pnmixer-0.7.2-fix-possible-memleak.patch
new file mode 100644
index 000..a88013b9d4b
--- /dev/null
+++ b/media-sound/pnmixer/files/pnmixer-0.7.2-fix-possible-memleak.patch
@@ -0,0 +1,21 @@
+From 84c66c389cd7a8a47aa5f543726683a19dcca5ff Mon Sep 17 00:00:00 2001
+From: Julian Ospald 
+Date: Mon, 19 Feb 2018 20:06:45 +0100
+Subject: [PATCH] MEM: fix possible memory leak wrt #174
+
+---
+ src/alsa.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/alsa.c b/src/alsa.c
+index c46d4d8..d91c79f 100644
+--- a/src/alsa.c
 b/src/alsa.c
+@@ -336,6 +336,7 @@ mixer_get_poll_descriptors(const char *hctl, snd_mixer_t 
*mixer)
+   err = snd_mixer_poll_descriptors(mixer, fds, count);
+   if (err < 0) {
+   ALSA_CARD_ERR(hctl, err, "Couldn't get poll descriptors");
++  g_free(fds);
+   return NULL;
+   }
+ 

diff --git a/media-sound/pnmixer/pnmixer-0.7.2-r1.ebuild 
b/media-sound/pnmixer/pnmixer-0.7.2-r1.ebuild
new file mode 100644
index 000..4930d96eb60
--- /dev/null
+++ b/media-sound/pnmixer/pnmixer-0.7.2-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed 

[gentoo-commits] repo/gentoo:master commit in: media-sound/pnmixer/files/

2018-09-21 Thread Andreas Sturmlechner
commit: 97963c3b55259c1f408178abe7515f5d7ecf4342
Author: Michael Mair-Keimberger  gmail  com>
AuthorDate: Wed Sep 19 17:31:46 2018 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Fri Sep 21 10:20:37 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97963c3b

media-sound/pnmixer: remove unused patch(es)

Closes: https://github.com/gentoo/gentoo/pull/9917

 .../files/pnmixer-0.6_pre20111213-build.patch  | 63 --
 .../pnmixer-0.6_pre20111213-desktopfile.patch  | 15 --
 2 files changed, 78 deletions(-)

diff --git a/media-sound/pnmixer/files/pnmixer-0.6_pre20111213-build.patch 
b/media-sound/pnmixer/files/pnmixer-0.6_pre20111213-build.patch
deleted file mode 100644
index 5e4fba2d075..000
--- a/media-sound/pnmixer/files/pnmixer-0.6_pre20111213-build.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From: Julian Ospald 
-Date: Thu Nov 15 23:59:49 UTC 2012
-Subject: build system
-
-respect CFLAGS, use rdynamic
-don't use AM_CFLAGS in configure.in
-fix macros for automake-1.13
-
 configure.in
-+++ configure.in
-@@ -1,16 +1,13 @@
- dnl Process this file with autoconf to produce a configure script.
- 
--AC_INIT(configure.in)
--AM_INIT_AUTOMAKE(pnmixer, 0.6-dev)
--AM_CONFIG_HEADER(config.h)
-+AC_INIT([pnmixer], [0.6-dev])
-+AM_INIT_AUTOMAKE
-+AC_CONFIG_HEADERS(config.h)
- AM_MAINTAINER_MODE
- 
--OLD_CFLAGS=$CFLAGS
- AC_ISC_POSIX
- AC_PROG_CC
--AM_PROG_CC_STDC
- AC_HEADER_STDC
--CFLAGS=$OLD_CXXFLAGS
- 
- pkg_modules="gtk+-2.0 >= 2.16.0"
- 
-@@ -37,12 +34,13 @@
- 
- if test x"$debugit" = x"yes"; then
- AC_DEFINE([DEBUG],[],[Debug Mode])
--AM_CFLAGS="$AM_CFLAGS -g -Wall -Werror -Wno-uninitialized -Wformat 
-Wformat-security -O0 -export-dynamic"
- else
- AC_DEFINE([NDEBUG],[],[No-debug Mode])
--AM_CFLAGS="$AM_CFLAGS -O2 -export-dynamic"
- fi
- 
-+CFLAGS="$CFLAGS -Wall -Wno-uninitialized -Wformat -Wformat-security"
-+LDFLAGS="-rdynamic $LDFLAGS"
-+
- ##
- 
- # Make sure we have X11, and also have it added to LIBS
-@@ -74,7 +72,6 @@
-AC_DEFINE([HAVE_LIBN],1,[Defined if you have libnotify])
- fi
- 
--AC_SUBST([AM_CFLAGS])
- 
- PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
- AC_SUBST(PACKAGE_CFLAGS)
 src/Makefile.am
-+++ src/Makefile.am
-@@ -1,6 +1,5 @@
- ## Process this file with automake to produce Makefile.in
- 
--AM_CFLAGS = @AM_CFLAGS@
- 
- INCLUDES = \
-   -DPACKAGE_DATA_DIR=\""$(datadir)"\" \

diff --git 
a/media-sound/pnmixer/files/pnmixer-0.6_pre20111213-desktopfile.patch 
b/media-sound/pnmixer/files/pnmixer-0.6_pre20111213-desktopfile.patch
deleted file mode 100644
index 992e0293647..000
--- a/media-sound/pnmixer/files/pnmixer-0.6_pre20111213-desktopfile.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-From: Julian Ospald 
-Date: Fri Nov 16 00:03:56 UTC 2012
-Subject: desktop file
-
-   comply with fd.o spec
-
 data/pnmixer.desktop
-+++ data/pnmixer.desktop
-@@ -12,4 +12,4 @@
- Icon=pnmixer
- Terminal=false
- Type=Application
--Categories=Application;AudioVideo;
-\ No newline at end of file
-+Categories=AudioVideo;