diff --git a/ports/blake3/CMakeLists.txt b/ports/blake3/CMakeLists.txt deleted file mode 100644 index 1ef6c3893f272e..00000000000000 --- a/ports/blake3/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -cmake_minimum_required(VERSION 3.19) - -project(blake3 LANGUAGES C) - -add_library(blake3) - -target_sources(blake3 PRIVATE - c/blake3.c - c/blake3_dispatch.c - c/blake3_portable.c -) - -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - target_compile_definitions(blake3 PRIVATE BLAKE3_NO_AVX512=1) - target_sources(blake3 PRIVATE - c/blake3_avx2.c - c/blake3_sse2.c - c/blake3_sse41.c - ) - if(NOT MSVC) - set_source_files_properties(c/blake3_avx2.c COMPILE_FLAGS -mavx2) - set_source_files_properties(c/blake3_sse2.c COMPILE_FLAGS -msse2) - set_source_files_properties(c/blake3_sse41.c COMPILE_FLAGS -msse4.1) - endif() -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - if(WIN32 AND MSVC) - enable_language(ASM_MASM) - target_sources(blake3 PRIVATE - c/blake3_avx2_x86-64_windows_msvc.asm - c/blake3_sse2_x86-64_windows_msvc.asm - c/blake3_sse41_x86-64_windows_msvc.asm - c/blake3_avx512_x86-64_windows_msvc.asm - ) - elseif(WIN32 AND NOT MSVC) - enable_language(ASM) - target_sources(blake3 PRIVATE - c/blake3_avx2_x86-64_windows_gnu.S - c/blake3_sse2_x86-64_windows_gnu.S - c/blake3_sse41_x86-64_windows_gnu.S - c/blake3_avx512_x86-64_windows_gnu.S - ) - else() - enable_language(ASM) - target_sources(blake3 PRIVATE - c/blake3_avx2_x86-64_unix.S - c/blake3_sse2_x86-64_unix.S - c/blake3_sse41_x86-64_unix.S - c/blake3_avx512_x86-64_unix.S - ) - endif() -else() - target_compile_definitions(blake3 PRIVATE BLAKE3_NO_SSE2=1 BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 BLAKE3_NO_AVX512=1) -endif() - -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - target_compile_definitions(blake3 PRIVATE BLAKE3_USE_NEON=1) - target_sources(blake3 PRIVATE - c/blake3_neon.c - ) -else() - target_compile_definitions(blake3 PRIVATE BLAKE3_NO_NEON=1) -endif() - -install(TARGETS blake3) -install(FILES c/blake3.h DESTINATION include) diff --git a/ports/blake3/portfile.cmake b/ports/blake3/portfile.cmake index 85d73c206e23a4..23e2bcdd87940e 100644 --- a/ports/blake3/portfile.cmake +++ b/ports/blake3/portfile.cmake @@ -1,20 +1,49 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO BLAKE3-team/BLAKE3 - REF 1.3.3 + REF "${VERSION}" SHA512 3ea57a86af7357582479ed5d762d368ee52421636c72723b08f528f9bf53637bad0058c5aded0b9a1b9479f374f5d3b110677e00c2b1124a47bfcdac800c2836 HEAD_REF main ) -file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") +# these four files are included in the next release +vcpkg_download_distfile( + CMAKELISTS_SOURCE_PATH + URLS https://raw.githubusercontent.com/BLAKE3-team/BLAKE3/76f9339312e1d52632a1cfb9df285c01911d99ce/c/CMakeLists.txt + FILENAME blake3-CMakeLists.txt + SHA512 598699b90053fdbe381843f886c213f5e6d03281a9b8c1403726c300e83a9da353879da7170637024663af576e54f74a307049577360ded90d25e11bd852edde +) +vcpkg_download_distfile( + CMAKECONFIGIN_SOURCE_PATH + URLS https://raw.githubusercontent.com/BLAKE3-team/BLAKE3/76f9339312e1d52632a1cfb9df285c01911d99ce/c/blake3-config.cmake.in + FILENAME blake3-config.cmake.in + SHA512 f9bdb41bd4e4930ab31624f484f895fbda57066a4b3e0a38e7ffefab7343779d1c356fbaf6231643fd069f7a176b840f234f74d9f9ee4167cc430d7bfec0f40f +) +vcpkg_download_distfile( + PKGCONFIGIN_SOURCE_PATH + URLS https://raw.githubusercontent.com/BLAKE3-team/BLAKE3/76f9339312e1d52632a1cfb9df285c01911d99ce/c/libblake3.pc.in + FILENAME libblake3.pc.in + SHA512 cfbaea63368e655c3ac3357f791b6332ae0241f3fd4f98e19c48f28e633e25a5b1125d1cc6b4815edfd013a76379dffcf9723852a7b76f2910d19dc77e538fa2 +) +vcpkg_download_distfile( # we need the dllexport macro (otherwise these files are identical) + BLAKE3_H_SOURCE_PATH + URLS https://raw.githubusercontent.com/BLAKE3-team/BLAKE3/76f9339312e1d52632a1cfb9df285c01911d99ce/c/blake3.h + FILENAME blake3.h + SHA512 0f9852ff0e527e8fe0d567408c5c100ee3707a1b942ac1fbd78208a68ecfd32814729b5082720278d25d4cf45eb1020fcf3e4199cab0a67a6ca6af4321bcbc3e +) +file(COPY_FILE "${CMAKELISTS_SOURCE_PATH}" "${SOURCE_PATH}/c/CMakeLists.txt") +file(COPY_FILE "${CMAKECONFIGIN_SOURCE_PATH}" "${SOURCE_PATH}/c/blake3-config.cmake.in") +file(COPY_FILE "${PKGCONFIGIN_SOURCE_PATH}" "${SOURCE_PATH}/c/libblake3.pc.in") +file(COPY_FILE "${BLAKE3_H_SOURCE_PATH}" "${SOURCE_PATH}/c/blake3.h") vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" + SOURCE_PATH "${SOURCE_PATH}/c" ) vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) +vcpkg_fixup_pkgconfig() + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/blake3/vcpkg.json b/ports/blake3/vcpkg.json index 1672cb66cb676b..cc5f7d369f51f2 100644 --- a/ports/blake3/vcpkg.json +++ b/ports/blake3/vcpkg.json @@ -1,6 +1,7 @@ { "name": "blake3", "version": "1.3.3", + "port-version": 1, "description": "BLAKE3 cryptographic hash function.", "homepage": "https://github.com/BLAKE3-team/BLAKE3", "license": "CC0-1.0 OR Apache-2.0", @@ -8,6 +9,10 @@ { "name": "vcpkg-cmake", "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true } ] } diff --git a/versions/b-/blake3.json b/versions/b-/blake3.json index 1d73c6e3076057..41456f9181b710 100644 --- a/versions/b-/blake3.json +++ b/versions/b-/blake3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "13ac9cc003839e6730587218103f4912e7886311", + "version": "1.3.3", + "port-version": 1 + }, { "git-tree": "707d127029e3c2e2c2216fba6e36247ce43414b3", "version": "1.3.3", diff --git a/versions/baseline.json b/versions/baseline.json index b888aa27cc8c7b..1a74042717eafc 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -586,7 +586,7 @@ }, "blake3": { "baseline": "1.3.3", - "port-version": 0 + "port-version": 1 }, "blas": { "baseline": "2023-03-25",