diff --git a/src/meson.build b/src/meson.build index fab7f0d2..2a466074 100755 --- a/src/meson.build +++ b/src/meson.build @@ -278,6 +278,14 @@ if is_libretro 'zlib': 'disabled', } global_dependencies += subproject('freetype', default_options: freetype_options).get_variable('freetype_dep') + + theora_options = { + 'cflags': global_args, + 'cppflags': global_args, + 'default_library': 'static', + 'b_staticpic': use_pic, + } + global_dependencies += subproject('theora', default_options: theora_options).get_variable('theoradec') else physfs = dependency('physfs', version: '>=2.1', static: build_static) openal = dependency('openal', static: build_static, method: 'pkg-config') diff --git a/subprojects/packagefiles/flac-deps.patch b/subprojects/packagefiles/flac-deps.patch index e8730db0..8978f3dc 100644 --- a/subprojects/packagefiles/flac-deps.patch +++ b/subprojects/packagefiles/flac-deps.patch @@ -1,4 +1,4 @@ -# Prevents FLAC's build system from trying to look for Ogg externally since Meson already handles that. +# Prevents FLAC from trying to look for Ogg externally since Meson already handles that. --- a/src/libFLAC/include/private/ogg_decoder_aspect.h +++ b/src/libFLAC/include/private/ogg_decoder_aspect.h diff --git a/subprojects/packagefiles/opengl-registry/meson.build b/subprojects/packagefiles/opengl-registry/meson.build index 7e82fa99..f970f217 100644 --- a/subprojects/packagefiles/opengl-registry/meson.build +++ b/subprojects/packagefiles/opengl-registry/meson.build @@ -1,2 +1,2 @@ project('opengl-registry', 'c', meson_version: '>=1.3.0') -opengl_registry = declare_dependency(include_directories: 'api', dependencies: [subproject('egl-registry').get_variable('egl_registry')]) +opengl_registry = declare_dependency(include_directories: 'api', dependencies: subproject('egl-registry').get_variable('egl_registry')) diff --git a/subprojects/packagefiles/theora-deps.patch b/subprojects/packagefiles/theora-deps.patch new file mode 100644 index 00000000..3f2b98d7 --- /dev/null +++ b/subprojects/packagefiles/theora-deps.patch @@ -0,0 +1,121 @@ +# Prevents Theora from trying to look for Ogg externally since Meson already handles that. + +--- a/include/theora/codec.h ++++ b/include/theora/codec.h +@@ -63,7 +63,7 @@ + + #if !defined(OGG_THEORA_CODEC_HEADER) + # define OGG_THEORA_CODEC_HEADER (1) +-# include ++# include "../../../ogg/include/ogg/ogg.h" + + #if defined(__cplusplus) + extern "C" { +--- a/include/theora/theora.h ++++ b/include/theora/theora.h +@@ -24,7 +24,7 @@ extern "C" + + #include /* for size_t */ + +-#include ++#include "../../../ogg/include/ogg/ogg.h" + + /** \file + * The libtheora pre-1.0 legacy C API. +--- a/include/theora/theoradec.h ++++ b/include/theora/theoradec.h +@@ -20,7 +20,7 @@ + #if !defined(OGG_THEORA_THEORADEC_HEADER) + # define OGG_THEORA_THEORADEC_HEADER (1) + # include +-# include ++# include "../../../ogg/include/ogg/ogg.h" + # include "codec.h" + + #if defined(__cplusplus) +--- a/include/theora/theoraenc.h ++++ b/include/theora/theoraenc.h +@@ -20,7 +20,7 @@ + #if !defined(OGG_THEORA_THEORAENC_HEADER) + # define OGG_THEORA_THEORAENC_HEADER (1) + # include +-# include ++# include "../../../ogg/include/ogg/ogg.h" + # include "codec.h" + + #if defined(__cplusplus) +--- a/lib/apiwrapper.h ++++ b/lib/apiwrapper.h +@@ -17,7 +17,7 @@ + + #if !defined(_apiwrapper_H) + # define _apiwrapper_H (1) +-# include ++# include "../../ogg/include/ogg/ogg.h" + # include + # include "theora/theoradec.h" + # include "theora/theoraenc.h" +--- a/lib/decode.c ++++ b/lib/decode.c +@@ -17,7 +17,7 @@ + + #include + #include +-#include ++#include "../../ogg/include/ogg/ogg.h" + #include "decint.h" + #if defined(OC_DUMP_IMAGES) + # include +--- a/lib/dequant.c ++++ b/lib/dequant.c +@@ -17,7 +17,7 @@ + + #include + #include +-#include ++#include "../../ogg/include/ogg/ogg.h" + #include "dequant.h" + #include "decint.h" + +--- a/lib/huffdec.c ++++ b/lib/huffdec.c +@@ -17,7 +17,7 @@ + + #include + #include +-#include ++#include "../../ogg/include/ogg/ogg.h" + #include "huffdec.h" + #include "decint.h" + +--- a/lib/huffenc.c ++++ b/lib/huffenc.c +@@ -1,6 +1,6 @@ + #include + #include +-#include ++#include "../../ogg/include/ogg/ogg.h" + #include "huffenc.h" + + +--- a/lib/mathops.h ++++ b/lib/mathops.h +@@ -1,6 +1,6 @@ + #if !defined(_mathops_H) + # define _mathops_H (1) +-# include ++# include "../../ogg/include/ogg/ogg.h" + + # if __GNUC_PREREQ(3,4) + # include +--- a/lib/quant.c ++++ b/lib/quant.c +@@ -17,7 +17,7 @@ + + #include + #include +-#include ++#include "../../ogg/include/ogg/ogg.h" + #include "quant.h" + #include "decint.h" + diff --git a/subprojects/packagefiles/theora/meson.build b/subprojects/packagefiles/theora/meson.build new file mode 100644 index 00000000..a769bde1 --- /dev/null +++ b/subprojects/packagefiles/theora/meson.build @@ -0,0 +1,27 @@ +project('theora', 'c', meson_version: '>=1.3.0') + +theoradec = declare_dependency( + include_directories: 'include', + link_with: library( + 'theoradec', + c_args: get_option('cflags'), + include_directories: 'include', + sources: [ + 'lib/apiwrapper.c', + 'lib/bitpack.c', + 'lib/decapiwrapper.c', + 'lib/decinfo.c', + 'lib/decode.c', + 'lib/dequant.c', + 'lib/fragment.c', + 'lib/huffdec.c', + 'lib/idct.c', + 'lib/info.c', + 'lib/internal.c', + 'lib/quant.c', + 'lib/state.c', + ], + pic: get_option('b_staticpic'), + gnu_symbol_visibility: 'hidden', + ), +) diff --git a/subprojects/packagefiles/theora/meson_options.txt b/subprojects/packagefiles/theora/meson_options.txt new file mode 100644 index 00000000..6e9bf777 --- /dev/null +++ b/subprojects/packagefiles/theora/meson_options.txt @@ -0,0 +1,2 @@ +option('cflags', type: 'array', value: []) +option('cppflags', type: 'array', value: []) diff --git a/subprojects/packagefiles/vorbis-deps.patch b/subprojects/packagefiles/vorbis-deps.patch index 6561e0dd..3beee9ab 100644 --- a/subprojects/packagefiles/vorbis-deps.patch +++ b/subprojects/packagefiles/vorbis-deps.patch @@ -1,4 +1,4 @@ -# Prevents Vorbis's build system from trying to look for Ogg externally since Meson already handles that. +# Prevents Vorbis from trying to look for Ogg externally since Meson already handles that. --- a/CMakeLists.txt +++ b/CMakeLists.txt diff --git a/subprojects/theora.wrap b/subprojects/theora.wrap new file mode 100644 index 00000000..520459b6 --- /dev/null +++ b/subprojects/theora.wrap @@ -0,0 +1,6 @@ +[wrap-git] +url = https://github.com/xiph/theora +revision = v1.2.0 +depth = 1 +patch_directory = theora +diff_files = theora-deps.patch