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] Support arm-windows and add features #23125

Merged
merged 10 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
16 changes: 16 additions & 0 deletions ports/gstreamer/plugins-ugly-disable-doc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/meson.build b/meson.build
index c5c78fc..14be48c 100644
--- a/meson.build
+++ b/meson.build
@@ -281,7 +281,11 @@ if find_program('xgettext', required : get_option('nls')).found()
cdata.set('ENABLE_NLS', 1)
subdir('po')
endif
+
+enable_doc = get_option('doc')
+if enable_doc.enabled()
subdir('docs')
+endif
subdir('scripts')

# Set release date
112 changes: 79 additions & 33 deletions ports/gstreamer/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ vcpkg_from_github(
if(VCPKG_TARGET_IS_WINDOWS)
list(APPEND PLUGIN_BASE_PATCHES plugins-base-use-zlib.patch)
list(APPEND PLUGIN_GOOD_PATCHES plugins-good-use-zlib.patch)
list(APPEND PLUGIN_UGLY_PATCHES plugins-ugly-disable-doc.patch)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH GST_PLUGIN_BASE_SOURCE_PATH
Expand Down Expand Up @@ -45,6 +46,7 @@ vcpkg_from_github(
REF 1.19.2
SHA512 70dcd4a36d3bd35f680eaa3c980842fbb57f55f17d1453c6a95640709b1b33a263689bf54caa367154267d281e5474686fedaa980de24094de91886a57b6547a
HEAD_REF master
PATCHES ${PLUGIN_UGLY_PATCHES}
)
vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org
Expand All @@ -55,12 +57,24 @@ vcpkg_from_gitlab(
HEAD_REF master
)

file(RENAME ${GST_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gstreamer)
file(RENAME ${GST_PLUGIN_BASE_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-base)
file(RENAME ${GST_PLUGIN_GOOD_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-good)
file(RENAME ${GST_PLUGIN_BAD_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-bad)
file(RENAME ${GST_PLUGIN_UGLY_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-ugly)
file(RENAME ${GST_MESON_PORTS_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gl-headers)
if (NOT EXISTS "${GST_BUILD_SOURCE_PATH}/subprojects/gstreamer")
file(RENAME "${GST_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gstreamer")
endif()
if (NOT EXISTS "${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-base")
file(RENAME "${GST_PLUGIN_BASE_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-base")
endif()
if (NOT EXISTS "${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-good")
file(RENAME "${GST_PLUGIN_GOOD_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-good")
endif()
if (NOT EXISTS "${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-bad")
file(RENAME "${GST_PLUGIN_BAD_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-bad")
endif()
if (NOT EXISTS "${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-ugly")
file(RENAME "${GST_PLUGIN_UGLY_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gst-plugins-ugly")
endif()
if (NOT EXISTS "${GST_BUILD_SOURCE_PATH}/subprojects/gl-headers")
file(RENAME "${GST_MESON_PORTS_SOURCE_PATH} ${GST_BUILD_SOURCE_PATH}/subprojects/gl-headers")
endif()

if(VCPKG_TARGET_IS_OSX)
# In Darwin platform, there can be an old version of `bison`,
Expand All @@ -80,10 +94,21 @@ if(VCPKG_TARGET_IS_OSX)
endif()

# make tools like 'glib-mkenums' visible
get_filename_component(GLIB_TOOL_DIR ${CURRENT_INSTALLED_DIR}/tools/glib ABSOLUTE)
get_filename_component(GLIB_TOOL_DIR "${CURRENT_INSTALLED_DIR}/tools/glib" ABSOLUTE)
message(STATUS "Using glib tools: ${GLIB_TOOL_DIR}")
vcpkg_add_to_path(PREPEND ${GLIB_TOOL_DIR})
vcpkg_add_to_path(PREPEND "${GLIB_TOOL_DIR}")

if ("x264" IN_LIST FEATURES)
set(PLUGIN_UGLY_X264 enabled)
else()
set(PLUGIN_UGLY_X264 disabled)
endif()

if("plugins-base" IN_LIST FEATURES)
set(PLUGIN_BASE_SUPPORT enabled)
else()
set(PLUGIN_BASE_SUPPORT disabled)
endif()
if("plugins-bad" IN_LIST FEATURES)
# requires 'libdrm', 'dssim', 'libmicrodns'
message(FATAL_ERROR "The feature 'plugins-bad' is not supported in this port version")
Expand All @@ -97,6 +122,18 @@ else()
set(PLUGIN_UGLY_SUPPORT disabled)
endif()

if ("gl-graphene" IN_LIST FEATURES)
set(GL_GRAPHENE enabled)
else()
set(GL_GRAPHENE disabled)
endif()

if ("flac" IN_LIST FEATURES)
set(PLUGIN_GOOD_FLAC enabled)
else()
set(PLUGIN_GOOD_FLAC disabled)
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(LIBRARY_LINKAGE "shared")
else()
Expand All @@ -120,7 +157,7 @@ vcpkg_add_to_path("${GIT_DIR}")
# https://github.com/GStreamer/gst-plugins-ugly/blob/1.18.4/meson_options.txt
#
vcpkg_configure_meson(
SOURCE_PATH ${GST_BUILD_SOURCE_PATH}
SOURCE_PATH "${GST_BUILD_SOURCE_PATH}"
OPTIONS
# gstreamer
-Dgstreamer:default_library=${LIBRARY_LINKAGE}
Expand All @@ -134,17 +171,21 @@ vcpkg_configure_meson(
-Dgstreamer:tests=disabled
-Dgstreamer:benchmarks=disabled
-Dgstreamer:tools=disabled
-Dgstreamer:doc=disabled
-Dgstreamer:introspection=disabled
-Dgstreamer:nls=disabled
# gst-plugins-base
-Dbase=${PLUGIN_BASE_SUPPORT}
-Dgst-plugins-base:default_library=${LIBRARY_LINKAGE}
-Dgst-plugins-base:examples=disabled
-Dgst-plugins-base:tests=disabled
-Dgst-plugins-base:doc=disabled
-Dgst-plugins-base:tools=disabled
-Dgst-plugins-base:introspection=disabled
-Dgst-plugins-base:nls=disabled
-Dgst-plugins-base:orc=disabled
-Dgst-plugins-base:pango=disabled
-Dgst-plugins-base:gl-graphene=${GL_GRAPHENE}
# gst-plugins-good
-Dgst-plugins-good:default_library=${LIBRARY_LINKAGE}
-Dgst-plugins-good:qt5=disabled
Expand All @@ -155,24 +196,29 @@ vcpkg_configure_meson(
-Dgst-plugins-good:vpx=auto # libvpx
-Dgst-plugins-good:examples=disabled
-Dgst-plugins-good:tests=disabled
-Dgst-plugins-good:doc=disabled
-Dgst-plugins-good:nls=disabled
-Dgst-plugins-good:orc=disabled
-Dgst-plugins-good:flac=${PLUGIN_GOOD_FLAC}
# gst-plugins-bad
-Dbad=${PLUGIN_BAD_SUPPORT}
-Dgst-plugins-bad:default_library=${LIBRARY_LINKAGE}
-Dgst-plugins-bad:opencv=disabled
-Dgst-plugins-bad:hls-crypto=openssl
-Dgst-plugins-bad:examples=disabled
-Dgst-plugins-bad:tests=disabled
-Dgst-plugins-bad:doc=disabled
-Dgst-plugins-bad:introspection=disabled
-Dgst-plugins-bad:nls=${LIBRARY_LINKAGE}
-Dgst-plugins-bad:orc=disabled
# gst-plugins-ugly
-Dugly=${PLUGIN_UGLY_SUPPORT}
-Dgst-plugins-ugly:default_library=${LIBRARY_LINKAGE}
-Dgst-plugins-ugly:tests=disabled
-Dgst-plugins-ugly:doc=disabled
-Dgst-plugins-ugly:nls=disabled
-Dgst-plugins-ugly:orc=disabled
-Dgst-plugins-ugly:x264=${PLUGIN_UGLY_X264}
# see ${GST_BUILD_SOURCE_PATH}/meson_options.txt
-Dpython=disabled
-Dlibav=disabled
Expand Down Expand Up @@ -214,48 +260,48 @@ vcpkg_configure_meson(
)
if(VCPKG_TARGET_IS_WINDOWS)
# note: can't find where z.lib comes from. replace it to appropriate library name manually
get_filename_component(BUILD_NINJA_DBG ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/build.ninja ABSOLUTE)
get_filename_component(BUILD_NINJA_DBG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/build.ninja" ABSOLUTE)
vcpkg_replace_string(${BUILD_NINJA_DBG} "z.lib" "zlibd.lib")
get_filename_component(BUILD_NINJA_REL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja ABSOLUTE)
get_filename_component(BUILD_NINJA_REL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja" ABSOLUTE)
vcpkg_replace_string(${BUILD_NINJA_REL} "z.lib" "zlib.lib")
vcpkg_replace_string(${BUILD_NINJA_REL} "\"-Wno-unused\"" "") # todo: may need a patch for `gst_debug=false`
endif()
vcpkg_install_meson()

# Remove duplicated GL headers (we already have `opengl-registry`)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/KHR
${CURRENT_PACKAGES_DIR}/include/GL
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
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"
)

file(INSTALL ${GST_BUILD_SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/debug/libexec
${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/include
${CURRENT_PACKAGES_DIR}/libexec
${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/include
file(INSTALL "${GST_BUILD_SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/libexec"
"${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/include"
"${CURRENT_PACKAGES_DIR}/libexec"
"${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/include"
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin
${CURRENT_PACKAGES_DIR}/bin
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin"
"${CURRENT_PACKAGES_DIR}/bin"
)
set(PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
set(SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/${PREFIX}gstreamer-full-1.0${SUFFIX}
${CURRENT_PACKAGES_DIR}/lib/${PREFIX}gstreamer-full-1.0${SUFFIX}
set(PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
set(SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/${PREFIX}gstreamer-full-1.0${SUFFIX}"
"${CURRENT_PACKAGES_DIR}/lib/${PREFIX}gstreamer-full-1.0${SUFFIX}"
)
endif()
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(GLOB DBG_BINS ${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/*.dll
${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/*.pdb
file(GLOB DBG_BINS "${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/*.dll"
"${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/*.pdb"
)
file(COPY ${DBG_BINS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
file(GLOB REL_BINS ${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/*.dll
${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/*.pdb
file(COPY ${DBG_BINS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(GLOB REL_BINS "${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/*.dll"
"${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/*.pdb"
)
file(COPY ${REL_BINS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(COPY ${REL_BINS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(REMOVE ${DBG_BINS} ${REL_BINS})
endif()
vcpkg_fixup_pkgconfig()
73 changes: 68 additions & 5 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": 3,
"port-version": 4,
"description": "GStreamer open-source multimedia framework core library",
"homepage": "https://gstreamer.freedesktop.org/",
"license": "LGPL-2.0",
"supports": "(windows | osx) & (x64 | x86)",
"supports": "!linux & !uwp",
"dependencies": [
{
"name": "cairo",
Expand All @@ -26,7 +26,6 @@
"name": "glib",
"host": true
},
"graphene",
"libnice",
"libxml2",
{
Expand All @@ -44,25 +43,68 @@
}
],
"default-features": [
"plugins-base",
"plugins-good",
"plugins-ugly"
],
"features": {
"flac": {
"description": "FLAC audio codec plugin",
"supports": "!arm",
"dependencies": [
"libflac"
]
},
"gl-graphene": {
"description": "Use Graphene in OpenGL plugin",
"supports": "!arm",
"dependencies": [
"graphene"
]
},
"plugins-bad": {
"description": "'Bad' GStreamer plugins and helper libraries",
"dependencies": [
{
"name": "gstreamer",
"default-features": false,
"features": [
"rawparse"
],
"platform": "!arm"
},
"openh264"
]
},
"plugins-base": {
"description": "'Base' GStreamer plugins and helper libraries",
"dependencies": [
{
"name": "gstreamer",
"default-features": false,
"features": [
"gl-graphene",
"rawparse"
],
"platform": "!arm"
}
]
},
"plugins-good": {
"description": "'Good' GStreamer plugins and helper libraries",
"dependencies": [
"bzip2",
{
"name": "gstreamer",
"default-features": false,
"features": [
"flac"
],
"platform": "!arm"
},
"jack2",
"libflac",
"libjpeg-turbo",
"libpng",
"libraw",
"libvpx",
"mpg123",
"speex",
Expand All @@ -71,6 +113,27 @@
},
"plugins-ugly": {
"description": "'Ugly' GStreamer plugins and helper libraries",
"dependencies": [
{
"name": "gstreamer",
"default-features": false,
"features": [
"x264"
],
"platform": "!arm"
}
]
},
"rawparse": {
"description": "Build with libraw support",
"supports": "!arm",
"dependencies": [
"libraw"
]
},
"x264": {
"description": "Colon separated list of additional x264 library paths, e.g. for 10-bit version",
"supports": "!arm",
"dependencies": [
"x264"
]
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2618,7 +2618,7 @@
},
"gstreamer": {
"baseline": "1.19.2",
"port-version": 3
"port-version": 4
},
"gtest": {
"baseline": "1.11.0",
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": "d9eb0e9346001ca2499296acdb309804238e5621",
"version": "1.19.2",
"port-version": 4
},
{
"git-tree": "25482001e85b34b144a67fc9cc86127f9e8c89ea",
"version": "1.19.2",
Expand Down