1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2026 Daniel Patrick Fahey <dpf@helmcontrol.ltd>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages opencog)
#:use-module (gnu packages)
#:use-module (gnu packages admin)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
#:use-module (gnu packages databases)
#:use-module (gnu packages guile)
#:use-module (gnu packages language)
#:use-module (gnu packages linux)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages networking)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages serialization)
#:use-module (gnu packages tls)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix build-system cmake)
#:use-module (guix utils))
(define-public cogutil
;; The last release was in 2016. Other OpenCog packages require a later
;; version.
(let ((commit "64dca9083dcfa485dcb70fd6fe7ba1f80e0f4082")
(revision "2"))
(package
(name "cogutil")
(version (git-version "2.0.3" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/opencog/cogutil")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"01rr39sq9wakw1wnfzg7m4zl7g8qh3d35ww6q39irx19d6nq66h9"))))
(build-system cmake-build-system)
(arguments
(list
;; Skip ldconfig, which requires root and is unnecessary in Guix.
#:configure-flags
#~(list "-DSKIP_LDCONF=ON")
#:modules '((guix build cmake-build-system)
((guix build gnu-build-system) #:prefix gnu:)
(guix build utils))
#:phases
#~(modify-phases %standard-phases
(replace 'check
(lambda* (#:key tests? #:allow-other-keys #:rest args)
(when tests?
(apply (assoc-ref gnu:%standard-phases 'check)
#:tests? tests? #:test-target "tests" args)
(for-each
(lambda (file)
(invoke file))
(find-files "tests" "UTest$"))))))))
(inputs
(list boost))
(native-inputs
`(("cxxtest" ,cxxtest)
("python" ,python-minimal)
("pkg-config" ,pkg-config)))
(home-page "https://github.com/opencog/cogutil/")
(synopsis "Low-level C++ programming utilities used by OpenCog components")
(description "The OpenCog utilities is a miscellaneous collection of C++
utilities use for typical programming tasks in multiple OpenCog projects.")
;; Either of these licenses.
(license (list license:agpl3 license:asl2.0)))))
(define-public atomspace
;; The last release was in 2016.
(let ((commit "c8d633bf272b838c2132c21b7c8ddf169a18dd22")
(revision "2"))
(package
(name "atomspace")
(version (git-version "5.0.3" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/opencog/atomspace")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"0fdqmskjh9d7363ldwmh3zhwal847shm15nhb2nan4g4aqdmckrz"))))
(build-system cmake-build-system)
(arguments
(list
#:configure-flags
#~(list "-DSKIP_LDCONF=ON"
(string-append "-DGUILE_INCLUDE_DIR=" #$guile-3.0.11
"/include/guile/3.0/")
(string-append "-DGUILE_SITE_DIR=" #$output
"/share/guile/site/3.0/")
(string-append "-DGUILE_CCACHE_DIR=" #$output
"/lib/guile/3.0/site-ccache")
(string-append "-DPYTHON_INSTALL_PREFIX=" #$output
"/lib/python3.11/site-packages"))
#:modules '((guix build cmake-build-system)
((guix build gnu-build-system) #:prefix gnu:)
(guix build utils))
#:phases
#~(modify-phases %standard-phases
(replace 'check
(lambda* (#:key tests? #:allow-other-keys #:rest args)
(when tests?
(apply (assoc-ref gnu:%standard-phases 'check)
#:tests? tests? #:test-target "tests" args)
;; Failing tests.
(for-each delete-file
'("tests/scm/MultiAtomSpaceUTest"))
(setenv "GUILE_LOAD_PATH" ".:opencog/scm")
(for-each invoke
(find-files "tests" "UTest$"))))))))
(inputs
(list boost cogutil gmp guile-3.0-latest postgresql))
(native-inputs
`(("cxxtest" ,cxxtest)
("python-cython" ,python-cython)
("python" ,python-minimal)
("pkg-config" ,pkg-config)))
(home-page "https://github.com/opencog/atomspace/")
(synopsis "OpenCog hypergraph database, query system and rule engine")
(description "The OpenCog AtomSpace is an in-RAM @dfn{knowledge
representation} (KR) database, an associated query engine and graph-re-writing
system, and a rule-driven inferencing engine that can apply and manipulate
sequences of rules to perform reasoning. It is a layer that sits on top of
ordinary distributed (graph) databases, providing a large variety of advanced
features not otherwise available.")
(license license:agpl3))))
(define-public atomspace-storage
;; Storage backends for AtomSpace.
(let ((commit "ecd88d673258e51f65cc0605400003affdf4d694")
(revision "0"))
(package
(name "atomspace-storage")
(version (git-version "0" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/opencog/atomspace-storage")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"12ssnc313cm5n8bc6zw53dkjm9crrry90lpsknzxafnm61mzcgx3"))))
(build-system cmake-build-system)
(arguments
(list
#:configure-flags
#~(list "-DSKIP_LDCONF=ON"
(string-append "-DGUILE_INCLUDE_DIR=" #$guile-3.0.11
"/include/guile/3.0/")
(string-append "-DGUILE_SITE_DIR=" #$output
"/share/guile/site/3.0/")
(string-append "-DGUILE_CCACHE_DIR=" #$output
"/lib/guile/3.0/site-ccache"))
#:modules '((guix build cmake-build-system)
((guix build gnu-build-system) #:prefix gnu:)
(guix build utils))
#:phases
#~(modify-phases %standard-phases
(replace 'check
(lambda* (#:key tests? #:allow-other-keys #:rest args)
(when tests?
(apply (assoc-ref gnu:%standard-phases 'check)
#:tests? tests? #:test-target "tests" args)
(for-each invoke
(find-files "tests" "UTest$"))))))))
(inputs
(list atomspace boost cogutil gmp guile-3.0-latest))
(native-inputs
(list cxxtest pkg-config python-minimal))
(home-page "https://github.com/opencog/atomspace-storage")
(synopsis "Storage backends for AtomSpace")
(description "AtomSpace-Storage provides various storage backends
for the AtomSpace hypergraph database.")
(license license:agpl3))))
(define-public cogserver
;; There are no releases.
(let ((commit "3c4da0bd786262bd69a8306f9da88b13f0add1f2")
(revision "3"))
(package
(name "cogserver")
(version (git-version "0" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/opencog/cogserver")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"0hfz9z44wpzrabs9fgxhv02jzn0i40di2ncbiizn03g7gccawds5"))))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;tests start network server and hang
#:configure-flags
#~(list "-DSKIP_LDCONF=ON"
(string-append "-DGUILE_INCLUDE_DIR=" #$guile-3.0.11
"/include/guile/3.0/")
(string-append "-DGUILE_SITE_DIR=" #$output
"/share/guile/site/3.0/")
(string-append "-DGUILE_CCACHE_DIR=" #$output
"/lib/guile/3.0/site-ccache")
(string-append "-DPYTHON_INSTALL_PREFIX=" #$output
"/lib/python3.11/site-packages"))
#:modules '((guix build cmake-build-system)
((guix build gnu-build-system) #:prefix gnu:)
(guix build utils))
#:phases
#~(modify-phases %standard-phases
(replace 'check
(lambda* (#:key tests? #:allow-other-keys #:rest args)
(when tests?
(apply (assoc-ref gnu:%standard-phases 'check)
#:tests? tests? #:test-target "tests" args)
;; Failing test.
(delete-file "tests/shell/ShellUTest")
(for-each invoke
(find-files "tests" "UTest$"))))))))
(inputs
(list asio atomspace atomspace-storage boost cogutil
gmp guile-3.0-latest jsoncpp openssl))
(native-inputs
`(("cxxtest" ,cxxtest)
("netcat" ,netcat-openbsd)
("python" ,python)
("python-cython" ,python-cython)
("pkg-config" ,pkg-config)))
(home-page "https://github.com/opencog/cogserver/")
(synopsis "OpenCog network server")
(description "The OpenCog Cogserver is a network and job server for the
OpenCog framework.")
(license license:agpl3))))
(define-public agi-bio
;; There are no releases.
(let ((commit "2f723ad79afc38df9dce73d340ee24c38efb2199")
(revision "2"))
(package
(name "agi-bio")
(version (git-version "0" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/opencog/agi-bio")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"1gqmwjbqdjr0qz4wpsxh0k8wam59fvd3pnjxhfswdpvapcl9syk0"))))
(build-system cmake-build-system)
(arguments
`(#:tests? #f ; there are none
#:configure-flags
(list
(string-append "-DGUILE_INCLUDE_DIR="
(assoc-ref %build-inputs "guile")
"/include/guile/3.0/")
(string-append "-DGUILE_SITE_DIR="
(assoc-ref %outputs "out")
"/share/guile/site/3.0/"))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'fix-unqualified-load
(lambda* (#:key outputs #:allow-other-keys)
(substitute* "bioscience/bioscience.scm"
(("\\(load \"bioscience/types/bioscience_types.scm\"\\)")
(format #f "(load \"~a/bioscience/types/bioscience_types.scm\")"
(string-append (assoc-ref outputs "out")
"/share/guile/site/3.0/opencog")))))))))
(inputs
(list atomspace cogutil gmp guile-3.0-latest))
(native-inputs
`(("cxxtest" ,cxxtest)
("python" ,python-minimal)
("pkg-config" ,pkg-config)))
(home-page "https://github.com/opencog/agi-bio")
(synopsis "Genomic and proteomic data exploration and pattern mining")
(description "This is a package for genomic and proteomic research using
the OpenCog toolset with Guile. This includes experiments in applying pattern
mining and other OpenCog components.")
(license license:agpl3))))
|