commit:     4faad5f0a66d1e80781f76a356cbf929b16931ba
Author:     Artemis Everfree <artemis <AT> artemis <DOT> sh>
AuthorDate: Fri Jul 19 22:01:07 2024 +0000
Commit:     Artemis Everfree <artemis <AT> artemis <DOT> sh>
CommitDate: Fri Jul 19 22:01:59 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4faad5f0

media-sound/corrscope: new package, add 0.10.0

Signed-off-by: Artemis Everfree <artemis <AT> artemis.sh>

 media-sound/corrscope/Manifest                     |  1 +
 media-sound/corrscope/corrscope-0.10.0.ebuild      | 45 +++++++++++
 .../corrscope/files/remove-appnope-dep.patch       | 87 ++++++++++++++++++++++
 media-sound/corrscope/metadata.xml                 | 12 +++
 4 files changed, 145 insertions(+)

diff --git a/media-sound/corrscope/Manifest b/media-sound/corrscope/Manifest
new file mode 100644
index 000000000..117f80c67
--- /dev/null
+++ b/media-sound/corrscope/Manifest
@@ -0,0 +1 @@
+DIST corrscope-0.10.0.tar.gz 107386 BLAKE2B 
af3613386ce45917b9701fa2eb3d4857a7ae8b2a0e7452ce03db00493a49ecf3e1d196e0324434261f3f652c64b31036b6bf0f9cf6541a886051445f3d29fb67
 SHA512 
c403ed4f740d48b720bc521c005708f7c0797fd12d7ebb2a8605f33f2b2ca0e2a7af9e38883437460f32f5515675532b9a6ba49118a8bc21190af8eb070274c2

