Import audio/vgmplay, a command line audio player for VGM files.
ok kn@ VGMPlay is a command line audio player for all VGM files. Supported files types are: * Video Game Music Files (*.vgm, *.vgz) * Creative Music Files (*.cmf) * DosBox RAW OPL Log Files (*.dro) * Playlist files (*.m3u)
This commit is contained in:
parent
9d1321db25
commit
2c89d235b0
27
audio/vgmplay/Makefile
Normal file
27
audio/vgmplay/Makefile
Normal file
@ -0,0 +1,27 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2018/07/29 03:56:14 bcallah Exp $
|
||||
|
||||
COMMENT = command line audio player for VGM files
|
||||
CATEGORIES = audio
|
||||
|
||||
GH_ACCOUNT = vgmrips
|
||||
GH_PROJECT = vgmplay
|
||||
GH_TAGNAME = 0.40.8
|
||||
|
||||
HOMEPAGE = https://vgmrips.net/
|
||||
MAINTAINER = Brian Callahan <bcallah@openbsd.org>
|
||||
|
||||
# GPLv2 only
|
||||
PERMIT_PACKAGE_CDROM = Yes
|
||||
|
||||
WANTLIB += ao c m pthread z
|
||||
|
||||
LIB_DEPENDS = audio/libao
|
||||
|
||||
USE_GMAKE = Yes
|
||||
MAKE_FLAGS = CC="${CC}"
|
||||
|
||||
NO_TEST = Yes
|
||||
|
||||
WRKSRC = ${WRKDIST}/VGMPlay
|
||||
|
||||
.include <bsd.port.mk>
|
2
audio/vgmplay/distinfo
Normal file
2
audio/vgmplay/distinfo
Normal file
@ -0,0 +1,2 @@
|
||||
SHA256 (vgmplay-0.40.8.tar.gz) = NxPI02IC2UTiOYjjnJ0J8634fvQYbFFAhBt9v0Gds3g=
|
||||
SIZE (vgmplay-0.40.8.tar.gz) = 866933
|
91
audio/vgmplay/patches/patch-VGMPlay_Makefile
Normal file
91
audio/vgmplay/patches/patch-VGMPlay_Makefile
Normal file
@ -0,0 +1,91 @@
|
||||
$OpenBSD: patch-VGMPlay_Makefile,v 1.1.1.1 2018/07/29 03:56:14 bcallah Exp $
|
||||
|
||||
Remove hardcoded -O3
|
||||
Fix up include dirs and libs
|
||||
Print compiling lines
|
||||
Fix manual page install
|
||||
Use endian-safe code on all archs
|
||||
|
||||
Index: VGMPlay/Makefile
|
||||
--- VGMPlay/Makefile.orig
|
||||
+++ VGMPlay/Makefile
|
||||
@@ -31,7 +31,7 @@ USE_LIBAO = 1
|
||||
# 0 = undefined (use endian-safe code, might be slightly slower)
|
||||
# 1 = Little Endian (Intel)
|
||||
# 2 = Big Endian (Motorola)
|
||||
-BYTE_ORDER = 1
|
||||
+BYTE_ORDER = 0
|
||||
|
||||
|
||||
ifdef MACOSX
|
||||
@@ -43,7 +43,7 @@ endif
|
||||
|
||||
CC = gcc
|
||||
PREFIX = /usr/local
|
||||
-MANPREFIX = $(PREFIX)/share/man
|
||||
+MANPREFIX = $(PREFIX)/man
|
||||
|
||||
# -- VGMPlay specific Compile Flags --
|
||||
MAINFLAGS := -DCONSOLE_MODE -DADDITIONAL_FORMATS -DSET_CONSOLE_TITLE
|
||||
@@ -84,12 +84,12 @@ endif
|
||||
ifdef DEBUG
|
||||
CFLAGS := -g $(CFLAGS)
|
||||
else
|
||||
-CFLAGS := -O3 -g0 $(CFLAGS)
|
||||
+CFLAGS := $(CFLAGS) -I${LOCALBASE}/include
|
||||
endif
|
||||
#CFLAGS += -Wall
|
||||
-CFLAGS += -Wno-unused-variable -Wno-unused-value -Wno-unused-but-set-variable
|
||||
+CFLAGS += -Wno-unused-variable -Wno-unused-value
|
||||
# libm (math library) and libz (zlib)
|
||||
-LDFLAGS := -lm -lz $(LDFLAGS)
|
||||
+LDFLAGS := -lm -lz $(LDFLAGS) -L${LOCALBASE}/lib
|
||||
|
||||
ifdef WINDOWS
|
||||
# for Windows, add kernel32 and winmm (Multimedia APIs)
|
||||
@@ -102,7 +102,7 @@ ifdef MACOSX
|
||||
#CFLAGS += -I/some/path
|
||||
else
|
||||
# for Linux, add librt (clock stuff) and libpthread (threads)
|
||||
-LDFLAGS += -lrt -lpthread -pthread
|
||||
+LDFLAGS += -lpthread -pthread
|
||||
endif
|
||||
MAINFLAGS += -pthread -DSHARE_PREFIX=\"$(PREFIX)\"
|
||||
|
||||
@@ -216,31 +216,23 @@ EXTRA_OBJS = $(VGMPLAY_OBJS) $(VGM2PCM_OBJS) $(VGM2WAV
|
||||
all: vgmplay vgm2pcm vgm2wav
|
||||
|
||||
vgmplay: $(EMUOBJS) $(MAINOBJS) $(VGMPLAY_OBJS)
|
||||
- @echo Linking vgmplay ...
|
||||
- @$(CC) $(VGMPLAY_OBJS) $(MAINOBJS) $(EMUOBJS) $(LDFLAGS) -o vgmplay
|
||||
- @echo Done.
|
||||
+ $(CC) $(VGMPLAY_OBJS) $(MAINOBJS) $(EMUOBJS) $(LDFLAGS) -o vgmplay
|
||||
|
||||
vgm2pcm: $(EMUOBJS) $(MAINOBJS) $(VGM2PCM_OBJS)
|
||||
- @echo Linking vgm2pcm ...
|
||||
- @$(CC) $(VGM2PCM_OBJS) $(MAINOBJS) $(EMUOBJS) $(LDFLAGS) -o vgm2pcm
|
||||
- @echo Done.
|
||||
+ $(CC) $(VGM2PCM_OBJS) $(MAINOBJS) $(EMUOBJS) $(LDFLAGS) -o vgm2pcm
|
||||
|
||||
vgm2wav: $(EMUOBJS) $(MAINOBJS) $(VGM2WAV_OBJS)
|
||||
- @echo Linking vgm2wav ...
|
||||
- @$(CC) $(VGM2WAV_OBJS) $(MAINOBJS) $(EMUOBJS) $(LDFLAGS) -o vgm2wav
|
||||
- @echo Done.
|
||||
+ $(CC) $(VGM2WAV_OBJS) $(MAINOBJS) $(EMUOBJS) $(LDFLAGS) -o vgm2wav
|
||||
|
||||
# compile the chip-emulator c-files
|
||||
$(EMUOBJ)/%.o: $(EMUSRC)/%.c
|
||||
- @echo Compiling $< ...
|
||||
@mkdir -p $(@D)
|
||||
- @$(CC) $(CFLAGS) $(EMUFLAGS) -c $< -o $@
|
||||
+ $(CC) $(CFLAGS) $(EMUFLAGS) -c $< -o $@
|
||||
|
||||
# compile the main c-files
|
||||
$(OBJ)/%.o: $(SRC)/%.c
|
||||
- @echo Compiling $< ...
|
||||
@mkdir -p $(@D)
|
||||
- @$(CC) $(CFLAGS) $(MAINFLAGS) -c $< -o $@
|
||||
+ $(CC) $(CFLAGS) $(MAINFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
@echo Deleting object files ...
|
16
audio/vgmplay/patches/patch-VGMPlay_Stream_c
Normal file
16
audio/vgmplay/patches/patch-VGMPlay_Stream_c
Normal file
@ -0,0 +1,16 @@
|
||||
$OpenBSD: patch-VGMPlay_Stream_c,v 1.1.1.1 2018/07/29 03:56:14 bcallah Exp $
|
||||
|
||||
OpenBSD support; we always use libao.
|
||||
|
||||
Index: VGMPlay/Stream.c
|
||||
--- VGMPlay/Stream.c.orig
|
||||
+++ VGMPlay/Stream.c
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <fcntl.h>
|
||||
#ifdef __NetBSD__
|
||||
#include <sys/audioio.h>
|
||||
-#elif defined(__APPLE__)
|
||||
+#elif defined(__APPLE__) || defined(__OpenBSD__)
|
||||
// nothing
|
||||
#else
|
||||
#include <linux/soundcard.h>
|
22
audio/vgmplay/patches/patch-VGMPlay_VGMPlayUI_c
Normal file
22
audio/vgmplay/patches/patch-VGMPlay_VGMPlayUI_c
Normal file
@ -0,0 +1,22 @@
|
||||
$OpenBSD: patch-VGMPlay_VGMPlayUI_c,v 1.1.1.1 2018/07/29 03:56:14 bcallah Exp $
|
||||
|
||||
Fix formatting
|
||||
|
||||
Index: VGMPlay/VGMPlayUI.c
|
||||
--- VGMPlay/VGMPlayUI.c.orig
|
||||
+++ VGMPlay/VGMPlayUI.c
|
||||
@@ -2246,11 +2246,11 @@ static void PlayVGM_UI(void)
|
||||
if (Show95Cmds && Last95Max != 0xFFFF)
|
||||
{
|
||||
if (Show95Cmds == 0x01)
|
||||
- printf(" %02hX / %02hX", 1 + Last95Drum, Last95Max);
|
||||
+ printf(" %02X / %02hX", 1 + Last95Drum, Last95Max);
|
||||
else if (Show95Cmds == 0x02)
|
||||
- printf(" %02hX / %02hX at %5u Hz", 1 + Last95Drum, Last95Max, Last95Freq);
|
||||
+ printf(" %02X / %02hX at %5u Hz", 1 + Last95Drum, Last95Max, Last95Freq);
|
||||
else if (Show95Cmds == 0x03)
|
||||
- printf(" %02hX / %02hX at %4.1f KHz", 1 + Last95Drum, Last95Max,
|
||||
+ printf(" %02X / %02hX at %4.1f KHz", 1 + Last95Drum, Last95Max,
|
||||
Last95Freq / 1000.0);
|
||||
}
|
||||
//printf(" %u / %u", multipcm_get_channels(0, NULL), 28);
|
16
audio/vgmplay/patches/patch-VGMPlay_VGMPlay_c
Normal file
16
audio/vgmplay/patches/patch-VGMPlay_VGMPlay_c
Normal file
@ -0,0 +1,16 @@
|
||||
$OpenBSD: patch-VGMPlay_VGMPlay_c,v 1.1.1.1 2018/07/29 03:56:14 bcallah Exp $
|
||||
|
||||
Fix formatting
|
||||
|
||||
Index: VGMPlay/VGMPlay.c
|
||||
--- VGMPlay/VGMPlay.c.orig
|
||||
+++ VGMPlay/VGMPlay.c
|
||||
@@ -5635,7 +5635,7 @@ static void InterpretVGM(UINT32 SampleCount)
|
||||
#ifdef CONSOLE_MODE
|
||||
if (! CmdList[Command])
|
||||
{
|
||||
- printf("Unknown command: %02hX\n", Command);
|
||||
+ printf("Unknown command: %02hhX\n", Command);
|
||||
CmdList[Command] = true;
|
||||
}
|
||||
#endif
|
15
audio/vgmplay/patches/patch-VGMPlay_chips_mamedef_h
Normal file
15
audio/vgmplay/patches/patch-VGMPlay_chips_mamedef_h
Normal file
@ -0,0 +1,15 @@
|
||||
$OpenBSD: patch-VGMPlay_chips_mamedef_h,v 1.1.1.1 2018/07/29 03:56:14 bcallah Exp $
|
||||
|
||||
Already have M_PI in math.h
|
||||
|
||||
Index: VGMPlay/chips/mamedef.h
|
||||
--- VGMPlay/chips/mamedef.h.orig
|
||||
+++ VGMPlay/chips/mamedef.h
|
||||
@@ -49,7 +49,6 @@ typedef INT32 stream_sample_t;
|
||||
#else
|
||||
#define INLINE static inline
|
||||
#endif
|
||||
-#define M_PI 3.14159265358979323846
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define logerror printf
|
16
audio/vgmplay/patches/patch-VGMPlay_vgm2pcm_c
Normal file
16
audio/vgmplay/patches/patch-VGMPlay_vgm2pcm_c
Normal file
@ -0,0 +1,16 @@
|
||||
$OpenBSD: patch-VGMPlay_vgm2pcm_c,v 1.1.1.1 2018/07/29 03:56:14 bcallah Exp $
|
||||
|
||||
Fix formatting
|
||||
|
||||
Index: VGMPlay/vgm2pcm.c
|
||||
--- VGMPlay/vgm2pcm.c.orig
|
||||
+++ VGMPlay/vgm2pcm.c
|
||||
@@ -58,7 +58,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
sampleBuffer = (WAVE_16BS*)malloc(SAMPLESIZE * SampleRate);
|
||||
if (sampleBuffer == NULL) {
|
||||
- fprintf(stderr, "vgm2pcm: error: failed to allocate %u bytes of memory\n", SAMPLESIZE * SampleRate);
|
||||
+ fprintf(stderr, "vgm2pcm: error: failed to allocate %lu bytes of memory\n", SAMPLESIZE * SampleRate);
|
||||
return 1;
|
||||
}
|
||||
|
16
audio/vgmplay/patches/patch-VGMPlay_vgm2wav_c
Normal file
16
audio/vgmplay/patches/patch-VGMPlay_vgm2wav_c
Normal file
@ -0,0 +1,16 @@
|
||||
$OpenBSD: patch-VGMPlay_vgm2wav_c,v 1.1.1.1 2018/07/29 03:56:14 bcallah Exp $
|
||||
|
||||
Fix formatting.
|
||||
|
||||
Index: VGMPlay/vgm2wav.c
|
||||
--- VGMPlay/vgm2wav.c.orig
|
||||
+++ VGMPlay/vgm2wav.c
|
||||
@@ -227,7 +227,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
sampleBuffer = (WAVE_16BS*)malloc(SAMPLESIZE * SampleRate);
|
||||
if (sampleBuffer == NULL) {
|
||||
- fprintf(stderr, "vgm2wav: error: failed to allocate %u bytes of memory\n", SAMPLESIZE * SampleRate);
|
||||
+ fprintf(stderr, "vgm2wav: error: failed to allocate %lu bytes of memory\n", SAMPLESIZE * SampleRate);
|
||||
return 1;
|
||||
}
|
||||
|
7
audio/vgmplay/pkg/DESCR
Normal file
7
audio/vgmplay/pkg/DESCR
Normal file
@ -0,0 +1,7 @@
|
||||
VGMPlay is a command line audio player for all VGM files.
|
||||
|
||||
Supported files types are:
|
||||
* Video Game Music Files (*.vgm, *.vgz)
|
||||
* Creative Music Files (*.cmf)
|
||||
* DosBox RAW OPL Log Files (*.dro)
|
||||
* Playlist files (*.m3u)
|
5
audio/vgmplay/pkg/PLIST
Normal file
5
audio/vgmplay/pkg/PLIST
Normal file
@ -0,0 +1,5 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2018/07/29 03:56:14 bcallah Exp $
|
||||
@bin bin/vgmplay
|
||||
@man man/man1/vgmplay.1
|
||||
share/vgmplay/
|
||||
share/vgmplay/vgmplay.ini
|
Loading…
x
Reference in New Issue
Block a user