Aegisub/subprojects/packagefiles/ffmpeg/0001.patch
arch1t3cht c67ba9f70c Update ffmpeg wrap to 6.0 following ffms2 updates
Also bump libdav1d and turn the wrap patches into diffs. This requires
bumping the minimum meson version to 0.63, but meson 1.0 is available
pretty much everywhere now so this should be fine.
2023-10-13 23:46:11 +02:00

101 lines
3.6 KiB
Diff

diff --git a/meson.build b/meson.build
index 688b368859..dc9d18acd5 100644
--- a/meson.build
+++ b/meson.build
@@ -1037,7 +1037,7 @@ check_components = [
['user32', ['windows.h', 'winuser.h'], ['GetShellWindow'], ['user32']],
['vfw32', ['windows.h', 'vfw.h'], ['capCreateCaptureWindow'], ['vfw3']],
['vaapi', ['va/va.h'], ['vaInitialize'], ['va']],
- ['zlib', ['zlib.h'], ['zlibVersion'], ['z']],
+ ['zlib', ['zlib.h'], ['zlibVersion'], ['z'], {'meson-dep': 'zlib'}],
# Libraries with preconditions
['vaapi_drm', ['va/va.h', 'va/va_drm.h'], ['vaGetDisplayDRM'], ['va', 'va-drm'],
@@ -1925,6 +1925,7 @@ foreach check : all_checks
prefix = ''
found = true
+ skipchecks = false
preconditions = opts.get('preconditions', [])
@@ -1980,6 +1981,11 @@ foreach check : all_checks
req = false
endif
dep = cc.find_library(link_with, required : req)
+ if not dep.found() and opts.has_key('meson-dep')
+ dep = dependency(opts.get('meson-dep'), required: false)
+ # We can't do compiler checks for non-external dependencies, so skip them and trust the meson dependency
+ skipchecks = true
+ endif
found = found and dep.found()
extra_deps += dep
endforeach
@@ -2009,7 +2015,8 @@ foreach check : all_checks
else
dep = dependency(pkg_name, required : req)
endif
- found = dep.found() and dep.type_name() != 'internal'
+ found = dep.found()
+ skipchecks = dep.type_name() == 'internal' # same here, trust the meson dependency
extra_deps += dep
endif
endif
@@ -2023,14 +2030,14 @@ foreach check : all_checks
endif
if not conf.has(header.underscorify())
- has_header = cc.has_header(header, dependencies: extra_deps)
+ has_header = skipchecks or cc.has_header(header, dependencies: extra_deps)
conf.set10(header.underscorify().to_lower(), has_header)
found = found and has_header
endif
endforeach
endif
- if found
+ if found and not skipchecks
n_funcs_found = 0
foreach symbol : funcs
if check_type == 'header-func'
@@ -2050,7 +2057,7 @@ foreach check : all_checks
endif
endif
- if found
+ if found and not skipchecks
n_defines_found = 0
foreach symbol : defines
if cc.get_define(symbol, dependencies : extra_deps, prefix: prefix, args : c_args + project_c_args) != ''
@@ -2060,15 +2067,15 @@ foreach check : all_checks
found = n_defines_found == defines.length()
endif
- if found and compiles != ''
+ if found and compiles != '' and not skipchecks
found = cc.compiles('\n\n'.join([prefix, compiles]), dependencies : extra_deps, args : c_args + project_c_args, name: name)
endif
- if found and links != ''
+ if found and links != '' and not skipchecks
found = cc.links('\n\n'.join([prefix, links]), dependencies : extra_deps, args : c_args + project_c_args, name: name)
endif
- if found and type != ''
+ if found and type != '' and not skipchecks
found = cc.has_type(type, prefix : prefix, dependencies : extra_deps, args : c_args + project_c_args)
endif
@@ -3087,6 +3094,11 @@ foreach a: arch_list
endforeach
foreach have: have_list
+ if have == 'unistd_h' and conf.get(have) == 0
+ # an atrocious hack to get this working with the zlib subproject on windows...
+ # zlib also uses a HAVE_UNISTD_H define, but it checks it with #ifdef and not #if
+ continue
+ endif
final_conf.set('HAVE_@0@'.format(have.to_upper()), conf.get(have.to_lower()))
endforeach