diff --git a/media-sound/corrscope/corrscope-0.10.0.ebuild 
b/media-sound/corrscope/corrscope-0.10.0.ebuild
new file mode 100644
index 000000000..ff81597e0
--- /dev/null
+++ b/media-sound/corrscope/corrscope-0.10.0.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+EAPI=8
+
+DISTUTILS_USE_PEP517=poetry
+DISTUTILS_SINGLE_IMPL=1
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Advanced oscilloscope audio visualizer specializing in chiptune"
+HOMEPAGE="
+       https://pypi.org/project/corrscope/
+       https://corrscope.github.io/corrscope/
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
+RDEPEND="
+       $(python_gen_cond_dep '
+               dev-python/ruamel-yaml[${PYTHON_USEDEP}]
+               dev-python/numpy[${PYTHON_USEDEP}]
+               dev-python/click[${PYTHON_USEDEP}]
+               dev-python/matplotlib[${PYTHON_USEDEP}]
+               dev-python/attrs[${PYTHON_USEDEP}]
+               dev-python/appdirs[${PYTHON_USEDEP}]
+               dev-python/atomicwrites[${PYTHON_USEDEP}]
+               dev-python/colorspacious[${PYTHON_USEDEP}]
+               dev-python/QtPy[${PYTHON_USEDEP}]
+       ')
+       media-video/ffmpeg
+"
+
+PATCHES=(
+       # appnope is a library for disabling powersaving on macOS. corrscope
+       # hard-depends on this currently. appnope isn't packaged, and it seems a
+       # bit silly to me to package it for gentoo given its purpose, so I've 
just
+       # removed the few lines that import/invoke it.
+       #
+       # Ideally, we should upstream a fix that only conditionally imports it,
+       # but I don't know how to do that right now.
+       "${FILESDIR}"/remove-appnope-dep.patch
+)

diff --git a/media-sound/corrscope/files/remove-appnope-dep.patch 
b/media-sound/corrscope/files/remove-appnope-dep.patch
new file mode 100644
index 000000000..44e96ccfa
--- /dev/null
+++ b/media-sound/corrscope/files/remove-appnope-dep.patch
@@ -0,0 +1,87 @@
+diff --git a/PKG-INFO b/PKG-INFO
+index 59a2ee4..4407908 100644
+--- a/PKG-INFO
++++ b/PKG-INFO
+@@ -21,7 +21,6 @@ Requires-Dist: PyQt5-Qt5 (>=5.15,<5.15.11) ; extra == "qt5"
+ Requires-Dist: PyQt6 (>=6.2,<7.0) ; extra == "qt6"
+ Requires-Dist: QtPy (>=2.0.1,<3.0.0)
+ Requires-Dist: appdirs (>=1.4.4,<2.0.0)
+-Requires-Dist: appnope (>=0.1.3,<0.2.0)
+ Requires-Dist: atomicwrites (>=1.4.0,<2.0.0)
+ Requires-Dist: attrs (>=21.2.0,<22.0.0)
+ Requires-Dist: click (>=8.0.1,<9.0.0)
+diff --git a/corrscope/corrscope.py b/corrscope/corrscope.py
+index 79a6cba..d20b4c4 100644
+--- a/corrscope/corrscope.py
++++ b/corrscope/corrscope.py
+@@ -197,11 +197,6 @@ class Arguments:
+ 
+ 
+ def worker_create_renderer(renderer_params: RendererParams, shmem_names: 
List[str]):
+-    import appnope
+-
+-    # Disable power saving for renderer processes.
+-    appnope.nope()
+-
+     global WORKER_RENDERER
+     global SHMEMS
+ 
+diff --git a/corrscope/gui/__init__.py b/corrscope/gui/__init__.py
+index f983021..afe2993 100644
+--- a/corrscope/gui/__init__.py
++++ b/corrscope/gui/__init__.py
+@@ -10,7 +10,6 @@ from pathlib import Path
+ from types import MethodType
+ from typing import Optional, List, Any, Tuple, Callable, Union, Dict, 
Sequence, NewType
+ 
+-import appnope
+ import qtpy.QtCore as qc
+ import qtpy.QtWidgets as qw
+ import attr
+@@ -803,22 +802,21 @@ class CorrJob(qc.QObject):
+         """Called in separate thread."""
+         cfg = self.cfg
+         arg = self.arg
+-        with appnope.nope_scope(reason="corrscope preview/render active"):
+-            try:
+-                self.corr = CorrScope(cfg, arg)
+-                self.corr.play()
++        try:
++            self.corr = CorrScope(cfg, arg)
++            self.corr.play()
+ 
+-            except paths.MissingFFmpegError:
+-                arg.on_end()
+-                self.ffmpeg_missing.emit()
++        except paths.MissingFFmpegError:
++            arg.on_end()
++            self.ffmpeg_missing.emit()
+ 
+-            except Exception as e:
+-                arg.on_end()
+-                stack_trace = format_stack_trace(e)
+-                self.error.emit(stack_trace)
++        except Exception as e:
++            arg.on_end()
++            stack_trace = format_stack_trace(e)
++            self.error.emit(stack_trace)
+ 
+-            else:
+-                arg.on_end()
++        else:
++            arg.on_end()
+ 
+ 
+ class CorrThread(Thread):
+diff --git a/pyproject.toml b/pyproject.toml
+index 9c281ee..59cbe64 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -32,7 +32,6 @@ QtPy = "^2.0.1"
+ PyQt5 = {version = "^5.15", optional = true}
+ PyQt5-Qt5 = {version = "^5.15,<5.15.11", optional = true}
+ PyQt6 = {version = "^6.2", optional = true}
+-appnope = "^0.1.3"
+ 
+ [tool.poetry.extras]
+ qt5 = ["PyQt5", "PyQt5-Qt5"]

diff --git a/media-sound/corrscope/metadata.xml 
b/media-sound/corrscope/metadata.xml
new file mode 100644
index 000000000..d907a29b4
--- /dev/null
+++ b/media-sound/corrscope/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Artemis Everfree</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="pypi">corrscope</remote-id>
+               <remote-id type="github">corrscope/corrscope</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to