guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 65edf46f27717725b58994e3a86d170e4dc893dd
Author: Arun Isaac <[email protected]>
AuthorDate: Fri Feb 6 01:58:58 2026 +0000

    gnu: Add blevesearch-faiss.
    
    * gnu/packages/golang-xyz.scm (blevesearch-faiss): New variable.
    
    Signed-off-by: jgart <[email protected]>
---
 gnu/packages/golang-xyz.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index f51d2d6d0e..5dad9c1381 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -109,6 +109,7 @@
   #:use-module (gnu packages golang-crypto)
   #:use-module (gnu packages golang-maths)
   #:use-module (gnu packages golang-web)
+  #:use-module (gnu packages graph)
   #:use-module (gnu packages libedit)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pkg-config)
@@ -15081,6 +15082,43 @@ interface.  This package provides that key-value store 
API interface.")
 and executing an @acronym{FST, finite state transducer}.")
     (license license:asl2.0)))
 
+(define-public blevesearch-faiss
+  (let ((commit "608356b7c9630e891ff87cc49cc7bb460c3870d3")
+        (revision "0"))
+    (package
+      (inherit faiss)
+      (name "blevesearch-faiss")
+      (version (git-version "1.11.0" revision commit))
+      (source
+       (origin
+         (inherit (package-source faiss))
+         (uri (git-reference
+                (url "https://github.com/blevesearch/faiss";)
+                (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0m0hyqn9db0xdbvan0lin7xf11dl4xdpjwwpagw01hl4z72w3al0"))))
+      (arguments
+       (substitute-keyword-arguments (package-arguments faiss)
+         ((#:configure-flags flags '())
+          ;; Add -fpermissive to suppress errors about non-conforming code.
+          #~(cons "-DCMAKE_CXX_FLAGS=-fpermissive"
+                  #$flags))
+         ((#:test-exclude test-exclude #f)
+          "Threading.openmp|IVF.list_context")
+         ((#:phases phases #~%standard-phases)
+          #~(modify-phases #$phases
+              (add-after 'unpack 'fix-bugs
+                (lambda _
+                  ;; Add include directory to target.
+                  (substitute* "c_api/CMakeLists.txt"
+                    (("add_library\\(faiss_c [^\n]*" line)
+                     (string-append line "\n" 
"target_include_directories(faiss_c PRIVATE ${CMAKE_SOURCE_DIR})\n")))
+                  ;; Do not assign using initializer list.
+                  (substitute* "tests/test_hamming.cpp"
+                    (("\\{na, k, ids_ham_knn.data[^\n]*" all)
+                     (string-append "faiss::int_maxheap_array_t" 
all))))))))))))
+
 (define-public go-github-com-blevesearch-segment
   (package
     (name "go-github-com-blevesearch-segment")

Reply via email to