about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--loftix/deduction.scm61
-rw-r--r--patches/fuzzy-sat-include.patch83
-rw-r--r--patches/fuzzy-sat-install.patch37
3 files changed, 64 insertions, 117 deletions
diff --git a/loftix/deduction.scm b/loftix/deduction.scm
index bea4420..dd84df2 100644
--- a/loftix/deduction.scm
+++ b/loftix/deduction.scm
@@ -9,7 +9,6 @@
   #:use-module (gnu packages digest)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages python-build)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system pyproject)
   #:use-module (guix download)
@@ -18,39 +17,40 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages))
 
-(define z3-for-fuzzolic
+(define-public z3-for-fuzzolic
   (let* ((base z3)
          (base-version "4.14.1")
          (base-tag (string-append "z3-" base-version))
          (revision "fuzzolic")
-         (commit "8a9e291dc2117e5cf48bdf2810f254000c6dd3d9")
+         (commit "268d10d0d99083a18cde2d615e0f9de82d7b201d")
          (upstream "https://github.com/Z3Prover/z3"))
-    (package
-      (inherit base)
-      (name "z3-for-fuzzolic")
-      (version (git-version base-version revision commit))
-      (source
-       (origin
-         (inherit (package-source base))
-         (uri (git-reference (url upstream)
-                             (commit base-tag)))
-         (file-name (git-file-name name version))
-         (sha256
-          (base32 "1gdknrqnnigfh1h833ks3vbrp4j74mfg6188c0k4xbl5zv6h6fx5"))
-         (patches
-          (list
-            (origin
-              (method url-fetch)
-              (uri (string-append upstream "/compare/" base-tag
-                                  ".." commit ".diff"))
-              (sha256
-               (base32 "1qgfz4rz4xm1ivr5s0wz5d16mc1gr5yyc400sfbxm8r288pb56bq"))
-              (file-name (string-append name ".patch")))))))
-      (home-page "https://github.com/season-lab/z3")
-      (synopsis "Z3 for FUZZOLIC"))))
+    (hidden-package
+     (package
+       (inherit base)
+       (name "z3-for-fuzzolic")
+       (version (git-version base-version revision commit))
+       (source
+        (origin
+          (inherit (package-source base))
+          (uri (git-reference (url upstream)
+                              (commit base-tag)))
+          (file-name (git-file-name name version))
+          (sha256
+           (base32 "1gdknrqnnigfh1h833ks3vbrp4j74mfg6188c0k4xbl5zv6h6fx5"))
+          (patches
+           (list
+             (origin
+               (method url-fetch)
+               (uri (string-append upstream "/compare/" base-tag
+                                   ".." commit ".diff"))
+               (sha256
+                (base32 "07fga2jn5830fz9snwbzz2mpm2qqfjchsb969rqs7pf5py0h93fp"))
+               (file-name (string-append name ".patch")))))))
+       (home-page "https://github.com/season-lab/z3")
+       (synopsis "Z3 for FUZZOLIC")))))
 
 (define-public fuzzy-sat
-  (let ((commit "5939b998a28ce2017b2c0dd89434792ab9ce5e51"))
+  (let ((commit "99094f664abcc7cb8ff7d04eb894616b89a15efc"))
     (package
       (name "fuzzy-sat")
       (version (git-version "0.1" "master" commit))
@@ -62,16 +62,15 @@
                             (commit commit)))
          (file-name (git-file-name name version))
          (sha256
-          (base32 "1wm8sznv9w09vfb6nk1c4kbych34zpiywxkz37az81wsvpbwk82s"))
-         (patches (search-patches "patches/fuzzy-sat-include.patch"
-                                  "patches/fuzzy-sat-unbundle.patch"
+          (base32 "1wq2a5j73aigw64bhf4s2qgkda114vfpmwiy353m0f54f5fg6sh3"))
+         (patches (search-patches "patches/fuzzy-sat-unbundle.patch"
                                   "patches/fuzzy-sat-install.patch"))))
       (build-system cmake-build-system)
       (arguments
        '(#:phases (modify-phases %standard-phases
                     (replace 'check
                       (lambda* (#:key source tests? #:allow-other-keys)
-                        (when (not tests?)
+                        (when tests?
                           (setenv "FUZZY_BIN" "tools/fuzzy-solver")
                           (invoke "pytest" "-p" "no:cacheprovider" "-v"
                                   (string-append source "/tests/run.py"))))))))
diff --git a/patches/fuzzy-sat-include.patch b/patches/fuzzy-sat-include.patch
deleted file mode 100644
index 6798bbd..0000000
--- a/patches/fuzzy-sat-include.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-commit bfd24f9cb93fab5317d16c879857221cc70e54c8
-Author: Nguyễn Gia Phong <cnx@loang.net>
-Date:   2025-04-24 11:25:20 +0900
-
-    Include stdio.h
-
-diff --git a/lib/testcase-list.c b/lib/testcase-list.c
-index 0aa223b7a7e4..6457fd5cab87 100644
---- a/lib/testcase-list.c
-+++ b/lib/testcase-list.c
-@@ -1,4 +1,5 @@
- #include <fts.h>
-+#include <stdio.h>
- #include <stdlib.h>
- #include "testcase-list.h"
- 
-diff --git a/lib/z3-fuzzy-debug-utils.h b/lib/z3-fuzzy-debug-utils.h
-index 0f6f3b891a52..7b88add6c294 100644
---- a/lib/z3-fuzzy-debug-utils.h
-+++ b/lib/z3-fuzzy-debug-utils.h
-@@ -1,3 +1,5 @@
-+#include <stdio.h>
-+
- static inline void print_index_queue(ast_info_ptr data)
- {
-     index_group_t* group;
-diff --git a/lib/z3-fuzzy.c b/lib/z3-fuzzy.c
-index cac1c329088d..69ecb006fd1f 100644
---- a/lib/z3-fuzzy.c
-+++ b/lib/z3-fuzzy.c
-@@ -1,6 +1,7 @@
- #define FUZZY_SOURCE
- 
- #include <fcntl.h>
-+#include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include "gradient_descend.h"
-diff --git a/tools/fuzzy-solver-notify.c b/tools/fuzzy-solver-notify.c
-index 821d3aaff15f..97abd8f71488 100644
---- a/tools/fuzzy-solver-notify.c
-+++ b/tools/fuzzy-solver-notify.c
-@@ -1,5 +1,6 @@
- #define FUZZY_SOURCE
- 
-+#include <stdio.h>
- #include <stdlib.h>
- #include <assert.h>
- #include <sys/time.h>
-diff --git a/tools/fuzzy-solver-vs-z3.c b/tools/fuzzy-solver-vs-z3.c
-index 8803ff390fa2..ba4e8f5b979a 100644
---- a/tools/fuzzy-solver-vs-z3.c
-+++ b/tools/fuzzy-solver-vs-z3.c
-@@ -1,3 +1,4 @@
-+#include <stdio.h>
- #include <stdlib.h>
- #include <assert.h>
- #include <sys/time.h>
-diff --git a/tools/stats-collection-fuzzy.c b/tools/stats-collection-fuzzy.c
-index fdef41761726..c793b1df717d 100644
---- a/tools/stats-collection-fuzzy.c
-+++ b/tools/stats-collection-fuzzy.c
-@@ -1,3 +1,4 @@
-+#include <stdio.h>
- #include <stdlib.h>
- #include <assert.h>
- #include <sys/time.h>
-diff --git a/tools/stats-collection-z3.c b/tools/stats-collection-z3.c
-index 504648a1a6c3..f101eeedb32f 100644
---- a/tools/stats-collection-z3.c
-+++ b/tools/stats-collection-z3.c
-@@ -1,3 +1,4 @@
-+#include <stdio.h>
- #include <stdlib.h>
- #include <assert.h>
- #include <sys/time.h>
-@@ -105,4 +106,4 @@ int main(int argc, char* argv[])
-     Z3_del_context(ctx);
-     fclose(log_file);
-     return 0;
--}
-\ No newline at end of file
-+}
diff --git a/patches/fuzzy-sat-install.patch b/patches/fuzzy-sat-install.patch
index 3ea77a1..2c68cbc 100644
--- a/patches/fuzzy-sat-install.patch
+++ b/patches/fuzzy-sat-install.patch
@@ -1,11 +1,42 @@
-commit d36429fa541c69c566f981cd159b82f85d02b4fd
+commit 3a8ce277d2f26409a1eb139641f0733979bd21ab
 Author: Nguyễn Gia Phong <cnx@loang.net>
 Date:   2025-04-24 13:10:50 +0900
 
     Install libraries and tools
 
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7cfa95cc7174..695bc8757fa5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ cmake_minimum_required(VERSION 3.7)
+-
++include(CMakePackageConfigHelpers)
+ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
+ 
+ project(Z3Fuzzy)
+@@ -7,3 +7,10 @@ project(Z3Fuzzy)
+ set(Z3_BUILD_PYTHON_BINDINGS true)
+ add_subdirectory(lib)
+ add_subdirectory(tools)
++
++install(EXPORT Z3Fuzzy DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Z3Fuzzy)
++configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
++  "${CMAKE_CURRENT_BINARY_DIR}/Z3FuzzyConfig.cmake"
++  INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Z3Fuzzy)
++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Z3FuzzyConfig.cmake"
++        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Z3Fuzzy)
+diff --git a/Config.cmake.in b/Config.cmake.in
+new file mode 100644
+index 000000000000..64b0eaa487fb
+--- /dev/null
++++ b/Config.cmake.in
+@@ -0,0 +1,3 @@
++@PACKAGE_INIT@
++include("${CMAKE_CURRENT_LIST_DIR}/Z3Fuzzy.cmake")
++check_required_components(Z3Fuzzy)
 diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
-index 558c01b7c725..aca4d9210862 100644
+index 558c01b7c725..c30f0f41206a 100644
 --- a/lib/CMakeLists.txt
 +++ b/lib/CMakeLists.txt
 @@ -31,7 +31,9 @@ target_link_libraries(Z3Fuzzy_static
@@ -20,7 +51,7 @@ index 558c01b7c725..aca4d9210862 100644
 +                      PUBLIC_HEADER z3-fuzzy.h)
  
 -install(FILES z3-fuzzy.h DESTINATION include)
-+install(TARGETS Z3Fuzzy_shared Z3Fuzzy_static)
++install(TARGETS Z3Fuzzy_shared Z3Fuzzy_static EXPORT Z3Fuzzy)
 diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
 index a9c1a07fc541..732818c3ad9e 100644
 --- a/tools/CMakeLists.txt