vcpkg/ports/libpsl/portfile.cmake

49 lines
1.8 KiB
CMake
Raw Normal View History

[gstreamer,libsoup,libpsl,glib-networking] enable soup plugins of gstreamer (#36679) <!-- If your PR fixes issues, please note that here by adding "Fixes #NNNNNN." for each fixed issue on separate lines. --> <!-- If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/. --> Update port gstreamer - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [x] SHA512s are updated for each updated download. - [ ] The "supports" clause reflects platforms that may be fixed by this new version. - [ ] Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file. - [ ] Any patches that are no longer applied are deleted from the port's directory. - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file. Add port libsoup,libpsl,glib-networking - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [x] The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines. - [x] Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all `find_package` calls are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or disabled with [CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html). - [x] The versioning scheme in `vcpkg.json` matches what upstream says. - [x] The license declaration in `vcpkg.json` matches what upstream says. - [x] The installed as the "copyright" file matches what upstream says. - [x] The source code of the component installed comes from an authoritative source. - [x] The generated "usage text" is accurate. See [adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md) for context. - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is in the new port's versions file. - [x] Only one version is added to each modified port's versions file. I found the offical tutorials not work because the uridecodebin plugin can not handle https uri. Then I found that soup plugins is disabled. So I update the gstreamer to enable it. The gstreamer compiled successfuly without new port which I add. However the soup plugins will not work without libsoup. So I add the port libsoup. And it depend on libpsl and glib-networking. The glib-networking is a gio module. To make it work, we should set env GIO_MODULE_DIR to the plugins dir which glib-networking dll live in. And now I uridecodebin works properly. By the way, how vcpkg deal with plugin dll? I put them to a plugins dir just like gstreamer. However to use them is a hard work. For a gio module, we have to set the env GIO_MODULE_DIR to the dyamic library location.
2024-02-29 10:02:23 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO rockdaboot/libpsl
REF "${VERSION}"
SHA512 "d8e224b2ce5d9a6ac78700eb8975d09aef4e5af7db29539e5e339c5cd100f1272371fe45757ab5383ddbcd569bdf9d697a78932ea9fdf43ff48d3cea02f644cd"
HEAD_REF master
)
vcpkg_download_distfile(
PUBLIC_SUFFIX_LIST_DAT
URLS https://raw.githubusercontent.com/publicsuffix/list/5db9b65997e3c9230ac4353b01994c2ae9667cb9/public_suffix_list.dat
FILENAME libpsl_public_suffix_list.dat
SHA512 08ae73cb028ce9d57ad5ce09afd76a5b379fa18e1370f6a1d094f4242ce66b0f4bf005b05e796c287ab8074aca7f30d023e430f64d3563fa93adbb2371bda220
)
file(COPY "${PUBLIC_SUFFIX_LIST_DAT}" DESTINATION "${SOURCE_PATH}/list")
file(RENAME "${SOURCE_PATH}/list/libpsl_public_suffix_list.dat" "${SOURCE_PATH}/list/public_suffix_list.dat")
vcpkg_list(SET RUNTIME_OPTIONS)
if(libidn2 IN_LIST FEATURES)
list(APPEND RUNTIME_OPTIONS -Druntime=libidn2)
endif()
if(libicu IN_LIST FEATURES)
list(APPEND RUNTIME_OPTIONS -Druntime=libicu)
endif()
if(RUNTIME_OPTIONS STREQUAL "")
message(FATAL_ERROR "At least one of libidn2 and libicu should be selected.")
endif()
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${RUNTIME_OPTIONS}
-Ddocs=false
-Dtests=false
)
vcpkg_install_meson()
vcpkg_fixup_pkgconfig()
vcpkg_copy_tools(TOOL_NAMES psl AUTO_CLEAN)
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/psl-make-dafsa" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/psl-make-dafsa")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")