xwax: Add more patches and usage instructions.

This commit is contained in:
nia 2019-10-16 18:40:55 +01:00
parent 1766746c2f
commit f4e788b567
5 changed files with 107 additions and 0 deletions

11
xwax/MESSAGE Normal file
View File

@ -0,0 +1,11 @@
===========================================================================
$NetBSD: MESSAGE.NetBSD,v 1.1 2019/06/10 12:41:23 nia Exp $
Install mpg123 for MP3 support.
For other formats, install ffmpeg.
On NetBSD, to connect to the default audio device, run
xwax -d /dev/audio -l /path/to/library
===========================================================================

15
xwax/patches/patch-import Normal file
View File

@ -0,0 +1,15 @@
$NetBSD$
Support pkgsrc's weird names for ffmpeg.
--- import.orig 2018-01-19 20:40:49.000000000 +0000
+++ import
@@ -28,7 +28,7 @@ case "$FILE" in
*)
echo "Calling fallback decoder..." >&2
- FFMPEG=$(which ffmpeg 2> /dev/null || which avconv 2> /dev/null)
+ FFMPEG=$(ls -1 @PREFIX@/bin | grep '^ffmpeg[0-9]*$' | tail -1)
if [ -z "$FFMPEG" ]; then
echo "$0: no ffmpeg or avconv available to decode file" >&2

View File

@ -0,0 +1,23 @@
$NetBSD$
"sched_setscheduler: Operation not permitted"
--- realtime.c.orig 2018-01-19 20:40:49.000000000 +0000
+++ realtime.c
@@ -38,6 +38,7 @@
static int raise_priority(int priority)
{
+#ifndef __NetBSD__
int max_pri;
struct sched_param sp;
@@ -60,7 +61,7 @@ static int raise_priority(int priority)
fprintf(stderr, "Failed to get realtime priorities\n");
return -1;
}
-
+#endif
return 0;
}

39
xwax/patches/patch-scan Normal file
View File

@ -0,0 +1,39 @@
$NetBSD$
Make usage of find portable.
--- scan.orig 2018-01-19 20:40:49.000000000 +0000
+++ scan
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/pkg/bin/bash
#
# Take a pathname as an argument and output a playlist to standard
# output and errors to standard error.
@@ -15,15 +15,14 @@ set -eu -o pipefail # pipefail requires
PATHNAME="$1"
if [ -d "$PATHNAME" ]; then
- find -L "$PATHNAME" -type f -regextype posix-egrep \
- -iregex '.*\.(ogg|oga|aac|cdaudio|mp3|flac|wav|aif|aiff|m4a|wma)'
+ find -L "$PATHNAME" -type f | grep -Ei '.*\.(ogg|oga|aac|cdaudio|mp3|flac|wav|aif|aiff|m4a|wma)'
else
cat "$PATHNAME"
fi |
# Parse artist and title information from matching filenames
-sed -n '
+gsed -n '
{
# /[<ABnum>[.]] <artist> - <title>.ext
s:/\([A-H]\?[A0-9]\?[0-9].\? \+\)\?\([^/]*\) \+- \+\([^/]*\)\.[A-Z0-9]*$:\0\t\2\t\3:pi
@@ -39,7 +38,7 @@ s:/\([A-H]\?[A0-9]\?[0-9].\? \+\)\?\([^/
# Extract BPM metadata from title (eg. "Ghostbusters (115.6 BPM)")
-sed '
+gsed '
{
# BPM
s:\(.*\) *(\([0-9]\+\.\?[0-9]\+\) *BPM)$:\1\t\2:

19
xwax/patches/patch-xwax.c Normal file
View File

@ -0,0 +1,19 @@
$NetBSD$
"Invalid scheduling priority (maximum 63)."
--- xwax.c.orig 2018-01-19 20:40:49.000000000 +0000
+++ xwax.c
@@ -49,7 +49,12 @@
#define DEFAULT_ALSA_BUFFER 8 /* milliseconds */
#define DEFAULT_RATE 44100
+
+#ifdef __NetBSD__
+#define DEFAULT_PRIORITY 63
+#else
#define DEFAULT_PRIORITY 80
+#endif
#define DEFAULT_IMPORTER EXECDIR "/xwax-import"
#define DEFAULT_SCANNER EXECDIR "/xwax-scan"