Skip to content

Commit

Permalink
[openh264] Update to version 2.5.0 (#42966)
Browse files Browse the repository at this point in the history
Co-authored-by: tartanpaint <[email protected]>
  • Loading branch information
dg0yt and tartanpaint authored Jan 3, 2025
1 parent 976ebb8 commit 65be701
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 86 deletions.
57 changes: 0 additions & 57 deletions ports/openh264/0001-respect-default-library-option.patch

This file was deleted.

60 changes: 37 additions & 23 deletions ports/openh264/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,42 +1,56 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO cisco/openh264
REF f15f940425eebf24ce66984db2445733cf500b7b
SHA512 361003296e9cef2956aeff76ae4df7a949a585710facd84a92c1b4164c5a4522d6615fcc485ebc2e50be8a13feb942b870efdd28837307467081cb1eba1f17d2
PATCHES
0001-respect-default-library-option.patch # https://github.com/cisco/openh264/pull/3351
REF v${VERSION}
SHA512 cb6d3ca8d5277325dd64dec399421c4c62bc1fd012fe1521d7195e95ce7f59527919cf698829044dca3d9b1d8288c49b49111d01c9d2896c819da806492af838
)

set(cxx_link_libraries "")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
block(PROPAGATE cxx_link_libraries)
vcpkg_list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DVCPKG_DEFAULT_VARS_TO_CHECK=CMAKE_C_IMPLICIT_LINK_LIBRARIES;CMAKE_CXX_IMPLICIT_LINK_LIBRARIES")
vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")
list(REMOVE_ITEM VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_LIBRARIES ${VCPKG_DETECTED_CMAKE_C_IMPLICIT_LINK_LIBRARIES})
list(TRANSFORM VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_LIBRARIES PREPEND "-l")
string(JOIN " " cxx_link_libraries ${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
endblock()
endif()

vcpkg_list(SET additional_binaries)
if((VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64"))
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
vcpkg_add_to_path(${NASM_EXE_PATH})
vcpkg_list(APPEND additional_binaries "nasm = ['${NASM}']")
elseif(VCPKG_TARGET_IS_WINDOWS)
vcpkg_find_acquire_program(GASPREPROCESSOR)
foreach(GAS_PATH ${GASPREPROCESSOR})
get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY)
vcpkg_add_to_path(${GAS_ITEM_PATH})
endforeach(GAS_PATH)
list(JOIN GASPREPROCESSOR "','" gaspreprocessor)
vcpkg_list(APPEND additional_binaries "gas-preprocessor.pl = ['${gaspreprocessor}']")
endif()

vcpkg_configure_meson(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS -Dtests=disabled
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-Dtests=disabled
ADDITIONAL_BINARIES
${additional_binaries}
)

vcpkg_install_meson()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()

if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/openh264.pc" " -lstdc++" "")
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/openh264.pc" " -lstdc++" "")
endif()
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
if(cxx_link_libraries)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/openh264.pc"
"(Libs:[^\r\n]*)"
"\\1 ${cxx_link_libraries}"
REGEX
)
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/openh264.pc"
"(Libs:[^\r\n]*)"
"\\1 ${cxx_link_libraries}"
REGEX
)
endif()
endif()

configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
9 changes: 6 additions & 3 deletions ports/openh264/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "openh264",
"version-date": "2021-03-16",
"port-version": 4,
"version": "2.5.0",
"description": "OpenH264 is a codec library which supports H.264 encoding and decoding. It is suitable for use in real time applications such as WebRTC.",
"homepage": "https://www.openh264.org/",
"supports": "!uwp",
"license": "BSD-2-Clause",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-tool-meson",
"host": true
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_ports/vcpkg-ci-ffmpeg/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lzma",
"mp3lame",
"nonfree",
"openh264",
"openjpeg",
"openmpt",
"openssl",
Expand Down Expand Up @@ -73,7 +74,6 @@
"fribidi",
"modplug",
"opencl",
"openh264",
"srt"
],
"platform": "!uwp"
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6713,8 +6713,8 @@
"port-version": 1
},
"openh264": {
"baseline": "2021-03-16",
"port-version": 4
"baseline": "2.5.0",
"port-version": 0
},
"openigtlink": {
"baseline": "3.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openh264.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "91cf19eb2e0e9de617f43708201c69dbf097b649",
"version": "2.5.0",
"port-version": 0
},
{
"git-tree": "34faf5afdf562b2dff8472e4101d3a01f51d3372",
"version-date": "2021-03-16",
Expand Down

0 comments on commit 65be701

Please sign in to comment.