git: b087fefc9c39 - main - audio/rawrec: Fix port issues
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 03 Mar 2024 23:33:56 UTC
The branch main has been updated by leres:
URL: https://cgit.FreeBSD.org/ports/commit/?id=b087fefc9c39b26ff17dbb06d8ae75e9d80f096d
commit b087fefc9c39b26ff17dbb06d8ae75e9d80f096d
Author: Craig Leres <leres@FreeBSD.org>
AuthorDate: 2024-03-03 23:33:26 +0000
Commit: Craig Leres <leres@FreeBSD.org>
CommitDate: 2024-03-03 23:33:26 +0000
audio/rawrec: Fix port issues
- Makefile WWW link bad - fix it
- Clean portlint nit
- Change patches to avoid REINPLACE_CMD
- Initialize sigaction structures better
- Remove commenting out of pthread_attr_scope stuff since FreeBSD
supports that now
Should be no functional change
PR: 277461
Approved by: antonfb@hesiod.org (maintainer)
---
audio/rawrec/Makefile | 22 +++++++------
audio/rawrec/files/patch-audio__init.c | 11 +++++++
audio/rawrec/files/patch-get__au__blksz.c | 11 +++++++
audio/rawrec/files/patch-get__format__code.c | 11 +++++++
audio/rawrec/files/patch-main.c | 20 +++---------
audio/rawrec/files/patch-play.c | 49 ----------------------------
audio/rawrec/files/patch-record.c | 47 --------------------------
audio/rawrec/files/patch-set__au__blksz.c | 11 +++++++
audio/rawrec/files/patch-sleep__on__option.c | 11 -------
audio/rawrec/files/patch-test__dsp__params.c | 11 +++++++
10 files changed, 71 insertions(+), 133 deletions(-)
diff --git a/audio/rawrec/Makefile b/audio/rawrec/Makefile
index 1dc4b2fcf7dd..cbdd4b870d2b 100644
--- a/audio/rawrec/Makefile
+++ b/audio/rawrec/Makefile
@@ -1,33 +1,35 @@
PORTNAME= rawrec
PORTVERSION= 0.9.991
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= audio
MASTER_SITES= SUNSITE/apps/sound/recorders \
SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
MAINTAINER= antonfb@hesiod.org
COMMENT= Utility to record and playback raw audio data
-WWW= http://rawrec.sourceforge.net/
+WWW= https://sourceforge.net/projects/rawrec/
LICENSE= GPLv2+
LICENSE_FILE= ${WRKDIR}/${DISTNAME}/copyright
+USES= gmake
+
WRKSRC= ${WRKDIR}/${DISTNAME}/src
-USES= gmake
-MAKE_ARGS= CC="${CC}" CFLAGS="${CPPFLAGS} ${CFLAGS}" \
+MAKE_ARGS= CC="${CC}" \
+ CFLAGS="${CPPFLAGS} ${CFLAGS}" \
LDFLAGS="${LDFLAGS} -lm -lpthread"
-PLIST_FILES= bin/rawplay bin/rawrec share/man/man1/rawplay.1.gz share/man/man1/rawrec.1.gz
-
-post-patch:
- @${FIND} ${WRKSRC} -name '*.[ch]' | ${XARGS} ${REINPLACE_CMD} -e \
- 's|<linux/soundcard.h>|<sys/soundcard.h>|g'
+PLIST_FILES= bin/rawplay \
+ bin/rawrec \
+ share/man/man1/rawplay.1.gz \
+ share/man/man1/rawrec.1.gz
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/rawrec ${STAGEDIR}${PREFIX}/bin
${LN} -sf rawrec ${STAGEDIR}${PREFIX}/bin/rawplay
- ${INSTALL_MAN} ${WRKSRC}/../docs/user/rawrec.1 ${STAGEDIR}${PREFIX}/share/man/man1
+ ${INSTALL_MAN} ${WRKSRC}/../docs/user/rawrec.1 \
+ ${STAGEDIR}${PREFIX}/share/man/man1
${LN} -sf rawrec.1 ${STAGEDIR}${PREFIX}/share/man/man1/rawplay.1
.include <bsd.port.mk>
diff --git a/audio/rawrec/files/patch-audio__init.c b/audio/rawrec/files/patch-audio__init.c
new file mode 100644
index 000000000000..ae14fbb736b0
--- /dev/null
+++ b/audio/rawrec/files/patch-audio__init.c
@@ -0,0 +1,11 @@
+--- audio_init.c.orig 2006-01-05 17:36:27 UTC
++++ audio_init.c
+@@ -20,7 +20,7 @@
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+-#include <linux/soundcard.h>
++#include <sys/soundcard.h>
+
+ #include "rawrec.h"
+
diff --git a/audio/rawrec/files/patch-get__au__blksz.c b/audio/rawrec/files/patch-get__au__blksz.c
new file mode 100644
index 000000000000..cc77cd3c7849
--- /dev/null
+++ b/audio/rawrec/files/patch-get__au__blksz.c
@@ -0,0 +1,11 @@
+--- get_au_blksz.c.orig 2006-01-05 17:36:27 UTC
++++ get_au_blksz.c
+@@ -8,7 +8,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <linux/soundcard.h>
++#include <sys/soundcard.h>
+
+ #include "rawrec.h"
+
diff --git a/audio/rawrec/files/patch-get__format__code.c b/audio/rawrec/files/patch-get__format__code.c
new file mode 100644
index 000000000000..1a5b8e91a15f
--- /dev/null
+++ b/audio/rawrec/files/patch-get__format__code.c
@@ -0,0 +1,11 @@
+--- get_format_code.c.orig 2006-01-05 17:36:27 UTC
++++ get_format_code.c
+@@ -7,7 +7,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <linux/soundcard.h>
++#include <sys/soundcard.h>
+
+ #include "rawrec.h"
+
diff --git a/audio/rawrec/files/patch-main.c b/audio/rawrec/files/patch-main.c
index 21fb45387f3e..7653a02eaa4c 100644
--- a/audio/rawrec/files/patch-main.c
+++ b/audio/rawrec/files/patch-main.c
@@ -1,23 +1,11 @@
--- main.c.orig 2006-01-22 02:40:17 UTC
+++ main.c
-@@ -14,6 +14,12 @@
-
- #include "rawrec.h"
-
-+size_t strnlen (const char *string, size_t maxlen)
-+{
-+ const char *end = memchr (string, '\0', maxlen);
-+ return end ? (size_t) (end - string) : maxlen;
-+}
-+
- int main(int argc, char *argv[])
- {
- /* Action for ignoring signals we don't want to deal with. */
-@@ -118,6 +124,7 @@ int main(int argc, char *argv[])
- strncpy(cnst_dflt_format, "s16_le", (size_t) (MAX_FORMAT_STRING_LENGTH + 1));
+@@ -119,6 +119,8 @@ int main(int argc, char *argv[])
/* at the moment, this application goes with the default for most signals */
-+ ignorer_act.sa_flags = 0;
ignorer_act.sa_handler = SIG_IGN;
++ ignorer_act.sa_flags = 0;
++ sigemptyset(&ignorer_act.sa_mask);
/* because I'm unclear on how SIGIO is supposed to work, it's not
applicable here, and I'm paranoid */
+ if ( sigaction(SIGIO, &ignorer_act, NULL) == -1 )
diff --git a/audio/rawrec/files/patch-play.c b/audio/rawrec/files/patch-play.c
deleted file mode 100644
index 0b878d2edb6c..000000000000
--- a/audio/rawrec/files/patch-play.c
+++ /dev/null
@@ -1,49 +0,0 @@
---- play.c.orig 2006-01-22 02:40:17 UTC
-+++ play.c
-@@ -54,7 +54,6 @@ void play(parameters_stt *clp) /* pneumo
- int rtn; /* For return values of pthread fctns. */
- /* Maximum priority of FIFO thread. Should always be initialized
- elsewhere before use. */
-- int fifo_max_prio = 0;
- void *au_th_ret; /* Audio thread return pointer. */
- void *fd_th_ret; /* File thread return pointer. */
- sigset_t all_sigs; /* Full set of all signals. */
-@@ -263,6 +262,10 @@ void play(parameters_stt *clp) /* pneumo
- PTHREAD_CREATE_JOINABLE)) ) {
- err_die("BUG: pthread_attr_setdetachstate failed: %s\n", strerror(rtn));
- }
-+
-+/* This is ugly, but FreeBSD defines _POSIX_THREAD_PRIORITY_SCHEDULING
-+ but it does not support PTHREAD_SCOPE_SYSTEM
-+
- #if defined (_POSIX_THREAD_PRIORITY_SCHEDULING) \
- && _POSIX_THREAD_PRIORITY_SCHEDULING != -1 \
- && _POSIX_THREAD_PRIORITY_SCHEDULING != 0
-@@ -282,6 +285,8 @@ void play(parameters_stt *clp) /* pneumo
- err_die("BUG: pthread_attr_setscope failed: %s\n", strerror(rtn));
- }
- #endif
-+*/
-+
- if ( (rtn = pthread_attr_init(&move_fd_attr)) )
- err_die("BUG: pthread_attr_init failed: %s\n", strerror(rtn));
- if ( (rtn = pthread_attr_setdetachstate(&move_fd_attr,
-@@ -289,6 +294,9 @@ void play(parameters_stt *clp) /* pneumo
- err_die("BUG: pthread_attr_setdetachstate failed: %s\n", strerror(rtn));
- }
-
-+/* This is ugly, but FreeBSD defines _POSIX_THREAD_PRIORITY_SCHEDULING
-+ but it does not support PTHREAD_SCOPE_SYSTEM
-+
- #if defined (_POSIX_THREAD_PRIORITY_SCHEDULING) \
- && _POSIX_THREAD_PRIORITY_SCHEDULING != -1 \
- && _POSIX_THREAD_PRIORITY_SCHEDULING != 0
-@@ -306,7 +314,7 @@ void play(parameters_stt *clp) /* pneumo
- err_die("BUG: pthread_attr_setscope failed: %s\n", strerror(rtn));
- }
- #endif
--
-+*/
- /* Getting ugly. Here we install a handler (which sets a global
- flag which the threads can poll in order to do graceful
- death). */
diff --git a/audio/rawrec/files/patch-record.c b/audio/rawrec/files/patch-record.c
deleted file mode 100644
index c906a25c685e..000000000000
--- a/audio/rawrec/files/patch-record.c
+++ /dev/null
@@ -1,47 +0,0 @@
---- record.c.orig 2006-01-22 02:40:17 UTC
-+++ record.c
-@@ -43,7 +43,6 @@ void record(parameters_stt *clp)
- int rtn; /* For return values of pthread fctns. */
- /* Maximum priority of FIFO thread. Should always be rinitialized
- elsewhere before use. */
-- int fifo_max_prio = 0;
- void *au_th_ret; /* Audio thread return pointer. */
- void *fd_th_ret; /* File thread return pointer. */
- sigset_t all_sigs; /* Full set of all signals. */
-@@ -183,6 +182,10 @@ void record(parameters_stt *clp)
- PTHREAD_CREATE_JOINABLE)) ) {
- err_die("BUG: pthread_attr_setdetachstate failed: %s\n", strerror(rtn));
- }
-+
-+/* This is ugly, but FreeBSD defines _POSIX_THREAD_PRIORITY_SCHEDULING
-+ but it does not support PTHREAD_SCOPE_SYSTEM
-+
- #if defined (_POSIX_THREAD_PRIORITY_SCHEDULING) \
- && _POSIX_THREAD_PRIORITY_SCHEDULING != -1 \
- && _POSIX_THREAD_PRIORITY_SCHEDULING != 0
-@@ -202,12 +205,17 @@ void record(parameters_stt *clp)
- err_die("BUG: pthread_attr_setscope failed: %s\n", strerror(rtn));
- }
- #endif
-+*/
- if ( (rtn = pthread_attr_init(&move_fd_attr)) )
- err_die("BUG: pthread_attr_init failed: %s\n", strerror(rtn));
- if ( (rtn = pthread_attr_setdetachstate(&move_fd_attr,
- PTHREAD_CREATE_JOINABLE)) ) {
- err_die("BUG: pthread_attr_setdetachstate failed: %s\n", strerror(rtn));
- }
-+
-+/* This is ugly, but FreeBSD defines _POSIX_THREAD_PRIORITY_SCHEDULING
-+ but it does not support PTHREAD_SCOPE_SYSTEM
-+
- #if defined (_POSIX_THREAD_PRIORITY_SCHEDULING) \
- && _POSIX_THREAD_PRIORITY_SCHEDULING != -1 \
- && _POSIX_THREAD_PRIORITY_SCHEDULING != 0
-@@ -225,6 +233,7 @@ void record(parameters_stt *clp)
- err_die("BUG: pthread_attr_setscope failed: %s\n", strerror(rtn));
- }
- #endif
-+*/
-
- /* Getting ugly. Here we install a handler (which sets a global
- flag which the threads can poll in order to do graceful
diff --git a/audio/rawrec/files/patch-set__au__blksz.c b/audio/rawrec/files/patch-set__au__blksz.c
new file mode 100644
index 000000000000..ccd60bd378d9
--- /dev/null
+++ b/audio/rawrec/files/patch-set__au__blksz.c
@@ -0,0 +1,11 @@
+--- set_au_blksz.c.orig 2006-01-05 17:36:27 UTC
++++ set_au_blksz.c
+@@ -8,7 +8,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <linux/soundcard.h>
++#include <sys/soundcard.h>
+
+ #include "rawrec.h"
+
diff --git a/audio/rawrec/files/patch-sleep__on__option.c b/audio/rawrec/files/patch-sleep__on__option.c
deleted file mode 100644
index 299a6d09a1d1..000000000000
--- a/audio/rawrec/files/patch-sleep__on__option.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- sleep_on_option.c.orig 2006-01-05 17:36:27 UTC
-+++ sleep_on_option.c
-@@ -15,7 +15,7 @@ void sleep_on_option(double time, double
-
- if ( time > samples / speed ) {
- reqst.tv_sec = (time_t) floor(time);
-- reqst.tv_nsec = (long) nearbyint((time - floor(time)) * 1000000);
-+ reqst.tv_nsec = (long) rint((time - floor(time)) * 1000000);
- } else {
- reqst.tv_sec = (time_t) floor(samples / speed);
- reqst.tv_nsec = (long) rint((samples / speed - floor(samples / speed))
diff --git a/audio/rawrec/files/patch-test__dsp__params.c b/audio/rawrec/files/patch-test__dsp__params.c
new file mode 100644
index 000000000000..c23cfa874c70
--- /dev/null
+++ b/audio/rawrec/files/patch-test__dsp__params.c
@@ -0,0 +1,11 @@
+--- test_dsp_params.c.orig 2006-01-05 17:36:27 UTC
++++ test_dsp_params.c
+@@ -16,7 +16,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
+-#include <linux/soundcard.h>
++#include <sys/soundcard.h>
+
+ #include "rawrec.h"
+