git: de595bdfccf4 - main - audio/essentia: Move to FFmpeg 4

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Thu, 27 Apr 2023 12:03:50 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=de595bdfccf4c7a80a67ff947705cdd6bdb4a7d8

commit de595bdfccf4c7a80a67ff947705cdd6bdb4a7d8
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-04-27 09:15:52 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-04-27 12:01:40 +0000

    audio/essentia: Move to FFmpeg 4
    
    Fails to build with FFmpeg 6
    
    PR:             261302
    Reported by:    antoine (via exp-run)
    Approved by:    portmgr (blanket, build fix)
    Sponsored by:   Blinkinblox
---
 audio/essentia/Makefile            |  6 +++++-
 audio/essentia/files/patch-wscript | 11 +++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/audio/essentia/Makefile b/audio/essentia/Makefile
index 6f63e9759484..1ae34872057f 100644
--- a/audio/essentia/Makefile
+++ b/audio/essentia/Makefile
@@ -13,13 +13,17 @@ LICENSE=	AGPLv3
 LICENSE_FILE=	${WRKSRC}/COPYING.txt
 
 BUILD_DEPENDS=	${LOCALBASE}/include/fftw3.h:math/fftw3
-LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg \
+LIB_DEPENDS=	libavcodec.so.58:multimedia/ffmpeg4 \
 		libchromaprint.so:audio/chromaprint \
 		libfftw3f.so:math/fftw3-float \
 		libsamplerate.so:audio/libsamplerate \
 		libtag.so:audio/taglib \
 		libyaml.so:textproc/libyaml
 
+CFLAGS+=	-I${LOCALBASE}/ffmpeg4/include
+CONFIGURE_ENV+=	PKG_CONFIG_PATH="${LOCALBASE}/ffmpeg4/libdata/pkgconfig"
+MAKE_ENV+=	PKG_CONFIG_PATH="${LOCALBASE}/ffmpeg4/libdata/pkgconfig"
+
 USES=		compiler:c++11-lib eigen:3 pkgconfig waf
 
 USE_GITHUB=	yes
diff --git a/audio/essentia/files/patch-wscript b/audio/essentia/files/patch-wscript
new file mode 100644
index 000000000000..be5d4746c647
--- /dev/null
+++ b/audio/essentia/files/patch-wscript
@@ -0,0 +1,11 @@
+--- wscript.orig	2022-11-03 19:50:02 UTC
++++ wscript
+@@ -148,6 +148,8 @@ def configure(ctx):
+     elif ctx.options.MODE == 'release':
+         print ('→ Building in release mode')
+         ctx.env.CXXFLAGS += ['-O2']  # '-march=native' ] # '-msse3', '-mfpmath=sse' ]
++        ctx.env.LINKFLAGS += ['-L/usr/local/ffmpeg4/lib']
++        ctx.env.LDFLAGS += ['-L/usr/local/ffmpeg4/lib']
+ 
+     elif ctx.options.MODE == 'default':
+         pass