diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/tfhe | |
Diffstat (limited to 'vcpkg/ports/tfhe')
| -rw-r--r-- | vcpkg/ports/tfhe/mac-fix.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/tfhe/portfile.cmake | 23 | ||||
| -rw-r--r-- | vcpkg/ports/tfhe/vcpkg.json | 14 |
3 files changed, 50 insertions, 0 deletions
diff --git a/vcpkg/ports/tfhe/mac-fix.patch b/vcpkg/ports/tfhe/mac-fix.patch new file mode 100644 index 0000000..20161fe --- /dev/null +++ b/vcpkg/ports/tfhe/mac-fix.patch @@ -0,0 +1,13 @@ +diff --git a/src/libtfhe/fft_processors/nayuki/fft_processor_nayuki.cpp b/src/libtfhe/fft_processors/nayuki/fft_processor_nayuki.cpp +index 26de3f0..422c7f6 100644 +--- a/src/libtfhe/fft_processors/nayuki/fft_processor_nayuki.cpp ++++ b/src/libtfhe/fft_processors/nayuki/fft_processor_nayuki.cpp +@@ -12,7 +12,7 @@ FFT_Processor_nayuki::FFT_Processor_nayuki(const int N): _2N(2*N),N(N),Ns2(N/2) + tables_reverse = fft_init_reverse(_2N); + omegaxminus1 = (cplx*) malloc(sizeof(cplx) * _2N); + for (int x=0; x<_2N; x++) { +- omegaxminus1[x]=cos(x*M_PI/N)-1. + sin(x*M_PI/N) * 1i; ++ omegaxminus1[x]=cplx(cos(x*M_PI/N)-1., sin(x*M_PI/N)); // instead of cos(x*M_PI/N)-1. + sin(x*M_PI/N) * 1i + //exp(i.x.pi/N)-1 + } + } diff --git a/vcpkg/ports/tfhe/portfile.cmake b/vcpkg/ports/tfhe/portfile.cmake new file mode 100644 index 0000000..87e1033 --- /dev/null +++ b/vcpkg/ports/tfhe/portfile.cmake @@ -0,0 +1,23 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO tfhe/tfhe
+ REF v1.0.1
+ SHA512 1d625eb00bf6a36fd86cfad8e1763d7030dd73d68f2422d1678f51352708e9275f0ce69c23fb0d9fec30fba00e1ca4a3df29fb4fc6dfe3b7f16e0d350aa7f170
+ HEAD_REF master
+ PATCHES
+ mac-fix.patch
+)
+
+# Workaround for https://github.com/tfhe/tfhe/issues/246
+vcpkg_replace_string("${SOURCE_PATH}/src/CMakeLists.txt" "-Wall -Werror" "")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/src"
+)
+
+vcpkg_cmake_install()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/tfhe/vcpkg.json b/vcpkg/ports/tfhe/vcpkg.json new file mode 100644 index 0000000..91feadf --- /dev/null +++ b/vcpkg/ports/tfhe/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "tfhe", + "version-semver": "1.0.1", + "port-version": 5, + "description": "TFHE is open-source software distributed under the terms of the Apache 2.0 license.", + "homepage": "https://github.com/tfhe/tfhe", + "supports": "!windows & !arm", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |