aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Engberg <diizzy@FreeBSD.org>2023-04-27 09:50:28 +0000
committerDaniel Engberg <diizzy@FreeBSD.org>2023-04-27 12:01:42 +0000
commit1c4a5a439be18241f9c356261f3275bc0e68cc1e (patch)
treec383cb865ed6c2cb166720cf3ceb2e1ed2189f40
parent89fef4d904086fa7d15c87885f6e59041f2c86a0 (diff)
downloadports-1c4a5a439be18241f9c356261f3275bc0e68cc1e.tar.gz
ports-1c4a5a439be18241f9c356261f3275bc0e68cc1e.zip
java/openjfx14: 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
-rw-r--r--java/openjfx14/Makefile5
-rw-r--r--java/openjfx14/files/patch-modules_javafx.media_src_main_native_gstreamer_projects_linux_avplugin_Makefile37
2 files changed, 41 insertions, 1 deletions
diff --git a/java/openjfx14/Makefile b/java/openjfx14/Makefile
index 2a7d0e8984d1..05aea99965e4 100644
--- a/java/openjfx14/Makefile
+++ b/java/openjfx14/Makefile
@@ -58,7 +58,7 @@ OPTIONS_SUB= yes
MEDIA_DESC= Media module
SWT_DESC= SWT support
-MEDIA_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
+MEDIA_LIB_DEPENDS= libavcodec.so.58:multimedia/ffmpeg4 \
libsndio.so:audio/sndio
MEDIA_USES= gmake
MEDIA_VARS= COMPILE_MEDIA=true
@@ -133,6 +133,9 @@ post-patch:
@${RM} -r ${WRKSRC}/modules/javafx.web/src/main/native/Source/WTF/icu
@cd ${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/3rd_party && \
${RM} -r glib libffi
+# Environment variables gets lost so hardcode where we can find FFmpeg 4.x
+ @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
+ ${PATCH_WRKSRC}/modules/javafx.media/src/main/native/gstreamer/projects/linux/avplugin/Makefile
do-configure:
@${MKDIR} ${WRKDIR}/gradle-home
diff --git a/java/openjfx14/files/patch-modules_javafx.media_src_main_native_gstreamer_projects_linux_avplugin_Makefile b/java/openjfx14/files/patch-modules_javafx.media_src_main_native_gstreamer_projects_linux_avplugin_Makefile
new file mode 100644
index 000000000000..1d019e231f7a
--- /dev/null
+++ b/java/openjfx14/files/patch-modules_javafx.media_src_main_native_gstreamer_projects_linux_avplugin_Makefile
@@ -0,0 +1,37 @@
+--- modules/javafx.media/src/main/native/gstreamer/projects/linux/avplugin/Makefile.orig 2020-07-17 10:21:33 UTC
++++ modules/javafx.media/src/main/native/gstreamer/projects/linux/avplugin/Makefile
+@@ -41,25 +41,16 @@ endif
+ PACKAGES_INCLUDES := $(shell pkg-config --cflags glib-2.0)
+ PACKAGES_LIBS := $(shell pkg-config --libs glib-2.0 gobject-2.0)
+
+-INCLUDES= -I../../../plugins \
+- -I../../../plugins/av \
+- -I../../../gstreamer-lite/gstreamer \
+- -I../../../gstreamer-lite/gstreamer/libs \
+- $(PACKAGES_INCLUDES)
++INCLUDES = -I../../../plugins -I../../../plugins/av -I../../../gstreamer-lite/gstreamer -I../../../gstreamer-lite/gstreamer/libs -I%%LOCALBASE%%/ffmpeg4/include $(PACKAGES_INCLUDES)
++LDFLAGS = -L$(BUILD_DIR) -lgstreamer-lite -L%%LOCALBASE%%/ffmpeg4/lib -lavcodec -lavformat $(PACKAGES_LIBS) -z relro -static-libgcc -static-libstdc++ -Wl,--gc-sections
+
+-LDFLAGS = -L$(BUILD_DIR) \
+- -lgstreamer-lite \
+- $(PACKAGES_LIBS) \
+- -z relro \
+- -static-libgcc -static-libstdc++ -Wl,--gc-sections
+-
+-ifneq ($(strip $(LIBAV_DIR)),)
+-INCLUDES += -I$(LIBAV_DIR)/include
+-LDFLAGS += -L$(LIBAV_DIR)/lib/ -lavcodec -lavformat
+-else
+-INCLUDES += $(shell pkg-config --cflags libavcodec libavformat)
+-LDFLAGS += $(shell pkg-config --libs libavcodec libavformat)
+-endif
++# ifneq ($(strip $(LIBAV_DIR)),)
++# INCLUDES += -I$(LIBAV_DIR)/include
++# LDFLAGS += -L$(LIBAV_DIR)/lib/ -lavcodec -lavformat
++# else
++# INCLUDES += $(shell pkg-config --cflags libavcodec libavformat)
++# LDFLAGS += $(shell pkg-config --libs libavcodec libavformat)
++# endif
+
+ ifeq ($(ARCH), x32)
+ CFLAGS += -m32