From 66107362b1fb67c9b46d2a225d698c2f7ed417c8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 23 Oct 2018 10:38:27 -0700 Subject: [PATCH] [libwebm] Avoid building executables --- ports/libwebm/CONTROL | 2 +- ports/libwebm/no-samples.patch | 20 ++++++++++++++++++++ ports/libwebm/portfile.cmake | 28 ++++++++++++---------------- 3 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 ports/libwebm/no-samples.patch diff --git a/ports/libwebm/CONTROL b/ports/libwebm/CONTROL index eb19cf16ab..7a9bccfc77 100644 --- a/ports/libwebm/CONTROL +++ b/ports/libwebm/CONTROL @@ -1,3 +1,3 @@ Source: libwebm -Version: 1.0.0.27-2 +Version: 1.0.0.27-3 Description: WebM File Parser diff --git a/ports/libwebm/no-samples.patch b/ports/libwebm/no-samples.patch new file mode 100644 index 0000000000..c160726b91 --- /dev/null +++ b/ports/libwebm/no-samples.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b48868f..f2fe35b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,6 +41,7 @@ endif(WIN32) + + include_directories("${LIBWEBM_SRC_DIR}") + ++if(BUILD_SAMPLES) + # Sample section. + add_executable(sample + "${LIBWEBM_SRC_DIR}/sample.cpp") +@@ -69,6 +70,7 @@ add_executable(webm2pes + "${LIBWEBM_SRC_DIR}/webm2pes.cc" + "${LIBWEBM_SRC_DIR}/webm2pes.h") + target_link_libraries(webm2pes LINK_PUBLIC webm) ++endif() + + install( + TARGETS webm diff --git a/ports/libwebm/portfile.cmake b/ports/libwebm/portfile.cmake index 6ccd7e3c5c..7a233ecb66 100644 --- a/ports/libwebm/portfile.cmake +++ b/ports/libwebm/portfile.cmake @@ -1,21 +1,17 @@ include(vcpkg_common_functions) -set(LIBWEBM_VERSION 1.0.0.27) -set(LIBWEBM_HASH 15650b8b121b226654a5abed45a3586ddaf785dee8dac7c72df3f3f9aef76af4e561b75a2ef05328af8dfcfde21948b2edb59cd884dad08b8919cab4ee5a8596) - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebm-libwebm-${LIBWEBM_VERSION}) -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/webmproject/libwebm/archive/libwebm-${LIBWEBM_VERSION}.tar.gz" - FILENAME "libwebm-${LIBWEBM_VERSION}.tar.gz" - SHA512 ${LIBWEBM_HASH} +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO webmproject/libwebm + REF libwebm-1.0.0.27 + SHA512 15650b8b121b226654a5abed45a3586ddaf785dee8dac7c72df3f3f9aef76af4e561b75a2ef05328af8dfcfde21948b2edb59cd884dad08b8919cab4ee5a8596 + HEAD_REF master + PATCHES + 0001-fix-cmake.patch + no-samples.patch ) -vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-fix-cmake.patch") - -if(VCPKG_CRT_LINKAGE STREQUAL dynamic) +if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") set(LIBWEBM_CRT_LINKAGE -DMSVC_RUNTIME=dll) else() set(LIBWEBM_CRT_LINKAGE -DMSVC_RUNTIME=static) @@ -24,9 +20,9 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS ${LIBWEBM_CRT_LINKAGE}) + OPTIONS ${LIBWEBM_CRT_LINKAGE} +) -vcpkg_build_cmake() vcpkg_install_cmake() vcpkg_copy_pdbs()