Skip to content

Commit

Permalink
Add gstreamer port to try and fix linux builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Oct 11, 2024
1 parent c46fb82 commit 2610f35
Show file tree
Hide file tree
Showing 16 changed files with 1,638 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vcpkg/ports/gstreamer/base-must-be-enabled.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/meson.build b/meson.build
index 6d07929..df015cb 100644
--- a/meson.build
+++ b/meson.build
@@ -159,7 +159,7 @@ foreach sp : subprojects
subproj = subproject(project_name, required: is_required, default_options: default_options)
endif

- if project_name == 'gst-plugins-base'
+ if project_name == 'gst-plugins-base' and subproj.found()
gst_base_orc_req = subproj.get_variable('orc_req', '')
if gst_base_orc_req != orc_req
error('orc_req is "@0@" but it should be "@1@" from subprojects/gst-plugins-base/meson.build'
26 changes: 26 additions & 0 deletions vcpkg/ports/gstreamer/fix-bz2-windows-debug-dependency.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/subprojects/gst-plugins-bad/ext/bz2/meson.build b/subprojects/gst-plugins-bad/ext/bz2/meson.build
index 08d1596..be5fa02 100644
--- a/subprojects/gst-plugins-bad/ext/bz2/meson.build
+++ b/subprojects/gst-plugins-bad/ext/bz2/meson.build
@@ -4,7 +4,7 @@ bz2_sources = [
'gstbz2enc.c',
]

-bz2_dep = cc.find_library('bz2', required : get_option('bz2'))
+bz2_dep = dependency('bzip2', required : get_option('bz2'))

if bz2_dep.found() and cc.has_header_symbol('bzlib.h', 'BZ2_bzlibVersion')
gstbz2 = library('gstbz2',
diff --git a/subprojects/gst-plugins-good/gst/matroska/meson.build b/subprojects/gst-plugins-good/gst/matroska/meson.build
index d8a6a96..dd03de2 100644
--- a/subprojects/gst-plugins-good/gst/matroska/meson.build
+++ b/subprojects/gst-plugins-good/gst/matroska/meson.build
@@ -12,7 +12,7 @@ matroska_sources = [
'lzo.c',
]

-bz2_dep = cc.find_library('bz2', required : get_option('bz2'))
+bz2_dep = dependency('bzip2', required : get_option('bz2'))
cdata.set('HAVE_BZ2', bz2_dep.found() and cc.has_header('bzlib.h'))

gstmatroska = library('gstmatroska',
111 changes: 111 additions & 0 deletions vcpkg/ports/gstreamer/fix-clang-cl-bad.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
diff --git a/subprojects/gst-plugins-bad/ext/dts/meson.build b/subprojects/gst-plugins-bad/ext/dts/meson.build
index c4868a4..6b34cb7 100644
--- a/subprojects/gst-plugins-bad/ext/dts/meson.build
+++ b/subprojects/gst-plugins-bad/ext/dts/meson.build
@@ -20,7 +20,7 @@ if not dca_dep.found()
endif

no_warn_c_args = []
-if cc.get_id() != 'msvc'
+if cc.get_argument_syntax() != 'msvc'
# autotools didn't use the libdca pkg-config cflags, and they
# can point to a non-existing location (/usr/include/dca)
no_warn_c_args = ['-Wno-missing-include-dirs']
diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/meson.build b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/meson.build
index 160080a..6acf110 100644
--- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/meson.build
+++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/meson.build
@@ -158,7 +158,7 @@ endif

# MinGW 32bits compiler seems to be complaining about redundant-decls
# when ComPtr is in use. Let's just disable the warning
-if cc.get_id() != 'msvc'
+if cc.get_argument_syntax() != 'msvc'
extra_args = cc.get_supported_arguments([
'-Wno-redundant-decls',
])
diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build
index 84eeb17..1743f41 100644
--- a/subprojects/gst-plugins-bad/meson.build
+++ b/subprojects/gst-plugins-bad/meson.build
@@ -54,7 +54,7 @@ endif

cdata = configuration_data()
cdata.set('ENABLE_NLS', 1)

-if cc.get_id() == 'msvc'
+if cc.get_argument_syntax() == 'msvc'
msvc_args = [
# Ignore several spurious warnings for things gstreamer does very commonly
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
diff --git a/subprojects/gst-plugins-bad/sys/asio/meson.build b/subprojects/gst-plugins-bad/sys/asio/meson.build
index c61ad4e..b30793c 100644
--- a/subprojects/gst-plugins-bad/sys/asio/meson.build
+++ b/subprojects/gst-plugins-bad/sys/asio/meson.build
@@ -15,7 +15,7 @@ endif

# FIXME: non-msvc is not tested, and unlikely supported yet because of
# tool-chain issue
-if cxx.get_id() != 'msvc'
+if cxx.get_argument_syntax() != 'msvc'
if asio_option.enabled()
error('asio plugin can only be built with MSVC')
else
diff --git a/subprojects/gst-plugins-bad/sys/d3d11/meson.build b/subprojects/gst-plugins-bad/sys/d3d11/meson.build
index 1368b79..8dd3b30 100644
--- a/subprojects/gst-plugins-bad/sys/d3d11/meson.build
+++ b/subprojects/gst-plugins-bad/sys/d3d11/meson.build
@@ -96,7 +96,7 @@ endif

# MinGW 32bits compiler seems to be complaining about redundant-decls
# when ComPtr is in use. Let's just disable the warning
-if cc.get_id() != 'msvc'
+if cc.get_argument_syntax() != 'msvc'
extra_mingw_args = cc.get_supported_arguments([
'-Wno-redundant-decls',
])
diff --git a/subprojects/gst-plugins-bad/sys/decklink/meson.build b/subprojects/gst-plugins-bad/sys/decklink/meson.build
index d869e79a4..c7b37a7c6 100644
--- a/subprojects/gst-plugins-bad/sys/decklink/meson.build
+++ b/subprojects/gst-plugins-bad/sys/decklink/meson.build
@@ -18,7 +18,7 @@ decklink_libs = []

if host_system == 'windows'
decklink_sources += ['win/DeckLinkAPIDispatch.cpp', 'win/DeckLinkAPI_i.c']
- if cxx.get_id() == 'msvc'
+ if cxx.get_argument_syntax() == 'msvc'
# FIXME: Use commsuppwd.lib for debug builds?
comutil_dep = cxx.find_library('comsuppw', required : get_option('decklink'))
if comutil_dep.found()
diff --git a/subprojects/gst-plugins-bad/sys/mediafoundation/meson.build b/subprojects/gst-plugins-bad/sys/mediafoundation/meson.build
index 6b9a059..40713ce 100644
--- a/subprojects/gst-plugins-bad/sys/mediafoundation/meson.build
+++ b/subprojects/gst-plugins-bad/sys/mediafoundation/meson.build
@@ -54,7 +54,7 @@ if host_system != 'windows' or mf_option.disabled()
subdir_done()
endif

-if cc.get_id() != 'msvc'
+if cc.get_argument_syntax() != 'msvc'
if mf_option.enabled()
error('mediafoundation plugin can only be built with MSVC')
endif
diff --git a/subprojects/gst-plugins-bad/sys/msdk/meson.build b/subprojects/gst-plugins-bad/sys/msdk/meson.build
index 659b96c..92e6bc4 100644
--- a/subprojects/gst-plugins-bad/sys/msdk/meson.build
+++ b/subprojects/gst-plugins-bad/sys/msdk/meson.build
@@ -176,12 +176,12 @@ if use_onevpl and have_mfx_ver205
endif

if host_machine.system() == 'windows'
- if cc.get_id() != 'msvc' and msdk_option.enabled()
+ if cc.get_argument_syntax() != 'msvc' and msdk_option.enabled()
error('msdk plugin can only be built with MSVC')
endif
legacy_stdio_dep = cc.find_library('legacy_stdio_definitions', required: get_option('msdk'))
msdk_deps = declare_dependency(dependencies: [gstd3d11_dep, legacy_stdio_dep])
- msdk_deps_found = gstd3d11_dep.found() and legacy_stdio_dep.found() and cc.get_id() == 'msvc'
+ msdk_deps_found = d3d11_dep.found() and legacy_stdio_dep.found() and cc.get_argument_syntax() == 'msvc'
else
libdl_dep = cc.find_library('dl', required: get_option('msdk'))
libgudev_dep = dependency('gudev-1.0', required: get_option('msdk'))
13 changes: 13 additions & 0 deletions vcpkg/ports/gstreamer/fix-clang-cl-base.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build
index c040bc9..ce9071c 100644
--- a/subprojects/gst-plugins-base/meson.build
+++ b/subprojects/gst-plugins-base/meson.build
@@ -51,7 +51,7 @@ gst_libraries = []

cc = meson.get_compiler('c')

-if cc.get_id() == 'msvc'
+if cc.get_argument_syntax() == 'msvc'
msvc_args = [
# Ignore several spurious warnings for things gstreamer does very commonly
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
22 changes: 22 additions & 0 deletions vcpkg/ports/gstreamer/fix-clang-cl-good.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/subprojects/gst-plugins-good/meson.build b/subprojects/gst-plugins-good/meson.build
index 64705379f..0c55b9732 100644
--- a/subprojects/gst-plugins-good/meson.build
+++ b/subprojects/gst-plugins-good/meson.build
@@ -30,7 +30,7 @@ plugins = []
cc = meson.get_compiler('c')
host_system = host_machine.system()

-if cc.get_id() == 'msvc'
+if cc.get_argument_syntax() == 'msvc'
msvc_args = [
# Ignore several spurious warnings for things gstreamer does very commonly
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
@@ -183,7 +183,7 @@ cdata.set('SIZEOF_OFF_T', cc.sizeof('off_t'))
# Here be fixmes.
# FIXME: check if this is correct
cdata.set('HAVE_CPU_X86_64', host_machine.cpu() == 'amd64')
-cdata.set('HAVE_GCC_ASM', cc.get_id() != 'msvc')
+cdata.set('HAVE_GCC_ASM', cc.get_argument_syntax() != 'msvc')
cdata.set_quoted('VERSION', gst_version)
cdata.set_quoted('PACKAGE_VERSION', gst_version)
cdata.set_quoted('GST_LICENSE', 'LGPL')
39 changes: 39 additions & 0 deletions vcpkg/ports/gstreamer/fix-clang-cl-gstreamer.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/subprojects/gstreamer/gst/parse/meson.build b/subprojects/gstreamer/gst/parse/meson.build
index b79a07c..891f907 100644
--- a/subprojects/gstreamer/gst/parse/meson.build
+++ b/subprojects/gstreamer/gst/parse/meson.build
@@ -16,7 +16,7 @@ else
endif

flex_cdata.set('FLEX', flex.full_path())
-if cc.get_id() == 'msvc'
+if cc.get_argument_syntax() == 'msvc'
flex_cdata.set('FLEX_ARGS', '--nounistd')
else
flex_cdata.set('FLEX_ARGS', '')
diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build
index 941bedc..cd37a40 100644
--- a/subprojects/gstreamer/meson.build
+++ b/subprojects/gstreamer/meson.build
@@ -47,7 +47,7 @@ endif

cdata = configuration_data()

-if cc.get_id() == 'msvc'
+if cc.get_argument_syntax() == 'msvc'
msvc_args = [
# Ignore several spurious warnings for things gstreamer does very commonly
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
@@ -347,8 +347,10 @@ static __uint128_t v2 = 10;
static __uint128_t u;
u = v1 / v2;
}'''
-if cc.compiles(uint128_t_src, name : '__uint128_t available')
- cdata.set('HAVE_UINT128_T', 1)
+if cc.get_argument_syntax() != 'msvc'
+ if cc.compiles(uint128_t_src, name : '__uint128_t available')
+ cdata.set('HAVE_UINT128_T', 1)
+ endif
endif

# All supported platforms have long long now
13 changes: 13 additions & 0 deletions vcpkg/ports/gstreamer/fix-clang-cl-ugly.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/subprojects/gst-plugins-ugly/meson.build b/subprojects/gst-plugins-ugly/meson.build
index 14be48c4c..83d019874 100644
--- a/subprojects/gst-plugins-ugly/meson.build
+++ b/subprojects/gst-plugins-ugly/meson.build
@@ -31,7 +31,7 @@ if have_cxx
cxx = meson.get_compiler('cpp')
endif

-if cc.get_id() == 'msvc'
+if cc.get_argument_syntax() == 'msvc'
msvc_args = [
# Ignore several spurious warnings for things gstreamer does very commonly
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
22 changes: 22 additions & 0 deletions vcpkg/ports/gstreamer/fix-clang-cl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/meson.build b/meson.build
index 1316366ed..daeaf3cb1 100644
--- a/meson.build
+++ b/meson.build
@@ -62,7 +62,7 @@ endif
# Ensure that MSVC interprets all source code as UTF-8. Only do this when we're
# not a subproject, because subprojects are not allowed to call
# add_global_arguments().
-if not meson.is_subproject() and cc.get_id() == 'msvc'
+if not meson.is_subproject() and cc.get_argument_syntax() == 'msvc'
add_global_arguments(
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
language: ['c', 'cpp'])
@@ -316,7 +316,7 @@ if get_option('default_library') == 'static'
if cc.has_link_argument(link_arg)
gstfull_link_args += link_arg
link_deps += symbol_map
- elif cc.get_id() == 'msvc'
+ elif cc.get_argument_syntax() == 'msvc'
warning('FIXME: Provide a def file to publish the public symbols')
else
warning('FIXME: Linker does not support the supplied version script (' + symbol_map + '), please disable the "gst-full-version-script" option')
14 changes: 14 additions & 0 deletions vcpkg/ports/gstreamer/gstreamer-disable-no-unused.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build
index bed8c4e..772809e 100644
--- a/subprojects/gstreamer/meson.build
+++ b/subprojects/gstreamer/meson.build
@@ -435,8 +435,8 @@ if cc.has_header('execinfo.h')
endif
endif

gst_debug = get_option('gst_debug')
-if not gst_debug
+if not gst_debug and cc.has_argument('-Wno-unused')
add_project_arguments(['-Wno-unused'], language: 'c')
endif

17 changes: 17 additions & 0 deletions vcpkg/ports/gstreamer/no-downloads.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/meson.build b/meson.build
index df015cb..93cf7e9 100644
--- a/meson.build
+++ b/meson.build
@@ -105,12 +105,6 @@ subprojects = [
['gst-plugins-rs', { 'option': get_option('rs'), 'build-hotdoc': true, 'match_gst_version': false}],
]

-if build_system == 'windows'
- subproject('win-flex-bison-binaries')
- subproject('win-nasm')
-elif build_system == 'darwin'
- subproject('macos-bison-binary')
-endif

orc_option = get_option('orc')
# There is a check below to keep this in sync with subprojects/gst-plugins-base/meson.build
26 changes: 26 additions & 0 deletions vcpkg/ports/gstreamer/plugin-base-disable-no-unused.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build
index 9b00253..495671e 100644
--- a/subprojects/gst-plugins-base/meson.build
+++ b/subprojects/gst-plugins-base/meson.build
@@ -388,10 +388,11 @@ int32x4_t testfunc(int16_t *a, int16_t *b) {
endif
endif

+build_system = build_machine.system()
if gst_dep.type_name() == 'internal'
gst_proj = subproject('gstreamer')

- if not gst_proj.get_variable('gst_debug')
+ if not gst_proj.get_variable('gst_debug') and build_system != 'windows'
message('GStreamer debug system is disabled')
add_project_arguments('-Wno-unused', language: 'c')
else
@@ -404,7 +405,7 @@ else
#include <gst/gstconfig.h>
#ifdef GST_DISABLE_GST_DEBUG
#error "debugging disabled, make compiler fail"
-#endif''' , dependencies: gst_dep)
+#endif''' , dependencies: gst_dep) and build_system != 'windows'
message('GStreamer debug system is disabled')
add_project_arguments('-Wno-unused', language: 'c')
else
13 changes: 13 additions & 0 deletions vcpkg/ports/gstreamer/plugins-base-x11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build
index 9b00253a0f..e3c3a0d920 100644
--- a/subprojects/gst-plugins-base/meson.build
+++ b/subprojects/gst-plugins-base/meson.build
@@ -316,7 +316,7 @@ else
gtk_quartz_dep = dependency('', required : false)
endif

-core_conf.set('HAVE_X11', x11_dep.found())
+core_conf.set('HAVE_X11', false)
core_conf.set('HAVE_GIO_UNIX_2_0', giounix_dep.found())

if gio_dep.type_name() == 'pkgconfig'
Loading

0 comments on commit 2610f35

Please sign in to comment.