Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gstreamer] enable builds on more platforms #27050

Merged
merged 5 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ports/gst-rtsp-server/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(REMOVE ${DBG_BINS} ${REL_BINS})
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
# Move plugin pkg-config files
file(GLOB pc_files "${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/pkgconfig/*")
file(COPY ${pc_files} DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
file(GLOB pc_files_dbg "${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/pkgconfig/*")
file(COPY ${pc_files_dbg} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/pkgconfig/"
"${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/pkgconfig/")
endif()
vcpkg_fixup_pkgconfig()

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
2 changes: 1 addition & 1 deletion ports/gst-rtsp-server/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gst-rtsp-server",
"version": "1.19.2",
"port-version": 1,
"port-version": 2,
"description": "gst-rtsp-server is a library on top of GStreamer for building an RTSP server",
"dependencies": [
"gstreamer",
Expand Down
5 changes: 2 additions & 3 deletions ports/gstreamer/gstreamer-disable-no-unused.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ diff --git a/meson.build b/meson.build
index bed8c4e..772809e 100644
--- a/meson.build
+++ b/meson.build
@@ -435,8 +435,9 @@ if cc.has_header('execinfo.h')
@@ -435,8 +435,8 @@ if cc.has_header('execinfo.h')
endif
endif

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

19 changes: 15 additions & 4 deletions ports/gstreamer/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ vcpkg_from_github(
REF 1.19.2
SHA512 70dcd4a36d3bd35f680eaa3c980842fbb57f55f17d1453c6a95640709b1b33a263689bf54caa367154267d281e5474686fedaa980de24094de91886a57b6547a
HEAD_REF master
PATCHES ${PLUGIN_UGLY_PATCHES} fix-clang-cl-ugly.patch
PATCHES ${PLUGIN_UGLY_PATCHES} fix-clang-cl-ugly.patch remove_x264_define.patch
)
vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org
Expand Down Expand Up @@ -290,9 +290,12 @@ vcpkg_install_meson()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/KHR"
"${CURRENT_PACKAGES_DIR}/include/GL"
)
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/include/gst/gl/gstglconfig.h"
"${CURRENT_PACKAGES_DIR}/include/gstreamer-1.0/gst/gl/gstglconfig.h"
)
if(NOT VCPKG_TARGET_IS_LINUX)
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/include/gst/gl/gstglconfig.h"
"${CURRENT_PACKAGES_DIR}/include/gstreamer-1.0/gst/gl/gstglconfig.h"
)
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/libexec"
"${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/include"
Expand All @@ -301,6 +304,14 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share"
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
# Move plugin pkg-config files
file(GLOB pc_files "${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/pkgconfig/*")
file(COPY ${pc_files} DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
file(GLOB pc_files_dbg "${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/pkgconfig/*")
file(COPY ${pc_files_dbg} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/pkgconfig/"
"${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/pkgconfig/")

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin"
"${CURRENT_PACKAGES_DIR}/bin"
)
Expand Down
18 changes: 18 additions & 0 deletions ports/gstreamer/remove_x264_define.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/ext/x264/gstx264enc.h b/ext/x264/gstx264enc.h
index 6cbfc5c3d..ba7845b20 100644
--- a/ext/x264/gstx264enc.h
+++ b/ext/x264/gstx264enc.h
@@ -31,13 +31,6 @@
#include <stdint.h>
#endif

-/* The x264.h header says this isn't needed with MinGW, but sometimes the
- * compiler is unable to correctly do the pointer indirection for us, which
- * leads to a segfault when you try to dereference any const values provided
- * by x264.dll. See: https://bugzilla.gnome.org/show_bug.cgi?id=779249 */
-#if defined(_WIN32) && !defined(X264_API_IMPORTS)
-# define X264_API_IMPORTS
-#endif
#include <x264.h>

G_BEGIN_DECLS
4 changes: 2 additions & 2 deletions ports/gstreamer/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "gstreamer",
"version": "1.19.2",
"port-version": 8,
"port-version": 9,
"description": "GStreamer open-source multimedia framework core library",
"homepage": "https://gstreamer.freedesktop.org/",
"license": "LGPL-2.0-only",
"supports": "!linux & !uwp",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this even !linux? This is a prime example how supports shouldn't be used.

"supports": "!uwp",
"dependencies": [
{
"name": "cairo",
Expand Down
1 change: 1 addition & 0 deletions ports/x264/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS AND NOT
if (NOT VCPKG_BUILD_TYPE)
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/libx264.lib")
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/x264.h" "#ifdef X264_API_IMPORTS" "#if 1")
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/x264.h" "defined(U_STATIC_IMPLEMENTATION)" "1")
file(REMOVE_RECURSE
Expand Down
2 changes: 1 addition & 1 deletion ports/x264/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "x264",
"version": "0.164.3095",
"port-version": 1,
"port-version": 2,
"description": "x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format",
"homepage": "https://www.videolan.org/developers/x264.html",
"license": "GPL-2.0-or-later",
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ gmmlib:x64-windows-static-md=fail
gmmlib:x64-windows-static=fail
gmmlib:x64-windows=fail
gmmlib:x86-windows=fail
gstreamer:x64-windows-static=fail
gstreamer:x64-windows-static-md=fail
google-cloud-cpp:arm-uwp=fail
google-cloud-cpp:x64-uwp=fail
gperftools:arm64-windows=fail
Expand Down Expand Up @@ -873,6 +871,8 @@ qt5-canvas3d:x64-windows-static-md=skip
qt5-canvas3d:x86-windows=skip
# Missing system libraries
qt5-wayland:x64-osx=fail
# qtmultimedia needs an EGL fix
qtmultimedia:x64-linux=fail
qtwayland:x64-osx=fail
qtwayland:arm64-osx=fail
# Post build checks fail
Expand Down
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2770,11 +2770,11 @@
},
"gst-rtsp-server": {
"baseline": "1.19.2",
"port-version": 1
"port-version": 2
},
"gstreamer": {
"baseline": "1.19.2",
"port-version": 8
"port-version": 9
},
"gtest": {
"baseline": "1.12.1",
Expand Down Expand Up @@ -7882,7 +7882,7 @@
},
"x264": {
"baseline": "0.164.3095",
"port-version": 1
"port-version": 2
},
"x265": {
"baseline": "3.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gst-rtsp-server.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e6c0f43ea29f3c58c4ea82529d5a33aac49982d5",
"version": "1.19.2",
"port-version": 2
},
{
"git-tree": "d769d57cd8c5c732146992a174266c11e7ef52ec",
"version": "1.19.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gstreamer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "50b3345068815cb82022b680689ddfee0395e6de",
"version": "1.19.2",
"port-version": 9
},
{
"git-tree": "34e4471f1313a9d9ce220e461dde37a331c5bf47",
"version": "1.19.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/x-/x264.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4ff53c90cd7222ae9d3e8dc579c1d198715585c2",
"version": "0.164.3095",
"port-version": 2
},
{
"git-tree": "16be87b659ccfeaba052e561f3f0a8b1b927c5d0",
"version": "0.164.3095",
Expand Down