git: 6f636c04e71f - main - audio/rsgain: New port

From: Jason E. Hale <jhale_at_FreeBSD.org>
Date: Wed, 19 Oct 2022 15:23:15 UTC
The branch main has been updated by jhale:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6f636c04e71f83b5d6c1eb30d5fa74bc9332528b

commit 6f636c04e71f83b5d6c1eb30d5fa74bc9332528b
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2022-10-19 15:19:12 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2022-10-19 15:22:02 +0000

    audio/rsgain: New port
    
    rsgain (really simple gain) is a ReplayGain 2.0 tagging utility for
    Windows, macOS, and Linux. rsgain applies loudness metadata tags
    to your files, while leaving the audio stream untouched. A
    ReplayGain-compatible player will dynamically adjust the volume of
    your tagged files during playback.
    
    rsgain is designed with a "batteries included" philosophy, allowing
    a user to scan their entire music library without requiring external
    scripts or other tools. It aims to strike the perfect balance between
    power and simplicity by providing multiple user interfaces.
    
    https://github.com/complexlogic/rsgain/
---
 audio/Makefile                       |  1 +
 audio/rsgain/Makefile                | 32 ++++++++++++++++++++++++++++++++
 audio/rsgain/distinfo                |  3 +++
 audio/rsgain/files/patch-src_tag.cpp | 25 +++++++++++++++++++++++++
 audio/rsgain/pkg-descr               | 10 ++++++++++
 audio/rsgain/pkg-plist               |  5 +++++
 6 files changed, 76 insertions(+)

diff --git a/audio/Makefile b/audio/Makefile
index 4297f68f566a..6b1acdba0c2e 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -692,6 +692,7 @@
     SUBDIR += rnnoise
     SUBDIR += rnnoise-nu
     SUBDIR += rosegarden
+    SUBDIR += rsgain
     SUBDIR += rsynth
     SUBDIR += rtaudio
     SUBDIR += rtmidi
diff --git a/audio/rsgain/Makefile b/audio/rsgain/Makefile
new file mode 100644
index 000000000000..cd2e204e77f5
--- /dev/null
+++ b/audio/rsgain/Makefile
@@ -0,0 +1,32 @@
+PORTNAME=	rsgain
+DISTVERSIONPREFIX=	v
+DISTVERSION=	3.0.1
+CATEGORIES=	audio
+
+MAINTAINER=	jhale@FreeBSD.org
+COMMENT=	ReplayGain 2.0 tagging utility
+WWW=		https://github.com/complexlogic/rsgain
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+LIB_DEPENDS=	libebur128.so:audio/libebur128 \
+		libtag.so:audio/taglib \
+		libfmt.so:devel/libfmt \
+		libinih.so:devel/inih \
+		libavcodec.so:multimedia/ffmpeg
+
+USES=		cmake compiler:c++2b-lang pkgconfig
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	complexlogic
+
+CXXFLAGS+=	-pthread
+
+OPTIONS_DEFINE=	DOCS
+
+post-install:
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/audio/rsgain/distinfo b/audio/rsgain/distinfo
new file mode 100644
index 000000000000..1e05beb41299
--- /dev/null
+++ b/audio/rsgain/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1666113201
+SHA256 (complexlogic-rsgain-v3.0.1_GH0.tar.gz) = 928a0d5aefb0e2d195c44a7571425d39f0e5065050c534032ee746d91596f22d
+SIZE (complexlogic-rsgain-v3.0.1_GH0.tar.gz) = 47435
diff --git a/audio/rsgain/files/patch-src_tag.cpp b/audio/rsgain/files/patch-src_tag.cpp
new file mode 100644
index 000000000000..4967905acf88
--- /dev/null
+++ b/audio/rsgain/files/patch-src_tag.cpp
@@ -0,0 +1,25 @@
+/wrkdirs/usr/ports/audio/rsgain/work/rsgain-3.0.1/src/tag.cpp:254:5: error: no member named 'round' in namespace 'std'
+    GAIN_TO_Q78(track.result.album_gain) : GAIN_TO_Q78(track.result.track_gain);
+    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/wrkdirs/usr/ports/audio/rsgain/work/rsgain-3.0.1/src/tag.hpp:35:38: note: expanded from macro 'GAIN_TO_Q78'
+#define GAIN_TO_Q78(gain) (int) std::round(gain * 256.f)
+                                ~~~~~^
+
+--- src/tag.cpp.orig	2022-10-19 02:49:19 UTC
++++ src/tag.cpp
+@@ -28,7 +28,7 @@
+  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <math.h>
++#include <cmath>
+ #include <stdio.h>
+ #include <string.h>
+ #include <string>
+@@ -506,4 +506,4 @@ void taglib_get_version(std::string &buffer)
+ void taglib_get_version(std::string &buffer)
+ {
+     buffer = fmt::format("{}.{}.{}", TAGLIB_MAJOR_VERSION, TAGLIB_MINOR_VERSION, TAGLIB_PATCH_VERSION);
+-}
+\ No newline at end of file
++}
diff --git a/audio/rsgain/pkg-descr b/audio/rsgain/pkg-descr
new file mode 100644
index 000000000000..0902523b4299
--- /dev/null
+++ b/audio/rsgain/pkg-descr
@@ -0,0 +1,10 @@
+rsgain (really simple gain) is a ReplayGain 2.0 tagging utility for
+Windows, macOS, and Linux. rsgain applies loudness metadata tags
+to your files, while leaving the audio stream untouched. A
+ReplayGain-compatible player will dynamically adjust the volume of
+your tagged files during playback.
+
+rsgain is designed with a "batteries included" philosophy, allowing
+a user to scan their entire music library without requiring external
+scripts or other tools. It aims to strike the perfect balance between
+power and simplicity by providing multiple user interfaces.
diff --git a/audio/rsgain/pkg-plist b/audio/rsgain/pkg-plist
new file mode 100644
index 000000000000..59d7bf0531b3
--- /dev/null
+++ b/audio/rsgain/pkg-plist
@@ -0,0 +1,5 @@
+bin/rsgain
+%%PORTDOCS%%%%DOCSDIR%%/README.md
+%%DATADIR%%/presets/default.ini
+%%DATADIR%%/presets/ebur128.ini
+%%DATADIR%%/presets/loudgain.ini