On Mon, Feb 17, 2025 at 07:31:09AM -0500, Brad Smith wrote: > NFC, just back porting some autoconf fixes for libexecinfo and libass. rev 2. Added some patches to fix building with newer libsmb2.
Index: Makefile =================================================================== RCS file: /cvs/ports/x11/vlc/Makefile,v retrieving revision 1.279 diff -u -p -u -p -r1.279 Makefile --- Makefile 7 Feb 2025 15:19:46 -0000 1.279 +++ Makefile 19 Mar 2025 04:49:27 -0000 @@ -9,7 +9,7 @@ CATEGORIES= x11 SITES= https://download.videolan.org/pub/videolan/vlc/${V}/ EXTRACT_SUFX= .tar.xz REVISION-jack= 0 -REVISION-main= 1 +REVISION-main= 2 USE_NOBTCFI= Yes @@ -226,7 +226,6 @@ CONFIGURE_ARGS+=--disable-a52 \ CONFIGURE_ENV+= BUILDCC="${CC}" \ CPPFLAGS="-I${X11BASE}/include -I${LOCALBASE}/include" \ LDFLAGS="-L${X11BASE}/lib -L${LOCALBASE}/lib" \ - LIBS_libvlccore="-lexecinfo" \ PKG_CONFIG_PATH="${LOCALBASE}/lib/qt5/pkgconfig" \ RCC="${LOCALBASE}/bin/rcc-qt5" \ LUAC="${LOCALBASE}/bin/luac${MODLUA_DEP_VERSION}" Index: patches/patch-configure_ac =================================================================== RCS file: /cvs/ports/x11/vlc/patches/patch-configure_ac,v retrieving revision 1.45 diff -u -p -u -p -r1.45 patch-configure_ac --- patches/patch-configure_ac 20 Feb 2024 11:51:13 -0000 1.45 +++ patches/patch-configure_ac 19 Mar 2025 04:49:27 -0000 @@ -1,3 +1,8 @@ +- libass: fix fontconfig detection + d19599c42141eaf72cae9a0cb21b5889cd01c860 +- configure: look for backtrace() in libexecinfo + b3179e1e0993b8c15b735c93282c7675632c183c + Index: configure.ac --- configure.ac.orig +++ configure.ac @@ -34,7 +39,24 @@ Index: configure.ac dnl Check for fast maths AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS]) AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS]) -@@ -1668,7 +1651,7 @@ AC_ARG_ENABLE(lua, +@@ -1246,9 +1229,14 @@ case "${host_cpu}" in + esac + + dnl Check for backtrace() support +-AC_CHECK_HEADERS(execinfo.h) +-AC_CHECK_FUNCS(backtrace) ++AC_CHECK_HEADERS([execinfo.h]) ++AC_CHECK_FUNCS([backtrace],, [ ++ AC_CHECK_LIB([execinfo], [backtrace], [ ++ LIBEXECINFO="-lexecinfo"]) ++]) ++AC_SUBST(LIBEXECINFO) + ++ + dnl + dnl default modules + dnl +@@ -1668,7 +1656,7 @@ AC_ARG_ENABLE(lua, [disable LUA scripting support (default enabled)])]) if test "${enable_lua}" != "no" then @@ -43,3 +65,55 @@ Index: configure.ac [ have_lua=yes ], [ AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead]) +@@ -2989,25 +2977,6 @@ AS_IF( [test "${enable_telx}" != "no" ],[ + ]) + + dnl +-dnl libass subtitle rendering module +-dnl +-AC_ARG_ENABLE(libass, +- [ --enable-libass Subtitle support using libass (default enabled)]) +-AS_IF( [test "${enable_libass}" != "no"], [ +- PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8], +- [ +- VLC_ADD_PLUGIN([libass]) +- +- AC_CHECK_HEADERS(fontconfig/fontconfig.h, +- [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG]) +- VLC_ADD_LIBS([libass],[-lfontconfig]) +- ]) +- ],[ +- AC_MSG_WARN([${LIBASS_PKG_ERRORS}.]) +- ]) +- ]) +- +-dnl + dnl ARIB subtitles rendering module + dnl + AC_ARG_ENABLE(aribsub, +@@ -3346,6 +3315,25 @@ AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype + AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"]) + AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"]) + AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"]) ++ ++dnl ++dnl libass subtitle rendering module ++dnl ++AC_ARG_ENABLE(libass, ++ [ --enable-libass Subtitle support using libass (default enabled)]) ++AS_IF( [test "${enable_libass}" != "no"], [ ++ PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8], ++ [ ++ VLC_ADD_PLUGIN([libass]) ++ ++ if test "${have_fontconfig}" != "no"; then ++ VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG]) ++ VLC_ADD_LIBS([libass],[${FONTCONFIG_LIBS}]) ++ fi ++ ],[ ++ AC_MSG_WARN([${LIBASS_PKG_ERRORS}.]) ++ ]) ++ ]) + + dnl + dnl SAPI (text to Speech renderer for Windows) Index: patches/patch-modules_access_smb2_c =================================================================== RCS file: patches/patch-modules_access_smb2_c diff -N patches/patch-modules_access_smb2_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-modules_access_smb2_c 19 Mar 2025 04:49:27 -0000 @@ -0,0 +1,105 @@ +- smb2: prefix local functions with vlc_ + 9adc93c1a52e02c78d395660a52d4e276c49ee1f +- smb2: rework ShareEnum + 94db6cdc13b58c50dd98836e6e9aeec92851dbe7 +- smb2: update latest net share API + 8c8c28be69349435171f5bee237b807cee2b017d + +Index: modules/access/smb2.c +--- modules/access/smb2.c.orig ++++ modules/access/smb2.c +@@ -117,7 +117,11 @@ struct access_sys + struct smb2_context * smb2; + struct smb2fh * smb2fh; + struct smb2dir * smb2dir; ++#ifdef LIBSMB2_SHARE_ENUM_V2 ++ struct srvsvc_NetrShareEnum_rep *share_enum; ++#else + struct srvsvc_netshareenumall_rep *share_enum; ++#endif + uint64_t smb2_size; + vlc_url_t encoded_url; + bool eof; +@@ -161,7 +165,7 @@ vlc_smb2_op_reset(struct vlc_smb2_op *op, struct smb2_ + } + + static int +-smb2_check_status(struct vlc_smb2_op *op, const char *psz_func, int status) ++vlc_smb2_check_status(struct vlc_smb2_op *op, const char *psz_func, int status) + { + if (status < 0) + { +@@ -179,7 +183,7 @@ smb2_check_status(struct vlc_smb2_op *op, const char * + } + + static void +-smb2_set_error(struct vlc_smb2_op *op, const char *psz_func, int err) ++vlc_smb2_set_error(struct vlc_smb2_op *op, const char *psz_func, int err) + { + if (op->log && err != -EINTR) + msg_Err(op->log, "%s failed: %d, %s", psz_func, err, smb2_get_error(op->smb2)); +@@ -194,10 +198,10 @@ smb2_set_error(struct vlc_smb2_op *op, const char *psz + } + + #define VLC_SMB2_CHECK_STATUS(op, status) \ +- smb2_check_status(op, __func__, status) ++ vlc_smb2_check_status(op, __func__, status) + + #define VLC_SMB2_SET_ERROR(op, func, err) \ +- smb2_set_error(op, func, err) ++ vlc_smb2_set_error(op, func, err) + + #define VLC_SMB2_STATUS_DENIED(x) (x == -ECONNREFUSED || x == -EACCES) + +@@ -501,17 +505,33 @@ ShareEnum(stream_t *access, input_item_node_t *p_node) + struct vlc_readdir_helper rdh; + vlc_readdir_helper_init(&rdh, access, p_node); + ++#ifdef LIBSMB2_SHARE_ENUM_V2 ++ struct srvsvc_SHARE_INFO_1_CONTAINER *ctr = &sys->share_enum->ses.ShareInfo.Level1; ++ size_t ctr_count = ctr->EntriesRead; ++#else + struct srvsvc_netsharectr *ctr = sys->share_enum->ctr; ++ size_t ctr_count = ctr->ctr1.count; ++#endif ++ + for (uint32_t iinfo = 0; +- iinfo < ctr->ctr1.count && ret == VLC_SUCCESS; ++iinfo) ++ iinfo < ctr_count && ret == VLC_SUCCESS; ++iinfo) + { ++#ifdef LIBSMB2_SHARE_ENUM_V2 ++ struct srvsvc_SHARE_INFO_1 *info = &ctr->Buffer->share_info_1[iinfo]; ++ const char *name = info->netname.utf8; ++ uint32_t type = info->type; ++#else + struct srvsvc_netshareinfo1 *info = &ctr->ctr1.array[iinfo]; +- if (info->type & SHARE_TYPE_HIDDEN) ++ const char *name = info->name; ++ uint32_t type = info->type; ++#endif ++ ++ if (type & SHARE_TYPE_HIDDEN) + continue; +- switch (info->type & 0x3) ++ switch (type & 0x3) + { + case SHARE_TYPE_DISKTREE: +- ret = AddItem(access, &rdh, info->name, ITEM_TYPE_DIRECTORY); ++ ret = AddItem(access, &rdh, name, ITEM_TYPE_DIRECTORY); + break; + } + } +@@ -603,7 +623,13 @@ vlc_smb2_open_share(stream_t *access, struct smb2_cont + + int ret; + if (do_enum) ++ { ++#ifdef LIBSMB2_SHARE_ENUM_V2 ++ ret = smb2_share_enum_async(op.smb2, SHARE_INFO_1, smb2_open_cb, &op); ++#else + ret = smb2_share_enum_async(op.smb2, smb2_open_cb, &op); ++#endif ++ } + else + { + ret = smb2_stat_async(op.smb2, smb2_url->path, &smb2_stat, Index: patches/patch-src_Makefile_am =================================================================== RCS file: patches/patch-src_Makefile_am diff -N patches/patch-src_Makefile_am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_Makefile_am 19 Mar 2025 04:49:27 -0000 @@ -0,0 +1,14 @@ +- configure: look for backtrace() in libexecinfo + b3179e1e0993b8c15b735c93282c7675632c183c + +Index: src/Makefile.am +--- src/Makefile.am.orig ++++ src/Makefile.am +@@ -419,6 +419,7 @@ libvlccore_la_SOURCES += \ + darwin/specific.c \ + darwin/thread.c + else ++libvlccore_la_LIBADD += $(LIBEXECINFO) + libvlccore_la_SOURCES += \ + posix/dirs.c \ + posix/error.c \