| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 |
|
| 24 | (define-module (gnu packages prolog)
|
| 25 | #:use-module (guix download)
|
| 26 | #:use-module (guix gexp)
|
| 27 | #:use-module (guix git-download)
|
| 28 | #:use-module ((guix licenses) #:prefix license:)
|
| 29 | #:use-module (guix packages)
|
| 30 | #:use-module (guix build-system cargo)
|
| 31 | #:use-module (guix build-system cmake)
|
| 32 | #:use-module (guix build-system gnu)
|
| 33 | #:use-module (guix utils)
|
| 34 | #:use-module (gnu packages backup)
|
| 35 | #:use-module (gnu packages bash)
|
| 36 | #:use-module (gnu packages compression)
|
| 37 | #:use-module (gnu packages crypto)
|
| 38 | #:use-module (gnu packages curl)
|
| 39 | #:use-module (gnu packages fontutils)
|
| 40 | #:use-module (gnu packages game-development)
|
| 41 | #:use-module (gnu packages image)
|
| 42 | #:use-module (gnu packages libedit)
|
| 43 | #:use-module (gnu packages libffi)
|
| 44 | #:use-module (gnu packages libunwind)
|
| 45 | #:use-module (gnu packages maths)
|
| 46 | #:use-module (gnu packages multiprecision)
|
| 47 | #:use-module (gnu packages perl)
|
| 48 | #:use-module (gnu packages pkg-config)
|
| 49 | #:use-module (gnu packages readline)
|
| 50 | #:use-module (gnu packages sqlite)
|
| 51 | #:use-module (gnu packages texinfo)
|
| 52 | #:use-module (gnu packages tls)
|
| 53 | #:use-module (gnu packages valgrind)
|
| 54 | #:use-module (gnu packages version-control)
|
| 55 | #:use-module (gnu packages vim)
|
| 56 | #:use-module (gnu packages xorg)
|
| 57 | #:use-module (srfi srfi-1))
|
| 58 |
|
| 59 | (define-public gprolog
|
| 60 | (package
|
| 61 | (name "gprolog")
|
| 62 | (version "1.5.0")
|
| 63 | (source
|
| 64 | (origin
|
| 65 | (method url-fetch)
|
| 66 | |
| 67 | (uri (list (string-append "http://gprolog.org/gprolog-" version
|
| 68 | ".tar.gz")
|
| 69 | (string-append "mirror://gnu/gprolog/gprolog-" version
|
| 70 | ".tar.gz")))
|
| 71 | (sha256
|
| 72 | (base32
|
| 73 | "009ca4wn2q6xdmb0js0vz647cw5ygsqyyqc9svmjgahg7js441k7"))))
|
| 74 | (build-system gnu-build-system)
|
| 75 | (arguments
|
| 76 | `(#:configure-flags
|
| 77 | (list (string-append
|
| 78 | "--with-install-dir=" %output "/share/gprolog"))
|
| 79 | #:phases
|
| 80 | (modify-phases %standard-phases
|
| 81 | (add-before 'configure 'change-dir
|
| 82 | (lambda _
|
| 83 | (chdir "src"))))))
|
| 84 | (home-page "https://www.gnu.org/software/gprolog/")
|
| 85 | (synopsis "Prolog compiler")
|
| 86 | (description
|
| 87 | "GNU Prolog is a standards-compliant Prolog compiler with constraint
|
| 88 | solving over finite domains. It accepts Prolog+ constraint programs and
|
| 89 | produces a compiled, native binary which can function in a stand-alone
|
| 90 | manner. It also features an interactive interpreter.")
|
| 91 | (license (list license:gpl2+
|
| 92 | license:lgpl3+))
|
| 93 |
|
| 94 | |
| 95 | (supported-systems (fold delete
|
| 96 | %supported-systems
|
| 97 | '("armhf-linux" "mips64el-linux")))))
|
| 98 |
|
| 99 | (define-public scryer-prolog
|
| 100 | (package
|
| 101 | (name "scryer-prolog")
|
| 102 | (version "0.10.0")
|
| 103 | (source
|
| 104 | (origin
|
| 105 | (method url-fetch)
|
| 106 | (uri (crate-uri "scryer-prolog" version))
|
| 107 | (file-name (string-append name "-" version ".tar.gz"))
|
| 108 | (sha256
|
| 109 | (base32 "08sn216bcwjx8y62pl3idfjpc1kxw0p0kq5zj3ydpjnnm0gmn03i"))))
|
| 110 | (build-system cargo-build-system)
|
| 111 | (arguments
|
| 112 | (list #:install-source? #f
|
| 113 | #:cargo-build-flags ''("--no-default-features")
|
| 114 | #:cargo-test-flags
|
| 115 | ''("--"
|
| 116 | "--skip=issues::issue_delete_directory"
|
| 117 | "--skip=issues::issue_delete_file"
|
| 118 | "--skip=issues::issue_directory_files"
|
| 119 | "--skip=issues::issue_file_copy"
|
| 120 | "--skip=issues::issue_file_exists"
|
| 121 | "--skip=issues::issue_file_size"
|
| 122 | "--skip=issues::issue_file_time"
|
| 123 | "--skip=issues::issue_make_directory"
|
| 124 | "--skip=issues::issue_make_directory_path"
|
| 125 | "--skip=issues::issue_path_canonical"
|
| 126 | "--skip=issues::issue_rename_file")))
|
| 127 | (inputs
|
| 128 | (cons* libffi
|
| 129 | openssl
|
| 130 | (cargo-inputs 'scryer-prolog)))
|
| 131 | (native-inputs
|
| 132 | (cons* pkg-config
|
| 133 | (if (%current-target-system)
|
| 134 | (list this-package)
|
| 135 | '())))
|
| 136 | (home-page "https://github.com/mthom/scryer-prolog")
|
| 137 | (synopsis "Modern Prolog implementation written mostly in Rust")
|
| 138 | (description
|
| 139 | "Scryer Prolog aims to provide an open source industrial strength
|
| 140 | production environment that is also a testbed for bleeding edge research in
|
| 141 | logic and constraint programming, which is itself written in a high-level
|
| 142 | language.")
|
| 143 | (license license:bsd-3)))
|
| 144 |
|
| 145 | (define-public swi-prolog
|
| 146 | (package
|
| 147 | (name "swi-prolog")
|
| 148 | (version "9.3.8")
|
| 149 | (source (origin
|
| 150 | (method git-fetch)
|
| 151 | (uri (git-reference
|
| 152 | (url "https://github.com/SWI-Prolog/swipl-devel")
|
| 153 | (recursive? #t) |
| 154 | (commit (string-append "V" version))))
|
| 155 | (file-name (git-file-name name version))
|
| 156 | (sha256
|
| 157 | (base32
|
| 158 | "1q2dg7n3vf0qc9nxppbcqgbzj4rcjw8sv2vbg9s6i4ixxlsxr5y3"))))
|
| 159 | (build-system cmake-build-system)
|
| 160 | (arguments
|
| 161 | `(#:parallel-build? #t
|
| 162 | #:configure-flags
|
| 163 | ,#~(list
|
| 164 | #$@(if (%current-target-system)
|
| 165 | |
| 166 | |
| 167 | |
| 168 | #~("-DBSD_SIGNALS=1" "-DQSORT_R_GNU=1"
|
| 169 | |
| 170 | "-DCMAKE_HOST_CC=gcc"
|
| 171 | |
| 172 | |
| 173 | "-DSWIPL_NATIVE_FRIEND=/nowhere"
|
| 174 | (string-append "-DPROG_SWIPL="
|
| 175 | #+(this-package-native-input "swi-prolog")
|
| 176 | "/bin/swipl"))
|
| 177 | #~())
|
| 178 | (string-append "-DPOSIX_SHELL="
|
| 179 | #$(this-package-input "bash-minimal")
|
| 180 | "/bin/sh")
|
| 181 | "-DINSTALL_DOCUMENTATION=ON"
|
| 182 | "-DSWIPL_INSTALL_IN_LIB=OFF") |
| 183 | #:phases
|
| 184 | ,#~(modify-phases %standard-phases
|
| 185 | |
| 186 | |
| 187 | (add-after 'unpack 'delete-failing-tests
|
| 188 | (lambda _
|
| 189 | (substitute* "src/CMakeLists.txt"
|
| 190 | ((" save") ""))
|
| 191 | (substitute* "src/test.pl"
|
| 192 | (("testdir\\('Tests/save'\\).") ""))
|
| 193 | (delete-file-recursively "src/Tests/save")))
|
| 194 | #$@(if (%current-target-system)
|
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | #~((add-after 'install 'fix-cross-references
|
| 200 | (lambda _
|
| 201 | (define bin `(,(string-append #$output "/bin")))
|
| 202 | (for-each (lambda (file) (patch-shebang file bin))
|
| 203 | (find-files #$output ".pl$")))))
|
| 204 | #~()))))
|
| 205 | (native-inputs
|
| 206 | `(,@(if (%current-target-system)
|
| 207 | (begin
|
| 208 | (unless (equal? (target-64bit?)
|
| 209 | (target-64bit? (%current-system)))
|
| 210 | (error "swi-prolog requires --system and --target to have \
|
| 211 | the same word size"))
|
| 212 | `(("swi-prolog" ,this-package)))
|
| 213 | '())
|
| 214 | ("texinfo" ,texinfo)
|
| 215 | ("perl" ,perl)
|
| 216 | ("pkg-config" ,pkg-config)))
|
| 217 | (inputs
|
| 218 | `(("bash-minimal" ,bash-minimal) |
| 219 | ("zlib" ,zlib)
|
| 220 | ("gmp" ,gmp)
|
| 221 | ("readline" ,readline)
|
| 222 | ("libarchive" ,libarchive)
|
| 223 | ("libunwind" ,libunwind)
|
| 224 | ("libjpeg" ,libjpeg-turbo)
|
| 225 | ("libxcrypt" ,libxcrypt)
|
| 226 | ("libxft" ,libxft)
|
| 227 | ("fontconfig" ,fontconfig)
|
| 228 | ("openssl" ,openssl)))
|
| 229 | (home-page "https://www.swi-prolog.org/")
|
| 230 | (synopsis "ISO/Edinburgh-style Prolog interpreter")
|
| 231 | (description "SWI-Prolog is a fast and powerful ISO/Edinburgh-style Prolog
|
| 232 | compiler with a rich set of built-in predicates. It offers a fast, robust and
|
| 233 | small environment which enables substantial applications to be developed with
|
| 234 | it.")
|
| 235 | (license license:bsd-2)))
|
| 236 |
|
| 237 | (define-public trealla
|
| 238 | (package
|
| 239 | (name "trealla")
|
| 240 | (version "3.13.13")
|
| 241 | (source
|
| 242 | (origin
|
| 243 | (method git-fetch)
|
| 244 | (uri
|
| 245 | (git-reference
|
| 246 | (url "https://github.com/trealla-prolog/trealla")
|
| 247 | (commit (string-append "v" version))))
|
| 248 | (sha256
|
| 249 | (base32 "04c5avsr0rbcbjs4b1yns70yzvksz3cvwh8i4sjhlk0z6yjqacvp"))
|
| 250 | (file-name (git-file-name name version))))
|
| 251 | (build-system gnu-build-system)
|
| 252 | (inputs
|
| 253 | (list curl
|
| 254 | gsl
|
| 255 | libedit
|
| 256 | libffi
|
| 257 | openssl
|
| 258 | raylib
|
| 259 | readline
|
| 260 | sqlite))
|
| 261 | (arguments
|
| 262 | (list
|
| 263 | #:make-flags
|
| 264 | #~(list (string-append "PREFIX=" #$output)
|
| 265 | (string-append "CC=" #$(cc-for-target))
|
| 266 | (string-append "HOST_CC=" #$(cc-for-target)))
|
| 267 | #:test-target "test"
|
| 268 | #:phases
|
| 269 | #~(modify-phases %standard-phases
|
| 270 | |
| 271 | (delete 'configure)
|
| 272 | (add-before 'build 'patch-package-version
|
| 273 | (lambda _
|
| 274 | (substitute* "GNUmakefile"
|
| 275 | (("\\$\\(shell git describe --abbrev=4 --dirty --always --tags\\)")
|
| 276 | (string-append "v" #$version)))))
|
| 277 | (add-after 'unpack 'fix-paths
|
| 278 | (lambda* (#:key inputs #:allow-other-keys)
|
| 279 | (substitute* "library/curl.pl"
|
| 280 | (("libcurl\\.so")
|
| 281 | (search-input-file inputs "lib/libcurl.so")))
|
| 282 | (substitute* "library/gsl.pl"
|
| 283 | (("libgsl\\.so")
|
| 284 | (search-input-file inputs "lib/libgsl.so"))
|
| 285 | (("libgslcblas\\.so")
|
| 286 | (search-input-file inputs "lib/libgslcblas.so")))
|
| 287 | (substitute* "library/raylib.pl"
|
| 288 | (("libraylib\\.so")
|
| 289 | (search-input-file inputs "lib/libraylib.so")))
|
| 290 | (substitute* "library/sqlite3.pl"
|
| 291 | (("libsqlite3\\.so")
|
| 292 | (search-input-file inputs "lib/libsqlite3.so"))))))))
|
| 293 | (home-page "https://trealla-prolog.org/")
|
| 294 | (synopsis "Compact and efficient Prolog interpreter")
|
| 295 | (description "This package provides a compact and efficient Prolog
|
| 296 | interpreter with ISO Prolog aspirations.")
|
| 297 | (license
|
| 298 | (list license:expat
|
| 299 | |
| 300 | license:unlicense))))
|
| 301 |
|
| 302 | (define-public logtalk
|
| 303 | (package
|
| 304 | (name "logtalk")
|
| 305 | (version "3.99.0")
|
| 306 | (source
|
| 307 | (origin
|
| 308 | (method url-fetch)
|
| 309 | (uri (string-append "https://logtalk.org/files/logtalk-"
|
| 310 | version ".tar.bz2"))
|
| 311 | (sha256 (base32 "04namz3lj2j1j741bb41qy5c172b9zawp1li148i7pd2s0jiwjjr"))))
|
| 312 | (build-system gnu-build-system)
|
| 313 | (arguments
|
| 314 | (list #:tests? #f |
| 315 | #:phases
|
| 316 | #~(modify-phases %standard-phases
|
| 317 | (delete 'configure) |
| 318 | (delete 'build)
|
| 319 | (replace 'install
|
| 320 | (lambda* (#:key outputs #:allow-other-keys)
|
| 321 | (mkdir #$output)
|
| 322 | (invoke "./scripts/install.sh" "-p" #$output))))))
|
| 323 | (native-search-paths
|
| 324 | (list (search-path-specification
|
| 325 | (variable "LOGTALKHOME")
|
| 326 | (separator #f) |
| 327 | (files '("share/logtalk")))))
|
| 328 | (home-page "https://logtalk.org/")
|
| 329 | (synopsis "Object-oriented logic programming language")
|
| 330 | (description "Logtalk is a declarative object-oriented logic programming language
|
| 331 | that extends and leverages the Prolog language with a feature set suitable for
|
| 332 | programming in the large. As a multi-paradigm language, Logtalk includes support for
|
| 333 | both prototypes and classes, protocols (interfaces), categories (components and
|
| 334 | hot-patching), event-driven programming, coinduction, lambda expressions, and
|
| 335 | high-level multi-threading programming.")
|
| 336 | |
| 337 | |
| 338 | (license (list license:asl2.0
|
| 339 | license:artistic2.0
|
| 340 | license:bsd-2
|
| 341 | license:bsd-3
|
| 342 | license:cc0
|
| 343 | license:expat
|
| 344 | license:gpl2+
|
| 345 | license:osl2.1))))
|