projects/guix·blob python-team · refs

113 lines · 4.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2026 Arun Isaac <[email protected]>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages datalog)
20 #:use-module (gnu packages bison)
21 #:use-module (gnu packages compression)
22 #:use-module (gnu packages cpp)
23 #:use-module (gnu packages compiler-tools)
24 #:use-module (gnu packages libffi)
25 #:use-module (gnu packages ncurses)
26 #:use-module (gnu packages python)
27 #:use-module (gnu packages sqlite)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix gexp)
30 #:use-module (guix git-download)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages))
33
34(define-public souffle
35 (package
36 (name "souffle")
37 (version "2.5")
38 (source (origin
39 (method git-fetch)
40 (uri (git-reference
41 (url "https://github.com/souffle-lang/souffle")
42 (commit version)))
43 (file-name (git-file-name name version))
44 (sha256
45 (base32
46 "1lrw69g02b17vxxz4g7cj8hbmc39wlzl80vl5fwy40a6b9pxwrsj"))
47 (snippet
48 #~(begin
49 ;; Delete bundled dependencies. souffle also uses a forked
50 ;; and modified version of json11. We cannot unbundle
51 ;; that.
52 (for-each delete-file
53 (list "licenses/TCBRINDLE SPAN.txt"
54 "licenses/TINYFORMAT.txt"
55 "src/include/souffle/utility/span.h"
56 "src/include/souffle/utility/tinyformat.h"))))))
57 (build-system cmake-build-system)
58 (arguments
59 (list #:configure-flags #~(list "-DSOUFFLE_GIT=OFF"
60 (string-append "-DPACKAGE_VERSION="
61 #$version))
62 ;; We disable these tests since they fail with gcc 14. This issue
63 ;; has been reported upstream:
64 ;; https://github.com/souffle-lang/souffle/issues/2576
65 #:test-exclude (string-join
66 (list "syntactic/cpp_keywords_run_souffle"
67 "syntactic/cpp_keywords_c_run_souffle"
68 "syntactic/cpp_keywords_compare_std_outputs"
69 "syntactic/cpp_keywords_compare_csv"
70 "syntactic/cpp_keywords_c_compare_std_outputs"
71 "syntactic/cpp_keywords_c_compare_csv")
72 "|")
73 #:phases
74 #~(modify-phases %standard-phases
75 (add-after 'unpack 'replace-bundled-libraries
76 (lambda _
77 ;; Patch souffle to use tinyformat from Guix.
78 (substitute* (find-files "src" "\\.(cpp|h)$")
79 (("#include \"souffle/utility/tinyformat.h\"")
80 "#include <tinyformat.h>"))
81 ;; Replace span.h with a header that uses span from Guix
82 ;; and provides the same namespace.
83 (call-with-output-file "src/include/souffle/utility/span.h"
84 (lambda (port)
85 (display "#pragma once
86#include <tcb/span.hpp>
87namespace souffle {
88 using tcb::span;
89}
90"
91 port))))))))
92 (inputs
93 (list libffi
94 ncurses
95 python
96 tcbrindle-span
97 sqlite
98 zlib))
99 (native-inputs
100 (list bison
101 flex
102 tinyformat))
103 (home-page "https://souffle-lang.github.io/")
104 (synopsis "Datalog variant")
105 (description "Soufflé is a variant of Datalog for tool designers crafting
106analyses in Horn clauses. Soufflé synthesizes a native parallel C++ program
107from a logic specification. The Soufflé language is similar to Datalog (but
108has terms known as records), and is frequently used as a domain-specific
109language for analysis problems.")
110 (license (list license:upl ; main license
111 ;; src/include/souffle/profile/htmlJsChartistPlugin.h
112 ;; src/include/souffle/utility/json11.h
113 license:expat))))