diff --git a/common/shlibs b/common/shlibs index 9333f21d7d4c9e..226ee455e640a5 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4545,6 +4545,7 @@ libwcs.so.8 wcslib-8.4_1 libstellarsolver6.so.2 stellarsolver-2.7_1 libXISF.so.0 libxisf-0.2.9_1 libfwupd.so.3 fwupd-2.0.16_1 +libgpac.so.12 libgpac-2.4.0_1 libcmark-gfm.so.0 cmark-gfm-0.29.0.gfm.13_1 libcmark-gfm-extensions.so.0 cmark-gfm-0.29.0.gfm.13_1 libpisp.so.1 libpisp-1.3.0_1 diff --git a/srcpkgs/ccextractor/patches/0001-fix-ffmpeg-5-and-tesseract-5-compatibility-1479.patch b/srcpkgs/ccextractor/patches/0001-fix-ffmpeg-5-and-tesseract-5-compatibility-1479.patch deleted file mode 100644 index bcab4890554b9a..00000000000000 --- a/srcpkgs/ccextractor/patches/0001-fix-ffmpeg-5-and-tesseract-5-compatibility-1479.patch +++ /dev/null @@ -1,168 +0,0 @@ -From b1cbfcea9b9c687143bf0d80bc179b563e99d025 Mon Sep 17 00:00:00 2001 -From: Prateek Sunal -Date: Thu, 9 Mar 2023 01:44:53 +0530 -Subject: [PATCH] fix: ffmpeg 5 and tesseract 5 compatibility (#1479) - -* fix: replace deprecated `codec` property with `codecpar` - -* fix: replace deprecated method `avcodec_decode_video2` with `avcodec_receive_frame` and `avcodec_send_packet` - -* Update CHANGES.TXT - -* fix: remove deprecated `av_register_all` function - -* fix: formatting - -* fix: add support for tesseract 5 - -* fix: tesseract v5 - -* fix: hardsubx codec context error - -* fix: lint const warning ---- - docs/CHANGES.TXT | 1 + - src/lib_ccx/ffmpeg_intgr.c | 7 +++--- - src/lib_ccx/hardsubx.c | 25 ++++++++++++------ - src/lib_ccx/hardsubx_decoder.c | 27 ++++++++------------ - src/lib_ccx/ocr.c | 46 ++++++++++++---------------------- - 5 files changed, 47 insertions(+), 59 deletions(-) - -diff --git a/src/lib_ccx/ffmpeg_intgr.c b/src/lib_ccx/ffmpeg_intgr.c -index be988890..e6f21e20 100644 ---- a/src/lib_ccx/ffmpeg_intgr.c -+++ b/src/lib_ccx/ffmpeg_intgr.c -@@ -66,7 +66,6 @@ void *init_ffmpeg(const char *path) - struct ffmpeg_ctx *ctx; - AVCodec *dec = NULL; - avcodec_register_all(); -- av_register_all(); - - if (ccx_options.debug_mask & CCX_DMT_VERBOSE) - av_log_set_level(AV_LOG_INFO); -@@ -133,7 +132,6 @@ int ff_get_ccframe(void *arg, unsigned char *data, int maxlen) - struct ffmpeg_ctx *ctx = arg; - int len = 0; - int ret = 0; -- int got_frame; - AVPacket packet; - - ret = av_read_frame(ctx->ifmt, &packet); -@@ -151,12 +149,13 @@ int ff_get_ccframe(void *arg, unsigned char *data, int maxlen) - return AVERROR(EAGAIN); - } - -- ret = avcodec_decode_video2(ctx->dec_ctx, ctx->frame, &got_frame, &packet); -+ avcodec_send_packet(ctx->codec_ctx, &ctx->packet); -+ ret = avcodec_receive_frame(ctx->dec_ctx, ctx->frame); - if (ret < 0) - { - av_log(NULL, AV_LOG_ERROR, "unable to decode packet\n"); - } -- else if (!got_frame) -+ else if (ret != 0) - { - return AVERROR(EAGAIN); - } -diff --git a/src/lib_ccx/hardsubx.c b/src/lib_ccx/hardsubx.c -index 411377f9..fb844c91 100644 ---- a/src/lib_ccx/hardsubx.c -+++ b/src/lib_ccx/hardsubx.c -@@ -12,9 +12,6 @@ - - int hardsubx_process_data(struct lib_hardsubx_ctx *ctx) - { -- // Get the required media attributes and initialize structures -- av_register_all(); -- - if (avformat_open_input(&ctx->format_ctx, ctx->inputfile[0], NULL, NULL) != 0) - { - fatal(EXIT_READ_ERROR, "Error reading input file!\n"); -@@ -32,7 +29,7 @@ - ctx->video_stream_id = -1; - for (int i = 0; i < ctx->format_ctx->nb_streams; i++) - { -- if (ctx->format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) -+ if (ctx->format_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) - { - ctx->video_stream_id = i; - break; -@@ -43,8 +40,21 @@ - fatal(EXIT_READ_ERROR, "Video Stream not found!\n"); - } - -- ctx->codec_ctx = ctx->format_ctx->streams[ctx->video_stream_id]->codec; -- ctx->codec = avcodec_find_decoder(ctx->codec_ctx->codec_id); -+ ctx->codec_ctx = avcodec_alloc_context3(NULL); -+ if (!ctx->codec_ctx) -+ { -+ fatal(EXIT_NOT_ENOUGH_MEMORY, "Could not allocate codec context!\n"); -+ } -+ -+ // Assign codec parameters to codec context -+ if (avcodec_parameters_to_context(ctx->codec_ctx, ctx->format_ctx->streams[ctx->video_stream_id]->codecpar) < 0) -+ { -+ fatal(EXIT_READ_ERROR, "Could not initialize codec context!\n"); -+ } -+ -+ // Find decoder for the codec context -+ ctx->codec = (AVCodec *)avcodec_find_decoder(ctx->codec_ctx->codec_id); -+ - if (ctx->codec == NULL) - { - fatal(EXIT_READ_ERROR, "Input codec is not supported!\n"); -diff --git a/src/lib_ccx/hardsubx_decoder.c b/src/lib_ccx/hardsubx_decoder.c -index bd9b0980..b5dfaec4 100644 ---- a/src/lib_ccx/hardsubx_decoder.c -+++ b/src/lib_ccx/hardsubx_decoder.c -@@ -371,7 +371,6 @@ - int hardsubx_process_frames_tickertext(struct lib_hardsubx_ctx *ctx, struct encoder_ctx *enc_ctx) - { - // Search for ticker text at the bottom of the screen, such as in Russia TV1 or stock prices -- int got_frame; - int cur_sec = 0, total_sec, progress; - int frame_number = 0; - char *ticker_text = NULL; -@@ -382,8 +381,8 @@ - { - frame_number++; - //Decode the video stream packet -- avcodec_decode_video2(ctx->codec_ctx, ctx->frame, &got_frame, &ctx->packet); -- if (got_frame && frame_number % 1000 == 0) -+ avcodec_send_packet(ctx->codec_ctx, &ctx->packet); -+ if (avcodec_receive_frame(ctx->codec_ctx, ctx->frame) == 0 && frame_number % 1000 == 0) - { - // sws_scale is used to convert the pixel format to RGB24 from all other cases - sws_scale( -@@ -434,9 +433,8 @@ - frame_number++; - - //Decode the video stream packet -- avcodec_decode_video2(ctx->codec_ctx, ctx->frame, &got_frame, &ctx->packet); -- -- if (got_frame && frame_number % 25 == 0) -+ avcodec_send_packet(ctx->codec_ctx, &ctx->packet); -+ if (avcodec_receive_frame(ctx->codec_ctx, ctx->frame) == 0 && frame_number % 25 == 0) - { - float diff = (float)convert_pts_to_ms(ctx->packet.pts - prev_packet_pts, ctx->format_ctx->streams[ctx->video_stream_id]->time_base); - if (fabsf(diff) < 1000 * ctx->min_sub_duration) //If the minimum duration of a subtitle line is exceeded, process packet -@@ -548,7 +546,6 @@ - { - // Do a binary search over the input video for faster processing - // printf("Duration: %d\n", (int)ctx->format_ctx->duration); -- int got_frame; - int seconds_time = 0; - for (seconds_time = 0; seconds_time < 20; seconds_time++) - { -@@ -568,8 +565,9 @@ - { - if (ctx->packet.stream_index == ctx->video_stream_id) - { -- avcodec_decode_video2(ctx->codec_ctx, ctx->frame, &got_frame, &ctx->packet); -- if (got_frame) -+ avcodec_send_packet(ctx->codec_ctx, &ctx->packet); -+ if (avcodec_receive_frame(ctx->codec_ctx, ctx->frame) == 0) -+ - { - // printf("%d\n", seek_time); - if (ctx->packet.pts < seek_time) diff --git a/srcpkgs/ccextractor/patches/disable_arm_neon.patch b/srcpkgs/ccextractor/patches/disable_arm_neon.patch deleted file mode 100644 index 7ced78981903ed..00000000000000 --- a/srcpkgs/ccextractor/patches/disable_arm_neon.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/thirdparty/libpng/pngpriv.h 2021-06-13 21:05:33.000000000 +0200 -+++ b/src/thirdparty/libpng/pngpriv.h 2021-06-17 17:35:17.217940102 +0200 -@@ -107,6 +107,7 @@ - * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely - * do this. - */ -+#define PNG_ARM_NEON_OPT 0 - #ifndef PNG_ARM_NEON_OPT - /* ARM NEON optimizations are being controlled by the compiler settings, - * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon diff --git a/srcpkgs/ccextractor/patches/fix-ocr.patch b/srcpkgs/ccextractor/patches/fix-ocr.patch deleted file mode 100644 index 2681c60aa414e2..00000000000000 --- a/srcpkgs/ccextractor/patches/fix-ocr.patch +++ /dev/null @@ -1,106 +0,0 @@ ---- a/src/lib_ccx/hardsubx.c -+++ b/src/lib_ccx/hardsubx.c -@@ -221,7 +221,7 @@ - char *pars_values = strdup("/dev/null"); - char *tessdata_path = NULL; - -- char *lang = options->ocrlang; -+ char *lang = (char *)options->ocrlang; - if (!lang) - lang = "eng"; // English is default language - -@@ -245,7 +245,7 @@ - - int ret = -1; - -- if (!strncmp("4.", TessVersion(), 2)) -+ if (!strncmp("4.", TessVersion(), 2) || !strncmp("5.", TessVersion(), 2)) - { - char tess_path[1024]; - if (ccx_options.ocr_oem < 0) ---- a/src/lib_ccx/ocr.c -+++ b/src/lib_ccx/ocr.c -@@ -97,36 +97,22 @@ - char *probe_tessdata_location(const char *lang) - { - int ret = 0; -- char *tessdata_dir_path = getenv("TESSDATA_PREFIX"); - -- ret = search_language_pack(tessdata_dir_path, lang); -- if (!ret) -- return tessdata_dir_path; -- -- tessdata_dir_path = "./"; -- ret = search_language_pack(tessdata_dir_path, lang); -- if (!ret) -- return tessdata_dir_path; -- -- tessdata_dir_path = "/usr/share/"; -- ret = search_language_pack(tessdata_dir_path, lang); -- if (!ret) -- return tessdata_dir_path; -- -- tessdata_dir_path = "/usr/local/share/"; -- ret = search_language_pack(tessdata_dir_path, lang); -- if (!ret) -- return tessdata_dir_path; -- -- tessdata_dir_path = "/usr/share/tesseract-ocr/"; -- ret = search_language_pack(tessdata_dir_path, lang); -- if (!ret) -- return tessdata_dir_path; -- -- tessdata_dir_path = "/usr/share/tesseract-ocr/4.00/"; -- ret = search_language_pack(tessdata_dir_path, lang); -- if (!ret) -- return tessdata_dir_path; -+ const char *paths[] = { -+ getenv("TESSDATA_PREFIX"), -+ "./", -+ "/usr/share/", -+ "/usr/local/share/", -+ "/usr/share/tesseract-ocr/", -+ "/usr/share/tesseract-ocr/4.00/", -+ "/usr/share/tesseract-ocr/5/", -+ "/usr/share/tesseract/"}; -+ -+ for (int i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) -+ { -+ if (!search_language_pack(paths[i], lang)) -+ return (char *)paths[i]; -+ } - - return NULL; - } -@@ -174,7 +160,7 @@ - char *pars_values = strdup("tess.log"); - - ctx->api = TessBaseAPICreate(); -- if (!strncmp("4.", TessVersion(), 2)) -+ if (!strncmp("4.", TessVersion(), 2) || !strncmp("5.", TessVersion(), 2)) - { - char tess_path[1024]; - snprintf(tess_path, 1024, "%s%s%s", tessdata_path, "/", "tessdata"); -@@ -331,6 +317,11 @@ - } - - BOX *crop_points = ignore_alpha_at_edge(copy->alpha, copy->data, w, h, color_pix, &color_pix_out); -+ -+ l_int32 x, y, _w, _h; -+ -+ boxGetGeometry(crop_points, &x, &y, &_w, &_h); -+ - // Converting image to grayscale for OCR to avoid issues with transparency - cpix_gs = pixConvertRGBToGray(cpix, 0.0, 0.0, 0.0); - -@@ -426,8 +417,8 @@ - { - for (int j = x1; j <= x2; j++) - { -- if (copy->data[(crop_points->y + i) * w + (crop_points->x + j)] != firstpixel) -- histogram[copy->data[(crop_points->y + i) * w + (crop_points->x + j)]]++; -+ if (copy->data[(y + i) * w + (x + j)] != firstpixel) -+ histogram[copy->data[(y + i) * w + (x + j)]]++; - } - } - /* sorted in increasing order of intensity */ diff --git a/srcpkgs/ccextractor/patches/use-system-libs.patch b/srcpkgs/ccextractor/patches/use-system-libs.patch new file mode 100644 index 00000000000000..2c2c9a6cbc5b6b --- /dev/null +++ b/srcpkgs/ccextractor/patches/use-system-libs.patch @@ -0,0 +1,142 @@ +don't use bundled libraries for libpng, zlib, freetype, and utf8proc, +use system libraries instead + +--- a/linux/Makefile.am 2025-12-26 15:32:32.000000000 +0100 ++++ b/linux/Makefile.am 2025-12-27 10:11:07.069452562 +0100 +@@ -32,28 +32,6 @@ + /usr/include/gpac/internal/odf_dev.h \ + /usr/include/gpac/internal/odf_parse_common.h \ + /usr/include/gpac/internal/ogg.h \ +- ../src/thirdparty/libpng/pngstruct.h \ +- ../src/thirdparty/libpng/pngpriv.h \ +- ../src/thirdparty/libpng/pnginfo.h \ +- ../src/thirdparty/libpng/pnglibconf.h \ +- ../src/thirdparty/libpng/pngconf.h \ +- ../src/thirdparty/libpng/pngdebug.h \ +- ../src/thirdparty/libpng/png.h \ +- ../src/thirdparty/libpng/png.c \ +- ../src/thirdparty/libpng/pngerror.c \ +- ../src/thirdparty/libpng/pngget.c \ +- ../src/thirdparty/libpng/pngmem.c \ +- ../src/thirdparty/libpng/pngpread.c \ +- ../src/thirdparty/libpng/pngread.c \ +- ../src/thirdparty/libpng/pngrio.c \ +- ../src/thirdparty/libpng/pngrtran.c \ +- ../src/thirdparty/libpng/pngrutil.c \ +- ../src/thirdparty/libpng/pngset.c \ +- ../src/thirdparty/libpng/pngtrans.c \ +- ../src/thirdparty/libpng/pngwio.c \ +- ../src/thirdparty/libpng/pngwrite.c \ +- ../src/thirdparty/libpng/pngwtran.c \ +- ../src/thirdparty/libpng/pngwutil.c \ + ../src/lib_ccx/ccx_common_common.h \ + ../src/lib_ccx/ccx_common_option.h \ + ../src/lib_ccx/utility.h \ +@@ -172,34 +150,6 @@ + ../src/lib_ccx/ts_tables_epg.c \ + ../src/lib_ccx/wtv_constants.h \ + ../src/lib_ccx/wtv_functions.c \ +- ../src/thirdparty/zlib/adler32.c \ +- ../src/thirdparty/zlib/compress.c \ +- ../src/thirdparty/zlib/crc32.c \ +- ../src/thirdparty/zlib/crc32.h \ +- ../src/thirdparty/zlib/deflate.c \ +- ../src/thirdparty/zlib/deflate.h \ +- ../src/thirdparty/zlib/gzclose.c \ +- ../src/thirdparty/zlib/gzguts.h \ +- ../src/thirdparty/zlib/gzlib.c \ +- ../src/thirdparty/zlib/gzread.c \ +- ../src/thirdparty/zlib/gzwrite.c \ +- ../src/thirdparty/zlib/infback.c \ +- ../src/thirdparty/zlib/inffast.c \ +- ../src/thirdparty/zlib/inffast.h \ +- ../src/thirdparty/zlib/inffixed.h \ +- ../src/thirdparty/zlib/inflate.c \ +- ../src/thirdparty/zlib/inflate.h \ +- ../src/thirdparty/zlib/inftrees.c \ +- ../src/thirdparty/zlib/inftrees.h \ +- ../src/thirdparty/zlib/trees.c \ +- ../src/thirdparty/zlib/trees.h \ +- ../src/thirdparty/zlib/uncompr.c \ +- ../src/thirdparty/zlib/zconf.h \ +- ../src/thirdparty/zlib/zlib.h \ +- ../src/thirdparty/zlib/zutil.c \ +- ../src/thirdparty/zlib/zutil.h \ +- ../src/thirdparty/utf8proc/utf8proc.c \ +- ../src/thirdparty/utf8proc/utf8proc.h \ + ../src/thirdparty/lib_hash/sha2.c \ + ../src/thirdparty/lib_hash/sha2.h \ + ../src/lib_ccx/zvbi/bcd.h \ +@@ -213,67 +163,18 @@ + ../src/lib_ccx/zvbi/sampling_par.c \ + ../src/lib_ccx/zvbi/sampling_par.h \ + ../src/lib_ccx/zvbi/sliced.h \ +- ../src/lib_ccx/zvbi/zvbi_decoder.h \ +- ../src/freetype/* \ +- ../src/thirdparty/freetype/autofit/autofit.c \ +- ../src/thirdparty/freetype/base/ftbase.c \ +- ../src/thirdparty/freetype/base/ftbbox.c \ +- ../src/thirdparty/freetype/base/ftbdf.c \ +- ../src/thirdparty/freetype/base/ftbitmap.c \ +- ../src/thirdparty/freetype/base/ftcid.c \ +- ../src/thirdparty/freetype/base/ftfntfmt.c \ +- ../src/thirdparty/freetype/base/ftfstype.c \ +- ../src/thirdparty/freetype/base/ftgasp.c \ +- ../src/thirdparty/freetype/base/ftglyph.c \ +- ../src/thirdparty/freetype/base/ftgxval.c \ +- ../src/thirdparty/freetype/base/ftinit.c \ +- ../src/thirdparty/freetype/base/ftlcdfil.c \ +- ../src/thirdparty/freetype/base/ftmm.c \ +- ../src/thirdparty/freetype/base/ftotval.c \ +- ../src/thirdparty/freetype/base/ftpatent.c \ +- ../src/thirdparty/freetype/base/ftpfr.c \ +- ../src/thirdparty/freetype/base/ftstroke.c \ +- ../src/thirdparty/freetype/base/ftsynth.c \ +- ../src/thirdparty/freetype/base/ftsystem.c \ +- ../src/thirdparty/freetype/base/fttype1.c \ +- ../src/thirdparty/freetype/base/ftwinfnt.c \ +- ../src/thirdparty/freetype/bdf/bdf.c \ +- ../src/thirdparty/freetype/bzip2/ftbzip2.c \ +- ../src/thirdparty/freetype/cache/ftcache.c \ +- ../src/thirdparty/freetype/cff/cff.c \ +- ../src/thirdparty/freetype/cid/type1cid.c \ +- ../src/thirdparty/freetype/gzip/ftgzip.c \ +- ../src/thirdparty/freetype/include/ft2build.h \ +- ../src/thirdparty/freetype/lzw/ftlzw.c \ +- ../src/thirdparty/freetype/pcf/pcf.c \ +- ../src/thirdparty/freetype/pfr/pfr.c \ +- ../src/thirdparty/freetype/psaux/psaux.c \ +- ../src/thirdparty/freetype/pshinter/pshinter.c \ +- ../src/thirdparty/freetype/psnames/psnames.c \ +- ../src/thirdparty/freetype/raster/raster.c \ +- ../src/thirdparty/freetype/sfnt/sfnt.c \ +- ../src/thirdparty/freetype/smooth/smooth.c \ +- ../src/thirdparty/freetype/truetype/truetype.c \ +- ../src/thirdparty/freetype/type1/type1.c \ +- ../src/thirdparty/freetype/type42/type42.c \ +- ../src/thirdparty/freetype/winfonts/winfnt.c +- +-if SYS_IS_APPLE_SILICON +-ccextractor_SOURCES += ../src/thirdparty/libpng/arm/arm_init.c \ +- ../src/thirdparty/libpng/arm/filter_neon_intrinsics.c \ +- ../src/thirdparty/libpng/arm/palette_neon_intrinsics.c +-endif ++ ../src/lib_ccx/zvbi/zvbi_decoder.h + +-ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP ++ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP + +-ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I/usr/include/ -I../src/thirdparty/libpng/ -I../src/thirdparty/zlib/ -I../src/lib_ccx/zvbi/ -I../src/thirdparty/lib_hash/ -I../src/thirdparty -I../src/ -I../src/thirdparty/freetype/include/ ++ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I@@XBPS_CROSS_BASE@/usr/include/ -I../src/lib_ccx/zvbi/ -I../src/thirdparty/lib_hash/ -I../src/thirdparty -I../src/ -I@@XBPS_CROSS_BASE@@/usr/include/freetype2/ + + +-ccextractor_LDADD=-lm -lpthread -ldl -lgpac ++ccextractor_LDADD=-lm -lpthread -ldl -lgpac -lz -lpng -lfreetype -lutf8proc + + + if SYS_IS_LINUX +-ccextractor_CFLAGS += -O3 -s ++ccextractor_CFLAGS += -O2 + endif + + if SYS_IS_MAC diff --git a/srcpkgs/ccextractor/template b/srcpkgs/ccextractor/template index 5d922ac0e442f7..3de9a46456e945 100644 --- a/srcpkgs/ccextractor/template +++ b/srcpkgs/ccextractor/template @@ -1,25 +1,33 @@ # Template file for 'ccextractor' pkgname=ccextractor -version=0.93 -revision=3 +version=0.96.4 +revision=1 build_wrksrc="linux" build_style=gnu-configure +build_helper=rust configure_args="--enable-ocr --enable-hardsubx" -hostmakedepends="automake pkg-config tesseract-ocr-devel" -makedepends="leptonica-devel tesseract-ocr-devel ffmpeg6-devel" +hostmakedepends="automake cargo clang pkg-config tesseract-ocr-devel" +makedepends="ffmpeg6-devel freetype-devel leptonica-devel libgpac-devel + libpng-devel libutf8proc-devel rust-std tesseract-ocr-devel zlib-devel" short_desc="Extract subtitles from video streams" maintainer="newbluemoon " license="GPL-2.0-or-later" homepage="https://www.ccextractor.org/" changelog="https://raw.githubusercontent.com/CCExtractor/ccextractor/master/docs/CHANGES.TXT" distfiles="https://github.com/CCExtractor/${pkgname}/archive/v${version}.tar.gz" -checksum=0e66d3e360db1b02a88271af11313ca4c9bbda1b03728e264a44c4c9f77192e3 -CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/tesseract -DPNG_POWERPC_VSX_OPT=0" +checksum=40ed25e2d7fa49bf558dc370bad6caf0150726ccbdb63856fa195a4324acfdff +CFLAGS="-DPNG_POWERPC_VSX_OPT=0" pre_configure() { - vsed -i configure.ac \ - -e "s/tesseract --version/tesseract-ocr --version/g" \ - -e "s/\[lept\]/[leptonica]/" + vsed -i configure.ac -e "s;tesseract --version;tesseract-ocr --version;g" + vsed -i Makefile.am -e "s;@@XBPS_CROSS_BASE@@;${XBPS_CROSS_BASE};g" + + # in cross builds the path to the rust output is prefixed with the cross triplet, + # make the linker find it + if [ "$CROSS_BUILD" ]; then + vsed -i Makefile.am -e "s;@RUST_TARGET_SUBDIR@;${XBPS_CROSS_RUST_TARGET}/&;g" + fi + ./autogen.sh } diff --git a/srcpkgs/gpac/patches/ffmpeg6-fix.patch b/srcpkgs/gpac/patches/ffmpeg6-fix.patch new file mode 100644 index 00000000000000..fb95566c6a65b3 --- /dev/null +++ b/srcpkgs/gpac/patches/ffmpeg6-fix.patch @@ -0,0 +1,14 @@ +https://github.com/gpac/gpac/issues/2810 +https://github.com/gpac/gpac/commit/8d7cac0bf9f9775cae1d43de7138206758f28b0c + +--- a/src/filters/ff_mx.c 2024-04-17 19:18:21.000000000 +0200 ++++ b/src/filters/ff_mx.c 2025-12-26 17:02:48.872144615 +0100 +@@ -31,7 +31,7 @@ + #include + #include + +-#if (LIBAVFORMAT_VERSION_MAJOR <= 56) ++#if (LIBAVFORMAT_VERSION_MAJOR <= 61) + #undef GPAC_HAS_FFMPEG + #endif + diff --git a/srcpkgs/gpac/patches/musl.patch b/srcpkgs/gpac/patches/musl.patch new file mode 100644 index 00000000000000..b2e88ef0d369a4 --- /dev/null +++ b/srcpkgs/gpac/patches/musl.patch @@ -0,0 +1,10 @@ +--- a/src/utils/Remotery.c 2024-04-17 19:18:21.000000000 +0200 ++++ b/src/utils/Remotery.c 2025-12-26 22:13:17.987651472 +0100 +@@ -130,6 +130,7 @@ + #include + #include + #include ++ #include + #endif + + #ifdef __MINGW32__ diff --git a/srcpkgs/gpac/template b/srcpkgs/gpac/template new file mode 100644 index 00000000000000..34146ae41a4c03 --- /dev/null +++ b/srcpkgs/gpac/template @@ -0,0 +1,36 @@ +# Template file for 'gpac' +pkgname=gpac +version=2.4.0 +revision=1 +build_style=configure +configure_args="--prefix=/usr --enable-pic" +hostmakedepends="pkg-config" +makedepends="alsa-lib-devel faad2-devel ffmpeg6-devel freetype-devel jack-devel + libcaca-devel libjpeg-turbo-devel liblzma-devel libmad-devel libopenjpeg2-devel + libpng-devel libtheora-devel libvorbis-devel libXv-devel nghttp2-devel + openssl-devel pulseaudio-devel SDL2-devel zlib-devel" +short_desc="Framework for production, encoding, delivery, playback of media content" +maintainer="newbluemoon " +license="LGPL-2.1-or-later" +homepage="https://gpack.io/" +changelog="https://raw.githubusercontent.com/gpac/gpac/refs/heads/master/Changelog" +distfiles="https://github.com/gpac/gpac/archive/refs/tags/v${version}.tar.gz" +checksum=99c8c994d5364b963d18eff24af2576b38d38b3460df27d451248982ea16157a + +libgpac_package() { + short_desc+=" - shared libraries" + pkg_install() { + vmove "usr/lib/*.so.*" + } +} + +libgpac-devel_package() { + depends="libgpac-${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/pkgconfig + vmove "usr/lib/*.a" + vmove "usr/lib/*.so" + } +} diff --git a/srcpkgs/libgpac b/srcpkgs/libgpac new file mode 120000 index 00000000000000..0926771faf8c06 --- /dev/null +++ b/srcpkgs/libgpac @@ -0,0 +1 @@ +gpac \ No newline at end of file diff --git a/srcpkgs/libgpac-devel b/srcpkgs/libgpac-devel new file mode 120000 index 00000000000000..0926771faf8c06 --- /dev/null +++ b/srcpkgs/libgpac-devel @@ -0,0 +1 @@ +gpac \ No newline at end of file