arch1t3cht / Aegisub

Cross-platform advanced subtitle editor, with new feature branches. Read the README on the feature branch.
http://www.aegisub.org
Other
805 stars 34 forks source link

failed to compile ffmpeg wrap on linux container #123

Open 0tkl opened 7 months ago

0tkl commented 7 months ago

The WIP CI failed on every distros that need to build ffmpeg 6.1 by ourselves, log:

[260/2836] Generating subprojects/ffmpeg/postproc-def with a custom command (wrapped by meson to capture output)
FAILED: subprojects/ffmpeg/postproc.def 
/usr/bin/meson --internal exe --capture subprojects/ffmpeg/postproc.def -- /usr/bin/python3 /__w/Aegisub/Aegisub/subprojects/ffmpeg/compat/windows/makedef.py --nm /usr/bin/nm --prefix '' --vscript subprojects/ffmpeg/libpostproc/libpostproc.ver subprojects/ffmpeg/libpostproc-static.a
--- stderr ---
usage: makedef.py [-h] [--prefix PREFIX]
                  (--nm NM_PATH | --dumpbin DUMPBIN_PATH | --list)
                  (--regex REGEX [REGEX ...] | --vscript VERSION_SCRIPT) --os
                  {win,linux,darwin}
                  FILE
makedef.py: error: the following arguments are required: --os
[270/2836] Generating subprojects/ffmpeg/avutil-def with a custom command (wrapped by meson to capture output)
FAILED: subprojects/ffmpeg/avutil.def 
/usr/local/bin/meson --internal exe --capture subprojects/ffmpeg/avutil.def -- /usr/bin/python3 /__w/Aegisub/Aegisub/subprojects/ffmpeg/compat/windows/makedef.py --nm /usr/bin/nm --prefix '' --vscript subprojects/ffmpeg/libavutil/libavutil.ver subprojects/ffmpeg/libavutil-static.a
--- stderr ---
usage: makedef.py [-h] [--prefix PREFIX]
                  (--nm NM_PATH | --dumpbin DUMPBIN_PATH | --list)
                  (--regex REGEX [REGEX ...] | --vscript VERSION_SCRIPT) --os
                  {win,linux,darwin}
                  FILE
makedef.py: error: the following arguments are required: --os

Upstream meson.build, Line 2979-2983:

if host_machine.system() == 'windows'
  makedef_args += ['--os', 'win']
elif host_machine.system() in ['darwin', 'ios']
  makedef_args += ['--os', 'darwin']
endif

Upstream makedef.py, Line 64-66:

arg_parser.add_argument('--os', type=str, choices=('win', 'linux', 'darwin'),
                        default='linux', required=True,
                        help='Target operating system for the exports file (win = MSVC module definition file, linux = version script, darwin = exported symbols list)')

I haven't figured out why the default value did not take effect… Anyway, a quick patch can be applied:

if host_machine.system() == 'windows'
  makedef_args += ['--os', 'win']
elif host_machine.system() in ['darwin', 'ios']
  makedef_args += ['--os', 'darwin']
+else
+  makedef_args += ['--os', 'linux']
endif