commit:     ed213b992db438a99f8384133b7e183c3b3e2b6a
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 26 18:30:14 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Feb 28 12:26:13 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed213b99

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

Disable running git in release version.

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

 .../files/pamix-1.6-fix-ncurses-freezing.patch     | 23 +++++++++++
 .../files/pamix-1.6-fix-output-scrolling.patch     | 23 +++++++++++
 .../pamix/files/pamix-1.6-xdgconfigdir.patch       | 45 ++++++++++++++++++++++
 .../{pamix-9999.ebuild => pamix-1.6-r1.ebuild}     | 39 +++++++++++++------
 media-sound/pamix/pamix-9999.ebuild                | 32 +++++++++------
 5 files changed, 138 insertions(+), 24 deletions(-)

diff --git a/media-sound/pamix/files/pamix-1.6-fix-ncurses-freezing.patch 
b/media-sound/pamix/files/pamix-1.6-fix-ncurses-freezing.patch
new file mode 100644
index 00000000000..61c34f0a420
--- /dev/null
+++ b/media-sound/pamix/files/pamix-1.6-fix-ncurses-freezing.patch
@@ -0,0 +1,23 @@
+From 1e45f226ef35b649cb2889e23ad90ad39d0db947 Mon Sep 17 00:00:00 2001
+From: Joshua Jensch <[email protected]>
+Date: Sat, 14 Mar 2020 03:11:58 +0100
+Subject: [PATCH] Use 25ms as escdelay
+
+By default ncurses will use 1000ms, which will cause freezing.
+Fixes #44
+---
+ src/pamix.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/pamix.cpp b/src/pamix.cpp
+index d5f7ead..368639d 100644
+--- a/src/pamix.cpp
++++ b/src/pamix.cpp
+@@ -206,6 +206,7 @@ int main(int argc, char **argv) {
+       initscr();
+       init_colors();
+       nodelay(stdscr, true);
++  set_escdelay(25);
+       curs_set(0);
+       keypad(stdscr, true);
+       meta(stdscr, true);

diff --git a/media-sound/pamix/files/pamix-1.6-fix-output-scrolling.patch 
b/media-sound/pamix/files/pamix-1.6-fix-output-scrolling.patch
new file mode 100644
index 00000000000..6e4b94d0566
--- /dev/null
+++ b/media-sound/pamix/files/pamix-1.6-fix-output-scrolling.patch
@@ -0,0 +1,23 @@
+From c15831c99bbef1a25710e5a34208809dc9160e86 Mon Sep 17 00:00:00 2001
+From: Joshua Jensch <[email protected]>
+Date: Sun, 1 Dec 2019 16:23:12 +0100
+Subject: [PATCH] fix bug preventing entries from being scrolled.
+
+resolves #41
+---
+ src/pamix_ui.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pamix_ui.cpp b/src/pamix_ui.cpp
+index 16a2e34..c1acb2b 100644
+--- a/src/pamix_ui.cpp
++++ b/src/pamix_ui.cpp
+@@ -265,7 +265,7 @@ pamix_entry_iter_t pamix_ui::getSelectedEntryIterator() {
+ }
+ 
+ void pamix_ui::adjustDisplayedEntries() {
+-      if (!m_Entries->empty())
++      if (m_Entries->empty())
+               return;
+       if (m_SelectedEntry >= m_NumSkippedEntries && m_SelectedEntry < 
m_NumSkippedEntries + m_NumDrawnEntries)
+               return;

diff --git a/media-sound/pamix/files/pamix-1.6-xdgconfigdir.patch 
b/media-sound/pamix/files/pamix-1.6-xdgconfigdir.patch
new file mode 100644
index 00000000000..7de00460316
--- /dev/null
+++ b/media-sound/pamix/files/pamix-1.6-xdgconfigdir.patch
@@ -0,0 +1,45 @@
+From 72d8189b942f6e95d8c946fea2faaee9a74f4b35 Mon Sep 17 00:00:00 2001
+From: nilninull <[email protected]>
+Date: Wed, 3 Jan 2018 16:32:27 +0900
+Subject: [PATCH] FIX: default XDG_CONFIG_DIRS directory
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 38605f2..7677e43 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -25,7 +25,7 @@ ELSE ()
+ ENDIF ()
+ 
+ add_executable(pamix ${pamix_SRC})
+-install(FILES pamix.conf DESTINATION /etc)
++install(FILES pamix.conf DESTINATION /etc/xdg)
+ install(TARGETS pamix DESTINATION bin)
+ install(FILES man/pamix.1 DESTINATION share/man/man1)
+ 
+From e3bf53d9a841c3559880863c8c29c2919ab5b425 Mon Sep 17 00:00:00 2001
+From: Joshua Jensch <[email protected]>
+Date: Sat, 6 Jan 2018 07:05:23 +0100
+Subject: [PATCH] change default XDG_CONFIG_DIRS value when searching config
+ file
+
+---
+ src/pamix.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pamix.cpp b/src/pamix.cpp
+index 3ea2730..d5f7ead 100644
+--- a/src/pamix.cpp
++++ b/src/pamix.cpp
+@@ -130,7 +130,7 @@ void loadConfiguration() {
+ 
+       char *xdg_config_dirs = getenv("XDG_CONFIG_DIRS");
+ 
+-      path = xdg_config_dirs ? xdg_config_dirs : "/etc";
++      path = xdg_config_dirs ? xdg_config_dirs : "/etc/xdg";
+       path += "/pamix.conf";
+       size_t cpos = path.find(':');
+       while (cpos != std::string::npos) {

diff --git a/media-sound/pamix/pamix-9999.ebuild 
b/media-sound/pamix/pamix-1.6-r1.ebuild
similarity index 52%
copy from media-sound/pamix/pamix-9999.ebuild
copy to media-sound/pamix/pamix-1.6-r1.ebuild
index 1e8fad34492..e3fa9ceb8f7 100644
--- a/media-sound/pamix/pamix-9999.ebuild
+++ b/media-sound/pamix/pamix-1.6-r1.ebuild
@@ -1,38 +1,53 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
 inherit cmake
 
-if [[ "${PV}" == 9999 ]] ; then
+if [[ ${PV} == *9999 ]] ; then
+       EGIT_REPO_URI="https://github.com/patroclos/PAmix.git";
        inherit git-r3
+else
+       SRC_URI="https://github.com/patroclos/PAmix/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+       S="${WORKDIR}/PAmix-${PV}"
 fi
 
 DESCRIPTION="A PulseAudio NCurses mixer"
 HOMEPAGE="https://github.com/patroclos/PAmix";
+
 LICENSE="MIT"
 SLOT="0"
 IUSE="+unicode"
 
-if [[ ${PV} == 9999 ]] ; then
-       EGIT_REPO_URI="https://github.com/patroclos/PAmix.git";
-else
-       SRC_URI="https://github.com/patroclos/PAmix/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
-       KEYWORDS="~amd64 ~x86"
-       S="${WORKDIR}/PAmix-${PV}"
-fi
-
-RDEPEND="media-sound/pulseaudio
-       sys-libs/ncurses:0=[unicode?]"
+RDEPEND="
+       media-sound/pulseaudio
+       sys-libs/ncurses:0=[unicode?]
+"
 DEPEND="${RDEPEND}"
 BDEPEND="
        virtual/pkgconfig
 "
 
+PATCHES=(
+       "${FILESDIR}/${P}-ncurses_pkgconfig.patch"
+       "${FILESDIR}/${P}-xdgconfigdir.patch"
+       "${FILESDIR}/${P}-fix-output-scrolling.patch"
+       "${FILESDIR}/${P}-fix-ncurses-freezing.patch"
+)
+
+src_prepare() {
+       cmake_src_prepare
+       if [[ ${PV} != 9999 ]] ; then
+               sed -e "/^include(CMakeGitDefines.cmake)/d" -i CMakeLists.txt 
|| die
+       fi
+}
+
 src_configure() {
        local mycmakeargs=(
                -DWITH_UNICODE="$(usex unicode)"
        )
+       [[ ${PV} != 9999 ]] && mycmakeargs+=( -DGIT_VERSION=${PV} )
        cmake_src_configure
 }

diff --git a/media-sound/pamix/pamix-9999.ebuild 
b/media-sound/pamix/pamix-9999.ebuild
index 1e8fad34492..aac3dbb67cf 100644
--- a/media-sound/pamix/pamix-9999.ebuild
+++ b/media-sound/pamix/pamix-9999.ebuild
@@ -1,38 +1,46 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
 inherit cmake
 
-if [[ "${PV}" == 9999 ]] ; then
+if [[ ${PV} == *9999 ]] ; then
+       EGIT_REPO_URI="https://github.com/patroclos/PAmix.git";
        inherit git-r3
+else
+       SRC_URI="https://github.com/patroclos/PAmix/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+       S="${WORKDIR}/PAmix-${PV}"
 fi
 
 DESCRIPTION="A PulseAudio NCurses mixer"
 HOMEPAGE="https://github.com/patroclos/PAmix";
+
 LICENSE="MIT"
 SLOT="0"
 IUSE="+unicode"
 
-if [[ ${PV} == 9999 ]] ; then
-       EGIT_REPO_URI="https://github.com/patroclos/PAmix.git";
-else
-       SRC_URI="https://github.com/patroclos/PAmix/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
-       KEYWORDS="~amd64 ~x86"
-       S="${WORKDIR}/PAmix-${PV}"
-fi
-
-RDEPEND="media-sound/pulseaudio
-       sys-libs/ncurses:0=[unicode?]"
+RDEPEND="
+       media-sound/pulseaudio
+       sys-libs/ncurses:0=[unicode?]
+"
 DEPEND="${RDEPEND}"
 BDEPEND="
        virtual/pkgconfig
 "
 
+src_prepare() {
+       cmake_src_prepare
+       if [[ ${PV} != 9999 ]] ; then
+               sed -e "/^include(CMakeGitDefines.cmake)/d" -i CMakeLists.txt 
|| die
+       fi
+}
+
 src_configure() {
        local mycmakeargs=(
                -DWITH_UNICODE="$(usex unicode)"
        )
+       [[ ${PV} != 9999 ]] && mycmakeargs+=( -DGIT_VERSION=${PV} )
        cmake_src_configure
 }

Reply via email to