vcpkg/ports/clamav/portfile.cmake
Jonas Zaddach 7adc87efe1
[clamav] Add new port (#14658)
* Added ClamAV port

* Patch ClamAV's cmake files instead of doing things in portfile

* Fix whitespace

* Strip down package to really only build libclamav

* Fix static build

* Fix build on Linux

* Remove libcurl linkage

* fix copy-paste mistake

* Disable static build

* update version record

Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
2021-03-29 10:14:39 -07:00

39 lines
1.0 KiB
CMake

vcpkg_fail_port_install(ON_TARGET "uwp")
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Cisco-Talos/clamav-devel
REF clamav-0.103.0
SHA512 488381202bdcea812c39d611e0a31eaf8f55c9c5d0a6400fd53dfa0da674a95672fdc9b290dc6157cb8f628d9f81846b5cc108eb1e44f6207d3c6f2659ba63c6
HEAD_REF master
PATCHES
"build.patch"
"cmakefiles.patch"
"curl.patch"
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DENABLE_LIBCLAMAV_ONLY=ON
-DENABLE_DOCS=OFF
-DENABLE_SHARED_LIB=ON
-DENABLE_STATIC_LIB=OFF
)
vcpkg_install_cmake()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# On Linux, clamav will still build and install clamav-config
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
vcpkg_copy_pdbs()