Aegisub/subprojects/packagefiles/bestsource/0001.patch

67 lines
2.2 KiB
Diff

diff --git a/meson.build b/meson.build
index 38de461..d56af62 100644
--- a/meson.build
+++ b/meson.build
@@ -2,10 +2,6 @@ project('BestSource', 'cpp',
default_options: ['buildtype=release', 'b_lto=true', 'b_ndebug=if-release', 'cpp_std=c++14'],
license: 'MIT',
meson_version: '>=0.53.0',
- version: '.'.join([
- run_command('grep', 'BEST_SOURCE_VERSION_MAJOR', 'src/version.h', check: true).stdout().strip().split()[2],
- run_command('grep', 'BEST_SOURCE_VERSION_MINOR', 'src/version.h', check: true).stdout().strip().split()[2]
- ])
)
link_static = get_option('link_static')
@@ -15,7 +11,6 @@ sources = [
'src/BSRational.cpp',
'src/BSShared.cpp',
'src/SrcAttribCache.cpp',
- 'src/vapoursynth.cpp',
'src/videosource.cpp'
]
@@ -46,17 +41,23 @@ if host_machine.cpu_family().startswith('x86')
)
endif
-vapoursynth_dep = dependency('vapoursynth', version: '>=55').partial_dependency(compile_args: true, includes: true)
-
deps = [
- vapoursynth_dep,
- dependency('jansson', version: '>=2.12', static: link_static),
dependency('libavcodec', version: '>=60.31.0', static: link_static),
dependency('libavformat', version: '>=60.16.0', static: link_static),
dependency('libavutil', version: '>=58.29.0', static: link_static),
dependency('libswscale', version: '>=7.5.0', static: link_static)
]
+jansson_dep = dependency('jansson', version: '>= 2.12', required: false)
+
+if jansson_dep.found()
+ deps += jansson_dep
+else
+ cmake = import('cmake')
+ jansson = cmake.subproject('jansson')
+ deps += jansson.dependency('jansson')
+endif
+
is_gnu_linker = meson.get_compiler('cpp').get_linker_id() in ['ld.bfd', 'ld.gold', 'ld.mold']
link_args = []
@@ -66,11 +67,11 @@ elif is_gnu_linker
link_args += ['-Wl,-Bsymbolic']
endif
-shared_module('bestsource', sources,
+bs_lib = static_library('bestsource', sources,
dependencies: deps,
gnu_symbol_visibility: 'hidden',
- install: true,
- install_dir: vapoursynth_dep.get_variable(pkgconfig: 'libdir') / 'vapoursynth',
link_args: link_args,
link_with: libs
)
+
+bestsource_dep = declare_dependency(link_with: bs_lib, include_directories: include_directories('src'))