diff options
author | edwin <edwin@FreeBSD.org> | 2008-06-18 16:59:44 +0800 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2008-06-18 16:59:44 +0800 |
commit | f1bdb6ea1b89dad804e4b95825afc24e2599e47c (patch) | |
tree | d14f2d615798dc7e83cd864fe75adac33183b1e4 | |
parent | a644abc4f4a489f55957b4a3cc11672782538bd2 (diff) | |
download | freebsd-ports-gnome-f1bdb6ea1b89dad804e4b95825afc24e2599e47c.tar.gz freebsd-ports-gnome-f1bdb6ea1b89dad804e4b95825afc24e2599e47c.tar.zst freebsd-ports-gnome-f1bdb6ea1b89dad804e4b95825afc24e2599e47c.zip |
[New port] audio/wavegain
WaveGain is a program that applies ReplayGain to wave files.
The FreeBSD port of WaveGain is with a patch from gnormalize
whose author is Claudio Fernandes de Souza Rodrigues.
The author of WaveGain is John Edwards.
WWW: http://www.rarewares.org/others.html
PR: ports/123963
Submitted by: Denise H. G. <darcsis@gmail.com>
-rw-r--r-- | audio/Makefile | 1 | ||||
-rw-r--r-- | audio/wavegain/Makefile | 35 | ||||
-rw-r--r-- | audio/wavegain/distinfo | 3 | ||||
-rw-r--r-- | audio/wavegain/files/patch-Makefile.linux | 9 | ||||
-rw-r--r-- | audio/wavegain/files/patch-audio.c | 23 | ||||
-rw-r--r-- | audio/wavegain/files/patch-wavegain.c | 134 | ||||
-rw-r--r-- | audio/wavegain/pkg-descr | 7 |
7 files changed, 212 insertions, 0 deletions
diff --git a/audio/Makefile b/audio/Makefile index ea570fe4246f..f5ed2723169e 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -685,6 +685,7 @@ SUBDIR += waon SUBDIR += wav2cdr SUBDIR += wavbreaker + SUBDIR += wavegain SUBDIR += waveplay SUBDIR += wavpack SUBDIR += wavplay diff --git a/audio/wavegain/Makefile b/audio/wavegain/Makefile new file mode 100644 index 000000000000..91378af48e01 --- /dev/null +++ b/audio/wavegain/Makefile @@ -0,0 +1,35 @@ +# New ports collection makefile for: wavegain +# Date created: 24 May 2008 +# Whom: Denise H. G. <darcsis@gmail.com> +# +# $FreeBSD$ +# + +PORTNAME= wavegain +PORTVERSION= 1.2.6 +CATEGORIES= audio +MASTER_SITES= http://www.rarewares.org/files/others/ +DISTNAME= ${PORTNAME}-${PORTVERSION}srcs${EXTRACT_SUFFIX} + +MAINTAINER= darcsis@gmail.com +COMMENT= A program that applies ReplayGain to wave files + +LIB_DEPENDS= sndfile.1:${PORTSDIR}/audio/libsndfile + +USE_ZIP= yes +USE_GMAKE= yes +USE_DOS2UNIX= audio.c wavegain.c + +PLIST_FILES= bin/wavegain + +WRKSRC= ${WRKDIR}/WaveGain-${PORTVERSION} + +.include <bsd.port.pre.mk> + +do-configure: + @cd ${WRKSRC} && ${CP} Makefile.linux Makefile + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin + +.include <bsd.port.post.mk> diff --git a/audio/wavegain/distinfo b/audio/wavegain/distinfo new file mode 100644 index 000000000000..a7613b9b5eee --- /dev/null +++ b/audio/wavegain/distinfo @@ -0,0 +1,3 @@ +MD5 (wavegain-1.2.6srcs.zip) = 37facb462a3ec4f9831cd00f597ee85e +SHA256 (wavegain-1.2.6srcs.zip) = 32f3ea5252094c8443a54440ed5e815b044b9feeb82e6494eabbe84f95e6fc08 +SIZE (wavegain-1.2.6srcs.zip) = 160859 diff --git a/audio/wavegain/files/patch-Makefile.linux b/audio/wavegain/files/patch-Makefile.linux new file mode 100644 index 000000000000..822b14270ceb --- /dev/null +++ b/audio/wavegain/files/patch-Makefile.linux @@ -0,0 +1,9 @@ +--- Makefile.linux 2005-11-30 11:17:14.000000000 +0800 ++++ Makefile.linux 2008-05-24 22:14:34.000000000 +0800 +@@ -1,5 +1,5 @@ + all: +- gcc *.c -o wavegain -DHAVE_CONFIG_H -lm -lsndfile ++ gcc *.c -o wavegain -DHAVE_CONFIG_H -lm -lsndfile -L/usr/local/lib + + install: + install -d /usr/bin/ diff --git a/audio/wavegain/files/patch-audio.c b/audio/wavegain/files/patch-audio.c new file mode 100644 index 000000000000..c54f81ccd6cf --- /dev/null +++ b/audio/wavegain/files/patch-audio.c @@ -0,0 +1,23 @@ +--- audio.c 2005-11-27 16:55:24.000000000 +0800 ++++ audio.c 2008-05-24 22:12:15.000000000 +0800 +@@ -31,20 +31,8 @@ + #include <string.h> + #include <sys/types.h> + +-#ifdef _WIN32 +-#include <io.h> +-#else +-# ifndef __MACOSX__ +-# include <sys/io.h> +-# endif +-#endif +- + #include <fcntl.h> + +-#ifndef __MACOSX__ +-#include <malloc.h> +-#endif +- + #include <math.h> + #include "config.h" + #include "audio.h" diff --git a/audio/wavegain/files/patch-wavegain.c b/audio/wavegain/files/patch-wavegain.c new file mode 100644 index 000000000000..fdbddd058056 --- /dev/null +++ b/audio/wavegain/files/patch-wavegain.c @@ -0,0 +1,134 @@ +--- wavegain.c 2005-11-27 16:58:46.000000000 +0800 ++++ wavegain.c 2008-05-25 03:23:17.000000000 +0800 +@@ -19,20 +19,8 @@ + #include <string.h> + #include <ctype.h> + +-#ifdef _WIN32 +-#include <io.h> +-#else +-# ifndef __MACOSX__ +-# include <sys/io.h> +-# endif +-#endif +- + #include <fcntl.h> + +-#ifndef __MACOSX__ +-#include <malloc.h> +-#endif +- + #include "gain_analysis.h" + #include "i18n.h" + #include "config.h" +@@ -58,6 +46,14 @@ + #define ROUND64(x) ( doubletmp = (x) + Dither.Add + (Int64_t)0x001FFFFD80000000L, *(Int64_t*)(&doubletmp) - (Int64_t)0x433FFFFD80000000L ) + #endif + ++ ++ ++# include <errno.h> ++static int xrename(const char *oldpath, const char *newpath); ++ ++ ++ ++ + extern int write_log; + dither_t Dither; + double doubletmp; +@@ -584,16 +580,26 @@ + close_audio_file(infile, aufile, wg_opts); + fclose(infile); + +- if (!settings->std_out) { ++ if (!settings->std_out) { ++ + if (remove(filename) != 0) { + fprintf(stderr, " Error deleting old file '%s'\n", filename); + goto exit; + } +- +- if (rename(TEMP_NAME, filename) != 0) { ++ ++ /* ++ * int rename(const char *old, const char *new); ++ * In POSIX, rename will fail if the 'old' and 'new' names are on different mounted file systems. ++ * ( From http://en.wikipedia.org/wiki/Rename_%28C%29 ) ++ * Function 'xrename' from 'normalize-0.7.6' is one clever solution ++ */ ++ ++ /*if (rename(TEMP_NAME, filename) != 0) { */ ++ if (xrename(TEMP_NAME, filename) != 0) { + fprintf(stderr, " Error renaming '" TEMP_NAME "' to '%s' (uh-oh)\n", filename); + goto exit; + } ++ + } + + result = 1; +@@ -603,3 +609,65 @@ + } + + ++ ++ ++/* From normalize-0.7.6/nid3lib/write.c ++ * Move the file "oldpath" to "newpath", or copy and delete if they ++ * are on different filesystems. ++ */ ++static int ++xrename(const char *oldpath, const char *newpath) ++{ ++ FILE *in, *out; ++ char buf[4096]; ++ size_t sz; ++ ++ if (strcmp(oldpath, newpath) == 0) ++ return 0; ++ ++#ifdef __EMX__ ++ if (unlink(newpath) == -1 && errno != ENOENT) ++ return -1; ++#endif ++ ++ if (rename(oldpath, newpath) == -1) { ++ if (errno == EXDEV) { ++ /* files are on different filesystems, so we have to copy */ ++ if (unlink(newpath) == -1 && errno != ENOENT) ++ return -1; ++ ++ in = fopen(oldpath, "rb"); ++ if (in == NULL) ++ return -1; ++ out = fopen(newpath, "wb"); ++ if (out == NULL) { ++ fclose(in); ++ return -1; ++ } ++ ++ while ((sz = fread(buf, 1, 4096, in)) > 0) ++ fwrite(buf, 1, sz, out); ++ ++ if (ferror(in) || ferror(out)) { ++ fclose(in); ++ fclose(out); ++ return -1; ++ } ++ if (fclose(in) == EOF) { ++ fclose(out); ++ return -1; ++ } ++ if (fclose(out) == EOF) ++ return -1; ++ ++ if (unlink(oldpath) == -1) ++ return -1; ++ } else { ++ return -1; ++ } ++ } ++ ++ return 0; ++} ++ ++ diff --git a/audio/wavegain/pkg-descr b/audio/wavegain/pkg-descr new file mode 100644 index 000000000000..37686605317e --- /dev/null +++ b/audio/wavegain/pkg-descr @@ -0,0 +1,7 @@ +WaveGain is a program that applies ReplayGain to wave files. +The FreeBSD port of WaveGain is with a patch from gnormalize +whose author is Claudio Fernandes de Souza Rodrigues. + +The author of WaveGain is John Edwards. + +WWW: http://www.rarewares.org/others.html |