diff options
-rw-r--r-- | audio/gmodplay/Makefile | 31 | ||||
-rw-r--r-- | audio/gmodplay/files/md5 | 3 | ||||
-rwxr-xr-x | audio/gmodplay/files/mod2wav | 57 | ||||
-rw-r--r-- | audio/gmodplay/files/patch-sum | 10 | ||||
-rw-r--r-- | audio/gmodplay/patches/patch-aa | 25 | ||||
-rw-r--r-- | audio/gmodplay/patches/patch-ab | 13 | ||||
-rw-r--r-- | audio/gmodplay/patches/patch-ac | 50 | ||||
-rw-r--r-- | audio/gmodplay/patches/patch-ad | 13 | ||||
-rw-r--r-- | audio/gmodplay/patches/patch-ae | 146 | ||||
-rw-r--r-- | audio/gmodplay/patches/patch-af | 24 | ||||
-rw-r--r-- | audio/gmodplay/patches/patch-ag | 49 | ||||
-rw-r--r-- | audio/gmodplay/patches/patch-ah | 29 | ||||
-rw-r--r-- | audio/gmodplay/pkg/DESCR | 3 | ||||
-rw-r--r-- | audio/gmodplay/pkg/PLIST | 5 |
14 files changed, 458 insertions, 0 deletions
diff --git a/audio/gmodplay/Makefile b/audio/gmodplay/Makefile new file mode 100644 index 00000000000..18de03521ac --- /dev/null +++ b/audio/gmodplay/Makefile @@ -0,0 +1,31 @@ +# $NetBSD: Makefile,v 1.1.1.1 2001/03/19 19:35:51 wiz Exp $ + +DISTNAME= gmodplay-0.08 +CATEGORIES= audio +MASTER_SITES= http://magic.metawire.com/~rani/ \ + http://rani.free.fr/ + +MAINTAINER= collver@linuxfreemail.com +HOMEPAGE= http://rani.free.fr +COMMENT= MOD player for IT XM S3M MOD MTM STM FAR ULT 669 AMS DBM MDL OKT files + +DEPENDS+= libslang>=1.4.4:../../devel/libslang +DEPENDS+= glib>=1.1:../../devel/glib + +# only runs correctly on little-endian machines +ONLY_FOR_PLATFORM= *-*-alpha *-*-arc *-*-cobalt *-*-dreamcast \ + *-*-hpcmips *-*-hpcsh *-*-i386 *-*-pc532 *-*-pmax \ + *-*-vax + +USE_GMAKE= yes +# for libslang +CFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -lossaudio -lcurses + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/gmodplay ${PREFIX}/bin/gmodplay + ${INSTALL_SCRIPT} ${FILESDIR}/mod2wav ${PREFIX}/bin + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/gmodplay + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/gmodplay + +.include "../../mk/bsd.pkg.mk" diff --git a/audio/gmodplay/files/md5 b/audio/gmodplay/files/md5 new file mode 100644 index 00000000000..ebd8335ed04 --- /dev/null +++ b/audio/gmodplay/files/md5 @@ -0,0 +1,3 @@ +$NetBSD: md5,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $ + +SHA1 (gmodplay-0.08.tar.gz) = fb19c21cfd08b96e5a4ef5bb802127803260c3bd diff --git a/audio/gmodplay/files/mod2wav b/audio/gmodplay/files/mod2wav new file mode 100755 index 00000000000..9cb452568e0 --- /dev/null +++ b/audio/gmodplay/files/mod2wav @@ -0,0 +1,57 @@ +#!/bin/sh +# +# I wrote this shell script long ago to be able to master CDs from modules +# in Un*x using gmodplay. -Ben + +CMD=$(basename $0) + +if [ x = x$1 ] +then + echo " +Usage: $CMD <module> +for example \"$CMD funky.xm\" would create funky.xm.wav +" + exit +fi + +sox -V 2>&1 | grep sox >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo " +FATAL: I can't find sox in your path. Is it installed? +" + exit +fi + +WAVDIR=$(dirname $1) +WAVNAME=$(basename $1|tr 'A-Z' 'a-z').wav + +echo -e "$1 -> $WAVDIR/$WAVNAME\c" + + +echo -e " [step 1]\c" +gmodplay -n -w $1 >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo " +FATAL: gmodplay returned an error. +" + exit +fi + +echo -e " [step 2]\c" +chmod a+r output.raw +sox -t raw -r 44100 -s -w -c 2 output.raw $WAVDIR/$WAVNAME >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo " +FATAL: sox returned an error. +You may need to remove output.raw +" + exit +fi + +echo -e " [step 3]\c" +rm -f output.raw + +echo " Finished!" diff --git a/audio/gmodplay/files/patch-sum b/audio/gmodplay/files/patch-sum new file mode 100644 index 00000000000..f855dd7f409 --- /dev/null +++ b/audio/gmodplay/files/patch-sum @@ -0,0 +1,10 @@ +$NetBSD: patch-sum,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $ + +SHA1 (patch-aa) = fcf30254b109cc6b9d0cf5c54758421dca1be73b +SHA1 (patch-ab) = bb3ab618f39109d9c528770feaf1ae8516c9162f +SHA1 (patch-ac) = 9b40f06f51d509da4a03b219209c8aa7b6f5e6a7 +SHA1 (patch-ad) = 3cd04b588226e2e5f2fb2c899ca6c61297a5ccbf +SHA1 (patch-ae) = 9ecff7f878ecbcb49241d0df19291813173826e3 +SHA1 (patch-af) = 1ff33b7a6ef109e1c6505f26d2d4137ac66dcebf +SHA1 (patch-ag) = a8e1e1d54ecb17dfb8fbd438b5b7a81bf73c085b +SHA1 (patch-ah) = 44073bbefd4b48414588e15e5eb2da073b815007 diff --git a/audio/gmodplay/patches/patch-aa b/audio/gmodplay/patches/patch-aa new file mode 100644 index 00000000000..baebc7e8664 --- /dev/null +++ b/audio/gmodplay/patches/patch-aa @@ -0,0 +1,25 @@ +$NetBSD: patch-aa,v 1.1.1.1 2001/03/19 19:35:51 wiz Exp $ + +--- cmdline/cmdline.cpp.orig Sat Oct 3 04:29:20 1998 ++++ cmdline/cmdline.cpp Sun Jan 28 14:00:33 2001 +@@ -213,7 +213,7 @@ + char *modfile; + + _player = Player; +- Player->generic = new struct CmdInfo; ++ Player->generic = new CmdInfo; + CMD_INFO(Player)->first_visible_instrument = 0; + CMD_INFO(Player)->last_visible_instrument = 0; + +@@ -415,9 +415,11 @@ + Player->repeat = !Player->repeat; + goto update_info; + case '+': ++ case 'e': + volume = VolumeCtrl(2, 2, &Player->mixer); + goto update_info; + case '-': ++ case 'w': + volume = VolumeCtrl(-2, -2, &Player->mixer); + goto update_info; + case '<': diff --git a/audio/gmodplay/patches/patch-ab b/audio/gmodplay/patches/patch-ab new file mode 100644 index 00000000000..d09b142ba1a --- /dev/null +++ b/audio/gmodplay/patches/patch-ab @@ -0,0 +1,13 @@ +$NetBSD: patch-ab,v 1.1.1.1 2001/03/19 19:35:51 wiz Exp $ + +--- cmdline/cmdline.h.orig Sun Jan 28 10:58:04 2001 ++++ cmdline/cmdline.h Sun Jan 28 10:58:23 2001 +@@ -26,7 +26,7 @@ + #define _LINE_SPECTRO_BANDS_ (_LINE_SPECTRO_MIN_ + 1) + #define _LINE_INSTRUMENTS_ (_LINE_SPECTRO_BANDS_ + 1) + +-#define CMD_INFO(playerinfo) ((struct CmdInfo*) playerinfo->generic) ++#define CMD_INFO(playerinfo) ((CmdInfo*) playerinfo->generic) + typedef struct { + int first_visible_instrument; + int last_visible_instrument; diff --git a/audio/gmodplay/patches/patch-ac b/audio/gmodplay/patches/patch-ac new file mode 100644 index 00000000000..3076444f8b6 --- /dev/null +++ b/audio/gmodplay/patches/patch-ac @@ -0,0 +1,50 @@ +$NetBSD: patch-ac,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $ + +--- common/devices.cpp.orig Mon Sep 28 14:59:27 1998 ++++ common/devices.cpp Sun Jan 28 14:22:54 2001 +@@ -14,7 +14,7 @@ + #include <fcntl.h> + #include <stdio.h> + #include <sys/ioctl.h> +-#include <sys/soundcard.h> ++#include <soundcard.h> + + #include "modplay.h" + +@@ -24,13 +24,26 @@ + int val; + + //DSP->fd = open(AUDIO_DEV, O_WRONLY|O_NONBLOCK); +- DSP->fd = open(DSP->name?DSP->name:AUDIO_DEV, O_WRONLY); ++ //DSP->fd = open(DSP->name?DSP->name:AUDIO_DEV, O_WRONLY); ++ if (DSP->rawdump) { ++ DSP->fd = open(DSP->name, O_WRONLY|O_CREAT); ++ } else { ++ DSP->fd = open(DSP->name?DSP->name:AUDIO_DEV, O_WRONLY); ++ } ++ + if (DSP->fd == -1) { + return -1; + } + + val = SND_FORMAT; + dsp_format: ++ if (DSP->rawdump) { ++ DSP->snd_format = SND_FORMAT; ++ DSP->bits_per_sample = 16; ++ DSP->stereo_support = 1; ++ DSP->sample_rate = DEFAULT_RATE; ++ return 0; ++ } + if (ioctl(DSP->fd, SNDCTL_DSP_SETFMT, &val) == -1) { + perror("ioctl SNDCTL_DSP_SETFMT failed"); + exit(-1); +@@ -76,7 +89,7 @@ + } + DSP->sample_rate = val; + +- ioctl(DSP->fd, SNDCTL_DSP_RESET); ++ ioctl(DSP->fd, SNDCTL_DSP_RESET, NULL); + return 0; + } + diff --git a/audio/gmodplay/patches/patch-ad b/audio/gmodplay/patches/patch-ad new file mode 100644 index 00000000000..99191745661 --- /dev/null +++ b/audio/gmodplay/patches/patch-ad @@ -0,0 +1,13 @@ +$NetBSD: patch-ad,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $ + +--- common/modfile.cpp.orig Sun Jan 28 11:06:47 2001 ++++ common/modfile.cpp Sun Jan 28 11:07:29 2001 +@@ -79,7 +79,7 @@ + return -1; + } + +- Mod->ptr = mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, Mod->fd, 0); ++ Mod->ptr = (char *)mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, Mod->fd, 0); + if ((int) *Mod->ptr == -1) { + Mod->ptr = NULL; + close(Mod->fd); diff --git a/audio/gmodplay/patches/patch-ae b/audio/gmodplay/patches/patch-ae new file mode 100644 index 00000000000..8f2da2780da --- /dev/null +++ b/audio/gmodplay/patches/patch-ae @@ -0,0 +1,146 @@ +$NetBSD: patch-ae,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $ + +--- common/modplay.cpp.orig Mon Oct 5 01:29:52 1998 ++++ common/modplay.cpp Sun Jan 28 14:01:34 2001 +@@ -14,8 +14,9 @@ + #include <fcntl.h> + #include <math.h> + #include <sys/ioctl.h> +-#include <sys/soundcard.h> ++#include <soundcard.h> + #include <string.h> ++#include <libgen.h> + + #include "stdafx.h" + #include "sndfile.h" +@@ -88,9 +89,9 @@ + } + else { + int val = Player->stereo?1:0; +- ioctl(Player->dsp.fd, SNDCTL_DSP_POST); ++ ioctl(Player->dsp.fd, SNDCTL_DSP_POST, NULL); + ioctl(Player->dsp.fd, SNDCTL_DSP_STEREO, &val); +- ioctl(Player->dsp.fd, SNDCTL_DSP_RESET); ++ ioctl(Player->dsp.fd, SNDCTL_DSP_RESET, NULL); + } + + bufsize = (TIMELEN * Player->dsp.sample_rate) / 1000; +@@ -127,8 +128,8 @@ + Player->paused = true; + /* FIXME: Useless when doing a close(dsp)?? + if (!Player->stopped) { +- ioctl(Player->dsp.fd, SNDCTL_DSP_SYNC); +- ioctl(Player->dsp.fd, SNDCTL_DSP_RESET); ++ ioctl(Player->dsp.fd, SNDCTL_DSP_SYNC, NULL); ++ ioctl(Player->dsp.fd, SNDCTL_DSP_RESET, NULL); + } + */ + if (Player->buffer) { +@@ -143,8 +144,8 @@ + { + if (Player->stopped) + return 0; +- ioctl(Player->dsp.fd, SNDCTL_DSP_SYNC); +- ioctl(Player->dsp.fd, SNDCTL_DSP_RESET); ++ ioctl(Player->dsp.fd, SNDCTL_DSP_SYNC, NULL); ++ ioctl(Player->dsp.fd, SNDCTL_DSP_RESET, NULL); + if (Player->buffer) { + delete Player->buffer; + Player->buffer = NULL; +@@ -330,6 +331,14 @@ + printf(" -n, --nospectrum don't display spectrum\n"); + printf(" -x disable X11 interface\n"); + printf(" -v, --version output version information and exit\n"); ++ printf(" -s, --surround surround sound on\n"); ++ printf(" -o, --oversamp oversampling on\n"); ++ printf(" -r, --reverb reverb on\n"); ++ printf(" -b, --megabass megabass on\n"); ++ printf(" -g, --volramp gain control on\n"); ++ printf(" -f, --filter noise reduction on\n"); ++ printf(" -w, --rawdump dump to output.raw\n"); ++ + } + + void +@@ -370,11 +379,55 @@ + Player->updatespectro = false; + continue; + } ++ if (strcmp(Args[i], "-s") == 0 || ++ strcmp(Args[i], "--surround") == 0) ++ { ++ Player->surround = true; ++ continue; ++ } ++ if (strcmp(Args[i], "-o") == 0 || ++ strcmp(Args[i], "--oversamp") == 0) ++ { ++ Player->oversamp = true; ++ continue; ++ } ++ if (strcmp(Args[i], "-r") == 0 || ++ strcmp(Args[i], "--reverb") == 0) ++ { ++ Player->reverb = true; ++ continue; ++ } ++ if (strcmp(Args[i], "-b") == 0 || ++ strcmp(Args[i], "--megabass") == 0) ++ { ++ Player->megabass = true; ++ continue; ++ } ++ if (strcmp(Args[i], "-g") == 0 || ++ strcmp(Args[i], "--gain") == 0) ++ { ++ Player->nr = true; ++ continue; ++ } ++ if (strcmp(Args[i], "-f") == 0 || ++ strcmp(Args[i], "--filter") == 0) ++ { ++ Player->volramp = true; ++ continue; ++ } + if (strcmp(Args[i], "-d") == 0 || strcmp(Args[i], "--device") == 0) { + /* FIXME: Test if Args[i+1] starts with - */ + Player->dsp.name = Args[1+i++]; + continue; + } ++ if (strcmp(Args[i], "-w") == 0 || ++ strcmp(Args[i], "--rawdump") == 0) ++ { ++ Player->dsp.rawdump = true; ++ Player->dsp.name = (char *)malloc(11); ++ strcpy(Player->dsp.name, "output.raw"); ++ continue; ++ } + if (strcmp(Args[i], "--") == 0) { + more_params = false; + continue; +@@ -413,18 +466,19 @@ + + Player->dsp.name = NULL; + Player->dsp.fd = -1; ++ Player->dsp.rawdump = false; + + Player->stereo = true; + Player->updatespectro = true; + Player->repeat = false; + Player->paused = false; + Player->stopped = true; +- Player->surround = true; +- Player->oversamp = true; +- Player->reverb = true; +- Player->megabass = true; +- Player->nr = false; +- Player->volramp = true; ++ Player->surround = false; ++ Player->oversamp = false; ++ Player->reverb = false; ++ Player->megabass = false; ++ Player->nr = true; ++ Player->volramp = false; + + + if ((Player->playlist = CreatePlayList("default")) == NULL) { diff --git a/audio/gmodplay/patches/patch-af b/audio/gmodplay/patches/patch-af new file mode 100644 index 00000000000..2ab237669b6 --- /dev/null +++ b/audio/gmodplay/patches/patch-af @@ -0,0 +1,24 @@ +$NetBSD: patch-af,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $ + +--- common/modplay.h.orig Sun Jan 28 11:21:12 2001 ++++ common/modplay.h Sun Jan 28 11:21:56 2001 +@@ -12,8 +12,9 @@ + #define MODPLAY_H + + #include <sys/types.h> ++#include <glib.h> + +-#define AUDIO_DEV "/dev/dsp" ++#define AUDIO_DEV "/dev/audio" + #define MIXER_DEV "/dev/mixer" + + #define MIXER_CHANNEL SOUND_MIXER_PCM +@@ -39,7 +40,7 @@ + int bits_per_sample; + int sample_rate; + bool stereo_support; +- ++ bool rawdump; + } DSPInfo; + + typedef struct { diff --git a/audio/gmodplay/patches/patch-ag b/audio/gmodplay/patches/patch-ag new file mode 100644 index 00000000000..493e3ebd80f --- /dev/null +++ b/audio/gmodplay/patches/patch-ag @@ -0,0 +1,49 @@ +$NetBSD: patch-ag,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $ + +--- common/playlist.cpp.orig Sun Jan 28 11:22:24 2001 ++++ common/playlist.cpp Sun Jan 28 11:26:25 2001 +@@ -13,7 +13,7 @@ + + #include "playlist.h" + +-gint CompareNames(gconstpointer a, gconstpointer b); ++gint CompareNames(const gpointer a, const gpointer b); + + PlayList * + CreatePlayList(char *Name) +@@ -56,7 +56,7 @@ + int i = 1; + char *item; + +- while ((item = g_list_nth_data(List->modfiles, i++)) != NULL) { ++ while ((item = (char *)g_list_nth_data(List->modfiles, i++)) != NULL) { + delete item; + } + g_list_free(List->modfiles); +@@ -80,8 +80,8 @@ + int + RemoveModFile(char *ModFile, PlayList * List) + { +- char *name = (char *) g_list_find_custom(List->modfiles, (gpointer) ModFile, +- CompareNames); ++ char *name = new char[strlen(ModFile) + 1]; ++ strcpy(name, ModFile); + + if (name == NULL) + return -1; +@@ -151,13 +151,12 @@ + bool + IsOnList(char *ModFile, PlayList * List) + { +- char *name = (char *) g_list_find_custom(List->modfiles, (gpointer) ModFile, +- CompareNames); ++ char *name = (char *) g_list_find(List->modfiles, (gpointer) ModFile); + return (name == NULL) ? false : true; + } + + gint +-CompareNames(gconstpointer a, gconstpointer b) ++CompareNames(const gpointer a, const gpointer b) + { + if (strcmp((const char *) a, (const char *) b) == 0) + return true; diff --git a/audio/gmodplay/patches/patch-ah b/audio/gmodplay/patches/patch-ah new file mode 100644 index 00000000000..6cf6e1fd9b7 --- /dev/null +++ b/audio/gmodplay/patches/patch-ah @@ -0,0 +1,29 @@ +$NetBSD: patch-ah,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $ + +--- Makefile.orig Mon Oct 5 01:36:12 1998 ++++ Makefile Sun Jan 28 14:17:57 2001 +@@ -24,13 +24,13 @@ + TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) + # TOPDIR := $(CURDIR) + +-CFLAGS = -O1 -D__GMODVER__=\"$(VERSION)\" -pipe \ +- -I $(TOPDIR)/include `glib-config --cflags` ++CFLAGS += -D__GMODVER__=\"$(VERSION)\" -pipe \ ++ -I$(TOPDIR)/include `glib-config --cflags` + + #CFLAGS = -O2 -D__GMODVER__=\"$(VERSION)\" -pipe -march=pentiumpro \ + # -I $(TOPDIR)/include `glib-config --cflags` + +-LDFLAGS = -lstdc++ `glib-config --libs` ++LDFLAGS += -lstdc++ `glib-config --libs` + SUBDIRS = sndlib common + + ifndef DEBUG +@@ -71,6 +71,7 @@ + + all: gmodplay + ++install: + + gmodplay: $(SUBDIRS) + $(CC) -o $@ $(ALLOBJECTS) $(LDFLAGS) diff --git a/audio/gmodplay/pkg/DESCR b/audio/gmodplay/pkg/DESCR new file mode 100644 index 00000000000..1ec5c8b6c64 --- /dev/null +++ b/audio/gmodplay/pkg/DESCR @@ -0,0 +1,3 @@ +Gmodplay is a MOD player based on the modplug source code. +It understands IT, XM, S3M, MOD, MTM, STM, FAR, ULT, 669, AMS, DBM, MDL, +and OKT module formats. diff --git a/audio/gmodplay/pkg/PLIST b/audio/gmodplay/pkg/PLIST new file mode 100644 index 00000000000..fc2535cb445 --- /dev/null +++ b/audio/gmodplay/pkg/PLIST @@ -0,0 +1,5 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2001/03/19 19:35:51 wiz Exp $ +bin/gmodplay +bin/mod2wav +share/doc/gmodplay/README +@dirrm share/doc/gmodplay |