Bug 270197 - cad/opencascade: Fails to build with FFmpeg 6.0
Summary: cad/opencascade: Fails to build with FFmpeg 6.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Thierry Thomas
URL: https://dev.opencascade.org/content/c...
Keywords:
Depends on:
Blocks: 261302
  Show dependency treegraph
 
Reported: 2023-03-14 10:51 UTC by Daniel Engberg
Modified: 2023-08-13 15:57 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (thierry)


Attachments
Patch for opencascade (1.99 KB, patch)
2023-04-26 11:56 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2023-03-14 10:51:30 UTC
This includes all variants:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261302#c46
Comment 1 Thierry Thomas freebsd_committer freebsd_triage 2023-03-14 17:55:37 UTC
Extract of the log:

[ 38% 2291/5992] /usr/bin/c++ -DHAVE_DRACO -DHAVE_FFMPEG -DHAVE_FREEIMAGE -DHAVE_FREETYPE -DHAVE_GLES2_EXT -DHAVE_OPENGL_EXT -DHAVE_RAPIDJSON -DHAVE_TK -DHAVE_VTK -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -DTKService_EXPORTS -DVTK_OPENGL2_BACKEND -I/usr/local/include/tcl8.6 -I/usr/local/include/tk8.6 -I/usr/local/include/freetype2 -I/usr/local/include/vtk-9.2 -I/usr/local/include/draco -I/wrkdirs/usr/ports/cad/opencascade/work/.build/usr/local/include/OpenCASCADE -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -fexceptions -fPIC -Wall -Wextra -Wshorten-64-to-32 -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -DNo_Exception -fPIC -std=gnu++11 -MD -MT src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o -MF src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o.d -o src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o -c /wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx
FAILED: src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o 
/usr/bin/c++ -DHAVE_DRACO -DHAVE_FFMPEG -DHAVE_FREEIMAGE -DHAVE_FREETYPE -DHAVE_GLES2_EXT -DHAVE_OPENGL_EXT -DHAVE_RAPIDJSON -DHAVE_TK -DHAVE_VTK -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -DTKService_EXPORTS -DVTK_OPENGL2_BACKEND -I/usr/local/include/tcl8.6 -I/usr/local/include/tk8.6 -I/usr/local/include/freetype2 -I/usr/local/include/vtk-9.2 -I/usr/local/include/draco -I/wrkdirs/usr/ports/cad/opencascade/work/.build/usr/local/include/OpenCASCADE -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -fexceptions -fPIC -Wall -Wextra -Wshorten-64-to-32 -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -DNo_Exception -fPIC -std=gnu++11 -MD -MT src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o -MF src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o.d -o src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o -c /wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx
/wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx:82:3: error: use of undeclared identifier 'av_register_all'
  av_register_all();
  ^
/wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx:140:35: error: no member named 'codec' in 'AVStream'
    avcodec_close (myVideoStream->codec);
                   ~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx:245:20: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
    myVideoCodec = avcodec_find_encoder_by_name (theParams.VideoCodec.ToCString());
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx:250:20: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
    myVideoCodec = avcodec_find_encoder ((AVCodecID )theDefCodecId);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx:268:46: error: no member named 'codec' in 'AVStream'
  AVCodecContext* aCodecCtx = myVideoStream->codec;
                              ~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx:300:46: error: no member named 'codec' in 'AVStream'
  AVCodecContext* aCodecCtx = myVideoStream->codec;
                              ~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx:440:46: error: no member named 'codec' in 'AVStream'
  AVCodecContext* aCodecCtx = myVideoStream->codec;
                              ~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/cad/opencascade/work/opencascade-7.7.0/src/Image/Image_VideoRecorder.cxx:458:14: error: use of undeclared identifier 'avcodec_encode_video2'
    aResAv = avcodec_encode_video2 (aCodecCtx, &aPacket, theToFlush ? NULL : myFrame, &isGotPacket);
             ^
8 errors generated.
Comment 2 George Mitchell 2023-03-28 23:21:14 UTC
Also experiencing this bug after the ffmpeg 6 update.
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2023-04-26 11:56:10 UTC
Created attachment 241757 [details]
Patch for opencascade

Move to FFmpeg 4 and add MASTER_SITE for cad/opencascade740
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-04-27 12:05:26 UTC
A commit in branch main references this bug:

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

commit a62d83a6772af22ab2d4542ac4ecf6aaac6d1a58
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-04-27 09:24:43 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-04-27 12:01:41 +0000

    cad/opencascade*: Move to FFmpeg 4

    Fails to build with FFmpeg 6

    PR:             270197
    Approved by:    portmgr (blanket, build fix)
    Sponsored by:   Blinkinblox

 cad/opencascade/Makefile    | 6 ++++--
 cad/opencascade740/Makefile | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)