Created attachment 155787 [details] sox_14.4.2.diff Update to 14.4.2 add option TWOLAME OPUS
Created attachment 155866 [details] updated patch Updated version of the patch: Made OPUS a default option, since VORBIS was a default option too, and opus is supposed to replace vorbis. Removed the "USE_GCC=any" block and replaced it with "CONFIGURE_ARGS+= --disable-stack-protector". I assume USE_GCC was added to avoid a coredump when compiled with clang, but the real problem is that sox tries to link in custom stack-smashing code when the ports tree already adds -fstack-protector to CFLAGS, and the two don't co-operate. See bug #186097 for a similar problem and solution.
(In reply to Dan Nelson from comment #1) I tried the patch. Good seems to working.
Comment on attachment 155787 [details] sox_14.4.2.diff >diff -ruN /usr/ports/audio/sox/Makefile ./Makefile >--- /usr/ports/audio/sox/Makefile 2015-03-26 06:37:39.000000000 +0900 >+++ ./Makefile 2015-04-21 08:20:17.000000000 +0900 >@@ -2,8 +2,8 @@ > # $FreeBSD: head/audio/sox/Makefile 382272 2015-03-25 21:37:39Z marino $ > > PORTNAME= sox >-PORTVERSION= 14.4.1 >-PORTREVISION= 7 >+PORTVERSION= 14.4.2 >+#PORTREVISION= 0 > CATEGORIES= audio > MASTER_SITES= SF > >@@ -21,9 +21,10 @@ > USES= autoreconf pkgconfig libtool > USE_LDCONFIG= yes > >-OPTIONS_DEFINE= ALSA AO AMRNB AMRWB FFMPEG FLAC GSM ID3TAG LADSPA LAME \ >- MAD PNG PULSEAUDIO SNDFILE VORBIS WAVPACK >-OPTIONS_DEFAULT= AO FFMPEG FLAC GSM ID3TAG MAD PNG SNDFILE VORBIS >+OPTIONS_DEFINE= ALSA AO AMRNB AMRWB FLAC GSM ID3TAG LADSPA LAME \ >+ MAD PNG PULSEAUDIO SNDFILE VORBIS WAVPACK\ >+ TWOLAME OPUS >+OPTIONS_DEFAULT= AO FLAC GSM ID3TAG MAD PNG SNDFILE VORBIS > # Default LAME to off for packages so we don't end up RESTRICTED > .if !defined(PACKAGE_BUILDING) > OPTIONS_DEFAULT+= LAME >@@ -53,9 +54,6 @@ > AMRWB_CONFIGURE_WITH= amrwb > AMRWB_LIB_DEPENDS= libamrwb.so:${PORTSDIR}/audio/libamrwb > >-FFMPEG_CONFIGURE_WITH= ffmpeg >-FFMPEG_LIB_DEPENDS= libavcodec.so:${PORTSDIR}/multimedia/ffmpeg >- > VORBIS_CONFIGURE_WITH= oggvorbis > VORBIS_LIB_DEPENDS= libvorbis.so:${PORTSDIR}/audio/libvorbis > >@@ -89,6 +87,12 @@ > WAVPACK_CONFIGURE_WITH= wavpack > WAVPACK_LIB_DEPENDS= libwavpack.so:${PORTSDIR}/audio/wavpack > >+TWOLAME_CONFIGURE_WITH= twolame >+TWOLAME_LIB_DEPENDS= libtwolame.so:${PORTSDIR}/audio/twolame >+ >+OPUS_CONFIGURE_WITH= opus >+OPUS_LIB_DEPENDS= libopusfile.so:${PORTSDIR}/audio/opusfile >+ > .include <bsd.port.options.mk> > > .if ! ${PORT_OPTIONS:MGSM} >@@ -98,9 +102,10 @@ > ac_cv_lib_gsm_gsm_create=no > .endif > >-post-patch: >- @${REINPLACE_CMD} -e 's/ CODEC_ID/ AV_CODEC_ID/g' \ >- -e 's/ CodecID/ AVCodecID/g' \ >- ${WRKSRC}/src/ffmpeg.c >+.if ${OSVERSION} > 900000 >+USE_GCC= any >+.endif >+ >+INSTALL_TARGET= install-strip > > .include <bsd.port.mk> >diff -ruN /usr/ports/audio/sox/distinfo ./distinfo >--- /usr/ports/audio/sox/distinfo 2014-01-23 00:30:13.000000000 +0900 >+++ ./distinfo 2015-04-20 15:07:55.000000000 +0900 >@@ -1,2 +1,2 @@ >-SHA256 (sox-14.4.1.tar.gz) = 9a8c2c6fe51e608da346a157e111508a957af9e3ecf3de26781d36e9a67fa89b >-SIZE (sox-14.4.1.tar.gz) = 1111653 >+SHA256 (sox-14.4.2.tar.gz) = b45f598643ffbd8e363ff24d61166ccec4836fea6d3888881b8df53e3bb55f6c >+SIZE (sox-14.4.2.tar.gz) = 1134299 >diff -ruN /usr/ports/audio/sox/files/patch-Makefile.am ./files/patch-Makefile.am >--- /usr/ports/audio/sox/files/patch-Makefile.am 2014-03-02 20:29:25.000000000 +0900 >+++ ./files/patch-Makefile.am 1970-01-01 09:00:00.000000000 +0900 >@@ -1,14 +0,0 @@ >-Work around a ports bug wrt symlinking manpages in different >-categories, by copying the manpage instead. >- >---- Makefile.am.orig 2013-01-30 11:40:06.000000000 +0900 >-+++ Makefile.am 2014-02-08 01:46:11.000000000 +0900 >-@@ -118,7 +118,7 @@ >- install-data-hook: >- cd $(DESTDIR)$(mandir)/man1 && $(RM) play.1 && $(LN_S) sox.1 play.1 >- cd $(DESTDIR)$(mandir)/man1 && $(RM) rec.1 && $(LN_S) sox.1 rec.1 >-- cd $(DESTDIR)$(mandir)/man7 && $(RM) soxeffect.7 && $(LN_S) ../man1/sox.1 soxeffect.7 >-+ cd $(DESTDIR)$(mandir)/man7 && $(RM) soxeffect.7 && cp ../man1/sox.1 soxeffect.7 >- >- uninstall-hook: >- $(RM) $(DESTDIR)$(mandir)/man1/play.1 >diff -ruN /usr/ports/audio/sox/files/patch-avcodec54 ./files/patch-avcodec54 >--- /usr/ports/audio/sox/files/patch-avcodec54 2013-10-20 01:43:32.000000000 +0900 >+++ ./files/patch-avcodec54 1970-01-01 09:00:00.000000000 +0900 >@@ -1,100 +0,0 @@ >-Index: m4/ffmpeg.m4 >-=================================================================== >---- m4/ffmpeg.m4.orig >-+++ m4/ffmpeg.m4 >-@@ -49,7 +49,7 @@ then >- LIBS="$LIBS $FFMPEG_LIBS" >- have_ffmpeg="no" >- AC_CHECK_HEADERS([libavformat/avformat.h ffmpeg/avformat.h], >-- [AC_CHECK_LIB(avformat, av_open_input_file, >-+ [AC_CHECK_LIB(avformat, avformat_open_input, >- [AC_CHECK_HEADERS([libavcodec/avcodec.h ffmpeg/avcodec.h], >- [AC_CHECK_LIB(avcodec, avcodec_decode_audio3, have_ffmpeg=yes)])]) >- break]) >-Index: src/ffmpeg.c >-=================================================================== >---- src/ffmpeg.c.orig >-+++ src/ffmpeg.c >-@@ -92,8 +92,10 @@ static int stream_component_open(priv_t >- enc->workaround_bugs = 1; >- #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) >- enc->error_resilience = 1; >--#else >-+#elif LIBAVCODEC_VERSION_INT < ((54<<16)+(0<<8)+0) >- enc->error_recognition = 1; >-+#else >-+ ic->error_recognition = 1; >- #endif >- >- if (!codec || avcodec_open(enc, codec) < 0) >-@@ -157,7 +159,7 @@ static int audio_decode_frame(priv_t * f >- static int startread(sox_format_t * ft) >- { >- priv_t * ffmpeg = (priv_t *)ft->priv; >-- AVFormatParameters params; >-+ AVDictionary *params; >- int ret; >- int i; >- >-@@ -172,7 +174,7 @@ static int startread(sox_format_t * ft) >- >- /* Open file and get format */ >- memset(¶ms, 0, sizeof(params)); >-- if ((ret = av_open_input_file(&ffmpeg->ctxt, ft->filename, NULL, 0, ¶ms)) < 0) { >-+ if ((ret = avformat_open_input(&ffmpeg->ctxt, ft->filename, NULL, ¶ms)) < 0) { >- lsx_fail("ffmpeg cannot open file for reading: %s (code %d)", ft->filename, ret); >- return SOX_EOF; >- } >-@@ -231,7 +233,7 @@ static size_t read_samples(sox_format_t >- /* If input buffer empty, read more data */ >- if (ffmpeg->audio_buf_index * 2 >= ffmpeg->audio_buf_size) { >- if ((ret = av_read_frame(ffmpeg->ctxt, pkt)) < 0 && >-- (ret == AVERROR_EOF || url_ferror(ffmpeg->ctxt->pb))) >-+ (ret == AVERROR_EOF || ( ffmpeg->ctxt->pb && ffmpeg->ctxt->pb->error))) >- break; >- ffmpeg->audio_buf_size = audio_decode_frame(ffmpeg, ffmpeg->audio_buf_aligned, AVCODEC_MAX_AUDIO_FRAME_SIZE); >- ffmpeg->audio_buf_index = 0; >-@@ -373,13 +375,6 @@ static int startwrite(sox_format_t * ft) >- return SOX_EOF; >- } >- >-- /* set the output parameters (must be done even if no >-- parameters). */ >-- if (av_set_parameters(ffmpeg->ctxt, NULL) < 0) { >-- lsx_fail("ffmpeg invalid output format parameters"); >-- return SOX_EOF; >-- } >-- >- /* Next line for debugging */ >- /* dump_format(ffmpeg->ctxt, 0, ft->filename, 1); */ >- >-@@ -391,14 +386,14 @@ static int startwrite(sox_format_t * ft) >- >- /* open the output file, if needed */ >- if (!(ffmpeg->fmt->flags & AVFMT_NOFILE)) { >-- if (url_fopen(&ffmpeg->ctxt->pb, ft->filename, URL_WRONLY) < 0) { >-+ if (avio_open(&ffmpeg->ctxt->pb, ft->filename, AVIO_FLAG_WRITE) < 0) { >- lsx_fail("ffmpeg could not open `%s'", ft->filename); >- return SOX_EOF; >- } >- } >- >- /* write the stream header, if any */ >-- av_write_header(ffmpeg->ctxt); >-+ avformat_write_header(ffmpeg->ctxt, NULL); >- >- return SOX_SUCCESS; >- } >-@@ -475,11 +470,7 @@ static int stopwrite(sox_format_t * ft) >- >- if (!(ffmpeg->fmt->flags & AVFMT_NOFILE)) { >- /* close the output file */ >--#if (LIBAVFORMAT_VERSION_INT < 0x340000) >-- url_fclose(&ffmpeg->ctxt->pb); >--#else >-- url_fclose(ffmpeg->ctxt->pb); >--#endif >-+ avio_close(ffmpeg->ctxt->pb); >- } >- >- /* Free the output context */ >diff -ruN /usr/ports/audio/sox/files/patch-ffmpeg ./files/patch-ffmpeg >--- /usr/ports/audio/sox/files/patch-ffmpeg 2014-01-23 02:40:44.000000000 +0900 >+++ ./files/patch-ffmpeg 1970-01-01 09:00:00.000000000 +0900 >@@ -1,11 +0,0 @@ >---- src/ffmpeg.h.orig >-+++ src/ffmpeg.h >-@@ -27,6 +27,8 @@ >- #include <ffmpeg/avformat.h> >- #endif >- >-+#include <libavutil/mathematics.h> >-+ >- #if defined __SUNPRO_C >- #pragma enable_warn >- #elif defined _MSC_VER >diff -ruN /usr/ports/audio/sox/files/patch-ffmpeg2 ./files/patch-ffmpeg2 >--- /usr/ports/audio/sox/files/patch-ffmpeg2 2013-10-20 01:43:32.000000000 +0900 >+++ ./files/patch-ffmpeg2 1970-01-01 09:00:00.000000000 +0900 >@@ -1,16 +0,0 @@ >-Index: src/ffmpeg.c >-=================================================================== >---- src/ffmpeg.c.orig >-+++ src/ffmpeg.c >-@@ -57,6 +57,11 @@ >- #define PKT_FLAG_KEY AV_PKT_FLAG_KEY >- #endif >- >-+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE >-+#define AVCODEC_MAX_AUDIO_FRAME_SIZE (192000 * 4) >-+#endif >-+ >-+ >- /* Private data for ffmpeg files */ >- typedef struct { >- int audio_index; >diff -ruN /usr/ports/audio/sox/files/patch-libav9 ./files/patch-libav9 >--- /usr/ports/audio/sox/files/patch-libav9 2013-10-20 01:43:32.000000000 +0900 >+++ ./files/patch-libav9 1970-01-01 09:00:00.000000000 +0900 >@@ -1,39 +0,0 @@ >-diff -burN src/ffmpeg.c sox-14.4.0/src/ffmpeg.c >---- src/ffmpeg.c.orig 2012-11-25 21:59:45.990825656 +0100 >-+++ src/ffmpeg.c 2012-11-25 22:07:06.436809624 +0100 >-@@ -98,7 +98,7 @@ >- ic->error_recognition = 1; >- #endif >- >-- if (!codec || avcodec_open(enc, codec) < 0) >-+ if (!codec || avcodec_open2(enc, codec, NULL) < 0) >- return -1; >- if (enc->codec_type != AVMEDIA_TYPE_AUDIO) { >- lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type); >-@@ -180,7 +180,7 @@ >- } >- >- /* Get CODEC parameters */ >-- if ((ret = av_find_stream_info(ffmpeg->ctxt)) < 0) { >-+ if ((ret = avformat_find_stream_info(ffmpeg->ctxt, NULL)) < 0) { >- lsx_fail("ffmpeg could not find CODEC parameters for %s", ft->filename); >- return SOX_EOF; >- } >-@@ -274,7 +274,7 @@ >- AVCodecContext *c; >- AVStream *st; >- >-- st = av_new_stream(oc, 1); >-+ st = avformat_new_stream(oc, NULL); >- if (!st) { >- lsx_fail("ffmpeg could not alloc stream"); >- return NULL; >-@@ -308,7 +308,7 @@ >- } >- >- /* open it */ >-- if (avcodec_open(c, codec) < 0) { >-+ if (avcodec_open2(c, codec, NULL) < 0) { >- lsx_fail("ffmpeg could not open CODEC"); >- return SOX_EOF; >- } >diff -ruN /usr/ports/audio/sox/pkg-plist ./pkg-plist >--- /usr/ports/audio/sox/pkg-plist 2014-08-16 01:21:03.000000000 +0900 >+++ ./pkg-plist 2015-04-20 15:07:47.000000000 +0900 >@@ -5,8 +5,8 @@ > include/sox.h > lib/libsox.a > lib/libsox.so >-lib/libsox.so.2 >-lib/libsox.so.2.0.1 >+lib/libsox.so.3 >+lib/libsox.so.3.0.0 > man/man1/play.1.gz > man/man1/rec.1.gz > man/man1/sox.1.gz
Created attachment 155883 [details] sox_14.4.2.diff add INSTALL_TARGET=install-strip
I knew I forgot to mention something when I uploaded my updated patch. I removed that line because the ports system installs stripped binaries by default, so there's no need to explicitly call an "install-strip" target.
(In reply to Dan Nelson from comment #5) It is no longer needed? https://www.freebsd.org/doc/en/books/porters-handbook/install.html#install-strip
Check for yourself; remove the "INSTALL_TARGET=install-strip" line from your makefile, reinstall sox, then run "file /usr/local/bin/sox". I bet it'll print something like this, showing that the installed file is still stripped: /usr/local/bin/sox: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 10.1, stripped
(In reply to Dan Nelson from comment #7) Is to strip the executable file is a library unstripped. # make __MAKE_CONF=/dev/null BATCH=1 stage stage-qa ====> Running Q/A tests (stage-qa) Warning: 'lib/libsox.so.3.0.0' is not stripped consider trying INSTALL_TARGET=install-strip or using ${STRIP_CMD}
Comment on attachment 155883 [details] sox_14.4.2.diff (In reply to takefu from comment #8) Saving a whole 4392 bytes :) # find . -name libsox.so.3.0.0 -ls 164562 1216 -rwxr-xr-x 1 root wheel 581992 Apr 23 09:41 ./work/sox-14.4.2/src/.libs/libsox.so.3.0.0 165201 1216 -rwxr-xr-x 1 root wheel 577600 Apr 23 09:41 ./work/stage/usr/local/lib/libsox.so.3.0.0 # echo $((581992-577600)) 4392 But it is a savings, so we might as well use it.
I don't seem to be able to set the maintainer-approval+ flag on attachment 155883 [details], so if any committers are reading this email, please commit. Thanks!
Comment on attachment 155883 [details] sox_14.4.2.diff Try now Dan
Comment on attachment 155883 [details] sox_14.4.2.diff +
It looks like you added a comment, but didnt change the "maintainer-approval" flag's value (in the drop down) to + Can you try setting that field value please Dan
(In reply to Kubilay Kocak from comment #13) Weird. I must be doing something wrong. I click the [Details] link next to the attachment, change the dropdown on the maintainer‑approval line from "?" to "+", click [Submit]. But the attachment stays at "maintainer-approval?". I was able to set maintainer-approval+ on Attachment #155866 [details] , though (possibly because I had created that attachment?)
Very weird. Thanks for clarifying, I'll set the flag this time. CC Marcus who might be able to figure out whats going on. Dan, QA results are also needed in the form of: - portlint -AC output - poudriere testport (or bulk -t) output Please add them *as attachments* not comments For more information, see: https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/testing-poudriere.html
Comment on attachment 155883 [details] sox_14.4.2.diff Testing maintainer-approval
Comment on attachment 155883 [details] sox_14.4.2.diff Dan can apparently see the field, set the ? value to +, submit the form, which results in: Top of the page says "Changes to attachment 155883 [details] of bug 199567 submitted" But no changes to the issue are apparent.
A commit references this bug: Author: riggs Date: Sat May 2 14:02:57 UTC 2015 New revision: 385177 URL: https://svnweb.freebsd.org/changeset/ports/385177 Log: - Update to upstream version 14.4.2 - Bump PORTREVISION on lib-dependent ports PR: 199567 Submitted by: takefu@airport.fm Approved by: dnelson@allantgroup.com (maintainer) Changes: head/audio/dvda-author/Makefile head/audio/sox/Makefile head/audio/sox/distinfo head/audio/sox/files/ head/audio/sox/pkg-plist head/multimedia/imagination/Makefile head/multimedia/mlt/Makefile