| 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 | (define-module (gnu packages lisp)
|
| 66 | #:use-module (gnu packages admin)
|
| 67 | #:use-module (gnu packages algebra)
|
| 68 | #:use-module (gnu packages autotools)
|
| 69 | #:use-module (gnu packages base)
|
| 70 | #:use-module (gnu packages bash)
|
| 71 | #:use-module (gnu packages bdw-gc)
|
| 72 | #:use-module (gnu packages boost)
|
| 73 | #:use-module (gnu packages build-tools)
|
| 74 | #:use-module (gnu packages check)
|
| 75 | #:use-module (gnu packages compression)
|
| 76 | #:use-module (gnu packages crypto)
|
| 77 | #:use-module (gnu packages curl)
|
| 78 | #:use-module (gnu packages dbm)
|
| 79 | #:use-module (gnu packages elf)
|
| 80 | #:use-module (gnu packages fontutils)
|
| 81 | #:use-module (gnu packages gcc)
|
| 82 | #:use-module (gnu packages gettext)
|
| 83 | #:use-module (gnu packages ghostscript)
|
| 84 | #:use-module (gnu packages gl)
|
| 85 | #:use-module (gnu packages glib)
|
| 86 | #:use-module (gnu packages groff)
|
| 87 | #:use-module (gnu packages haskell-check)
|
| 88 | #:use-module (gnu packages haskell-web)
|
| 89 | #:use-module (gnu packages haskell-xyz)
|
| 90 | #:use-module (gnu packages java)
|
| 91 | #:use-module (gnu packages libffcall)
|
| 92 | #:use-module (gnu packages libffi)
|
| 93 | #:use-module (gnu packages libsigsegv)
|
| 94 | #:use-module (gnu packages libunwind)
|
| 95 | #:use-module (gnu packages linux)
|
| 96 | #:use-module (gnu packages llvm)
|
| 97 | #:use-module (gnu packages m4)
|
| 98 | #:use-module (gnu packages maths)
|
| 99 | #:use-module (gnu packages multiprecision)
|
| 100 | #:use-module (gnu packages ncurses)
|
| 101 | #:use-module (gnu packages notcurses)
|
| 102 | #:use-module (gnu packages onc-rpc)
|
| 103 | #:use-module (gnu packages perl)
|
| 104 | #:use-module (gnu packages pkg-config)
|
| 105 | #:use-module (gnu packages pretty-print)
|
| 106 | #:use-module (gnu packages readline)
|
| 107 | #:use-module (gnu packages sdl)
|
| 108 | #:use-module (gnu packages stb)
|
| 109 | #:use-module (gnu packages tcl)
|
| 110 | #:use-module (gnu packages tex)
|
| 111 | #:use-module (gnu packages texinfo)
|
| 112 | #:use-module (gnu packages text-editors)
|
| 113 | #:use-module (gnu packages tls)
|
| 114 | #:use-module (gnu packages version-control)
|
| 115 | #:use-module (gnu packages xorg)
|
| 116 | #:use-module (gnu packages)
|
| 117 | #:use-module (guix build-system ant)
|
| 118 | #:use-module (guix build-system copy)
|
| 119 | #:use-module (guix build-system gnu)
|
| 120 | #:use-module (guix build-system haskell)
|
| 121 | #:use-module (guix build-system trivial)
|
| 122 | #:use-module (guix download)
|
| 123 | #:use-module (guix gexp)
|
| 124 | #:use-module (guix git-download)
|
| 125 | #:use-module ((guix licenses) #:prefix license:)
|
| 126 | #:use-module (guix packages)
|
| 127 | #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR $SSL_CERT_FILE))
|
| 128 | #:use-module (guix utils)
|
| 129 | #:use-module (ice-9 match)
|
| 130 | #:use-module (srfi srfi-1))
|
| 131 |
|
| 132 | (define-public abcl
|
| 133 | (package
|
| 134 | (name "abcl")
|
| 135 | (version "1.9.3")
|
| 136 | (source
|
| 137 | (origin
|
| 138 | (method url-fetch)
|
| 139 | (uri (string-append "https://abcl.org/releases/"
|
| 140 | version "/abcl-src-" version ".tar.gz"))
|
| 141 | (sha256
|
| 142 | (base32
|
| 143 | "1zxjpwv98bq2yd5qg08sbkajj17m7b8xmzqhw296161s7lia215v"))
|
| 144 | (patches
|
| 145 | (search-patches
|
| 146 | "abcl-fix-build-xml.patch"))))
|
| 147 | (build-system ant-build-system)
|
| 148 | (arguments
|
| 149 | (list
|
| 150 | #:build-target "abcl.jar"
|
| 151 | #:test-target "abcl.test"
|
| 152 | #:phases
|
| 153 | #~(modify-phases %standard-phases
|
| 154 | (replace 'install
|
| 155 | (lambda* (#:key inputs native-inputs #:allow-other-keys)
|
| 156 | (let ((share (string-append #$output "/share/java/"))
|
| 157 | (bin (string-append #$output "/bin/")))
|
| 158 | (mkdir-p share)
|
| 159 | (install-file "dist/abcl.jar" share)
|
| 160 | (install-file "dist/abcl-contrib.jar" share)
|
| 161 | (mkdir-p bin)
|
| 162 | (with-output-to-file (string-append bin "abcl")
|
| 163 | (lambda _
|
| 164 | (let ((bin-bash
|
| 165 | (search-input-file (or inputs native-inputs) "/bin/bash"))
|
| 166 | (bin-java
|
| 167 | (search-input-file (or inputs native-inputs) "/bin/java"))
|
| 168 | (classpath (string-append
|
| 169 | share "abcl.jar"
|
| 170 | ":"
|
| 171 | share "abcl-contrib.jar")))
|
| 172 |
|
| 173 | (format #t
|
| 174 | "\
|
| 175 | #!~a
|
| 176 | if [[ -z ${CLASSPATH} ]];
|
| 177 | then
|
| 178 | classpath=\"~a\"
|
| 179 | else
|
| 180 | classpath=\"~a:${CLASSPATH}\"
|
| 181 | fi
|
| 182 | exec ~a -cp ${classpath} org.armedbear.lisp.Main \"$@\"
|
| 183 | "
|
| 184 | bin-bash
|
| 185 | classpath
|
| 186 | classpath
|
| 187 | bin-java))))
|
| 188 | (chmod (string-append bin "abcl") #o755)))))))
|
| 189 | (native-inputs
|
| 190 | (list java-junit))
|
| 191 | (native-search-paths
|
| 192 | (list (search-path-specification
|
| 193 | (variable "XDG_DATA_DIRS")
|
| 194 | (files '("share")))))
|
| 195 | (home-page "https://abcl.org/")
|
| 196 | (synopsis "Common Lisp Implementation on the JVM")
|
| 197 | (description
|
| 198 | "@acronym{ABCL,Armed Bear Common Lisp} is a full implementation of the
|
| 199 | Common Lisp language featuring both an interpreter and a compiler, running in
|
| 200 | the JVM. It supports JSR-223 (Java scripting API): it can be a scripting
|
| 201 | engine in any Java application. Additionally, it can be used to
|
| 202 | implement (parts of) the application using Java to Lisp integration APIs.")
|
| 203 | (license
|
| 204 | (list license:gpl2+
|
| 205 | license:bsd-3 |
| 206 | license:cpl1.0)))) |
| 207 |
|
| 208 | (define-public buildapp
|
| 209 | (package
|
| 210 | (name "buildapp")
|
| 211 | (version "1.5.6")
|
| 212 | (source
|
| 213 | (origin
|
| 214 | (method git-fetch)
|
| 215 | (uri (git-reference
|
| 216 | (url "https://github.com/xach/buildapp")
|
| 217 | (commit (string-append "release-" version))))
|
| 218 | (file-name (git-file-name name version))
|
| 219 | (sha256
|
| 220 | (base32 "020ipjfqa3l8skd97cj5kq837wgpj28ygfxnkv64cnjrlbnzh161"))))
|
| 221 | (build-system gnu-build-system)
|
| 222 | (native-inputs
|
| 223 | (list sbcl))
|
| 224 | (arguments
|
| 225 | `(#:tests? #f
|
| 226 | #:make-flags
|
| 227 | (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
|
| 228 | #:strip-binaries? #f
|
| 229 | #:phases
|
| 230 | (modify-phases %standard-phases
|
| 231 | (delete 'configure)
|
| 232 | (add-after 'unpack 'set-home
|
| 233 | (lambda _
|
| 234 | (setenv "HOME" "/tmp")
|
| 235 | #t))
|
| 236 | (add-before 'install 'create-target-directory
|
| 237 | (lambda* (#:key outputs #:allow-other-keys)
|
| 238 | (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
|
| 239 | (mkdir-p bin)
|
| 240 | #t))))))
|
| 241 | (home-page "https://www.xach.com/lisp/buildapp/")
|
| 242 | (synopsis "Makes easy to build application executables with SBCL")
|
| 243 | (description
|
| 244 | "Buildapp is an application for SBCL or CCL that configures and saves an
|
| 245 | executable Common Lisp image. It is similar to cl-launch and hu.dwim.build.")
|
| 246 | (license license:bsd-2)))
|
| 247 |
|
| 248 | (define-public carp
|
| 249 | |
| 250 | (let ((commit "339722325ec607091f6035866ebedea2b69080fe")
|
| 251 | (revision "1"))
|
| 252 | (package
|
| 253 | (name "carp")
|
| 254 | (version (git-version "0.5.5" revision commit))
|
| 255 | (source (origin
|
| 256 | (method git-fetch)
|
| 257 | (uri (git-reference
|
| 258 | (url "https://github.com/carp-lang/Carp")
|
| 259 | (commit commit)))
|
| 260 | (file-name (git-file-name name version))
|
| 261 | (sha256
|
| 262 | (base32
|
| 263 | "0w0j3imi4270dsmrh96spsc9xllsk5rrh817l80q1nyay9p53xwd"))))
|
| 264 | (build-system haskell-build-system)
|
| 265 | (arguments
|
| 266 | (list #:phases
|
| 267 | #~(modify-phases %standard-phases
|
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | (add-after 'install 'wrap-programs
|
| 273 | (lambda* (#:key inputs #:allow-other-keys)
|
| 274 | (define (wrap-carp-program program)
|
| 275 | (wrap-program (string-append
|
| 276 | #$output "/bin/" program)
|
| 277 | `("CARP_DIR" prefix
|
| 278 | (#$(package-source this-package)))
|
| 279 | `("PATH" prefix
|
| 280 | ,(list (dirname
|
| 281 | (search-input-file inputs "bin/clang"))
|
| 282 | (dirname
|
| 283 | (search-input-file inputs "bin/ld"))))
|
| 284 | `("C_INCLUDE_PATH" prefix
|
| 285 | ,(list (dirname
|
| 286 | (search-input-directory
|
| 287 | inputs "include/linux"))
|
| 288 | (dirname
|
| 289 | (search-input-file
|
| 290 | inputs "include/stdlib.h"))))))
|
| 291 |
|
| 292 | (for-each wrap-carp-program
|
| 293 | (list "carp"
|
| 294 | "carp-header-parse")))))))
|
| 295 | (inputs
|
| 296 | (list bash-minimal
|
| 297 | clang-13
|
| 298 | ghc-blaze-markup
|
| 299 | ghc-blaze-html
|
| 300 | ghc-split
|
| 301 | ghc-ansi-terminal
|
| 302 | ghc-cmark
|
| 303 | ghc-edit-distance
|
| 304 | ghc-hashable
|
| 305 | ghc-open-browser
|
| 306 | ghc-optparse-applicative))
|
| 307 | (native-inputs
|
| 308 | (list ghc-hunit))
|
| 309 | (home-page "https://carp-lang.org/")
|
| 310 | (synopsis "Statically typed Lisp without a garbage collector")
|
| 311 | (description
|
| 312 | "@code{carp} is a Lisp-like programming language that compiles to
|
| 313 | C. It features inferred static typing, macros, automatic memory
|
| 314 | management without a garbage collector, a REPL, and straightforward
|
| 315 | integration with code written in C.")
|
| 316 | (license license:asl2.0))))
|
| 317 |
|
| 318 | (define-public ccl
|
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | (package
|
| 329 | (name "ccl")
|
| 330 | |
| 331 | |
| 332 | (version "1.13")
|
| 333 | (source (origin
|
| 334 | (method git-fetch)
|
| 335 | (uri (git-reference
|
| 336 | (url "https://github.com/Clozure/ccl/")
|
| 337 | (commit (string-append "v" version))))
|
| 338 | (file-name (git-file-name "ccl" version))
|
| 339 | (sha256
|
| 340 | (base32
|
| 341 | "12cb3gp43bhl7nyms3a4lix8j1s3arnp124d3ahc2lhlrjirs0mr"))))
|
| 342 | (build-system gnu-build-system)
|
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | (inputs
|
| 349 | `(("ccl-bootstrap"
|
| 350 | ,(origin
|
| 351 | (method url-fetch)
|
| 352 | (uri (string-append
|
| 353 | "https://github.com/Clozure/ccl/releases/download/v"
|
| 354 | (match (%current-system)
|
| 355 | ("armhf-linux" "1.13/linuxarm")
|
| 356 | |
| 357 | |
| 358 | |
| 359 | (_ "1.13/linuxx86"))
|
| 360 | ".tar.gz"))
|
| 361 | (sha256
|
| 362 | (base32
|
| 363 | (match (%current-system)
|
| 364 | ("armhf-linux"
|
| 365 | "1mlj7lgn4p9bw1ki7gk00sj89cjv0cjpdmpp65brhx9q3fvkk9xf")
|
| 366 | (_ "04ry8zwrcjjmzbxp43nkknchabk6i6mclrzg5biwfp1h64bcnzfx"))))))))
|
| 367 | (native-inputs
|
| 368 | (list cl-asdf m4))
|
| 369 | (arguments
|
| 370 | `(#:tests? #f |
| 371 | #:modules ((ice-9 match)
|
| 372 | (srfi srfi-26)
|
| 373 | (guix build utils)
|
| 374 | (guix build gnu-build-system))
|
| 375 | #:phases
|
| 376 | (modify-phases %standard-phases
|
| 377 | (add-after 'unpack 'unpack-image
|
| 378 | (lambda* (#:key inputs #:allow-other-keys)
|
| 379 | (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
|
| 380 | (add-after 'unpack 'replace-asdf
|
| 381 | |
| 382 | (lambda* (#:key inputs #:allow-other-keys)
|
| 383 | (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
|
| 384 | (guix-asdf (string-append
|
| 385 | cl-asdf
|
| 386 | "/share/common-lisp/source/asdf/asdf.lisp"))
|
| 387 | (contrib-asdf "tools/asdf.lisp"))
|
| 388 | (delete-file contrib-asdf)
|
| 389 | (copy-file guix-asdf contrib-asdf))))
|
| 390 | (delete 'configure)
|
| 391 | (add-before 'build 'pre-build
|
| 392 | |
| 393 | |
| 394 | (lambda* (#:key system #:allow-other-keys)
|
| 395 | (substitute* "lisp-kernel/m4macros.m4"
|
| 396 | (("/bin/pwd") (which "pwd")))
|
| 397 | (chdir (string-append
|
| 398 | "lisp-kernel/"
|
| 399 | (match system
|
| 400 | ("i686-linux" "linuxx8632")
|
| 401 | ("x86_64-linux" "linuxx8664")
|
| 402 | ("armhf-linux" "linuxarm")
|
| 403 | (_ (string-append "unknown system: " system)))))
|
| 404 | (substitute* '("Makefile")
|
| 405 | (("/bin/rm") "rm"))
|
| 406 | (setenv "CC" "gcc")
|
| 407 | (invoke "make" "clean")))
|
| 408 | |
| 409 | |
| 410 | (replace 'install
|
| 411 | (lambda* (#:key outputs inputs system #:allow-other-keys)
|
| 412 | |
| 413 | |
| 414 | |
| 415 | (chdir "../..")
|
| 416 | (let* ((out (assoc-ref outputs "out"))
|
| 417 | (libdir (string-append out "/lib/"))
|
| 418 | (bindir (string-append out "/bin/"))
|
| 419 | (wrapper (string-append bindir "ccl"))
|
| 420 | (bash (assoc-ref inputs "bash"))
|
| 421 | (kernel
|
| 422 | (match system
|
| 423 | ("i686-linux" "lx86cl")
|
| 424 | ("x86_64-linux" "lx86cl64")
|
| 425 | ("armhf-linux" "armcl")
|
| 426 | |
| 427 | (_ system)))
|
| 428 | (heap (string-append kernel ".image")))
|
| 429 | (install-file kernel libdir)
|
| 430 | (install-file heap libdir)
|
| 431 |
|
| 432 | (let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
|
| 433 | ,@(match system
|
| 434 | ("x86_64-linux"
|
| 435 | '("x86-headers64"))
|
| 436 | ("i686-linux"
|
| 437 | '("x86-headers"))
|
| 438 | (_ '())))))
|
| 439 | (for-each copy-recursively
|
| 440 | dirs
|
| 441 | (map (cut string-append libdir <>) dirs)))
|
| 442 |
|
| 443 | (mkdir-p bindir)
|
| 444 | (with-output-to-file wrapper
|
| 445 | (lambda ()
|
| 446 | (display
|
| 447 | (string-append
|
| 448 | "#!" bash "/bin/sh\n"
|
| 449 | "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
|
| 450 | "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
|
| 451 | (chmod wrapper #o755))
|
| 452 | #t)))))
|
| 453 | (native-search-paths
|
| 454 | (list (search-path-specification
|
| 455 | (variable "XDG_DATA_DIRS")
|
| 456 | (files '("share")))
|
| 457 | (search-path-specification
|
| 458 | (variable "XDG_CONFIG_DIRS")
|
| 459 | (files '("etc/xdg")))))
|
| 460 | (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
|
| 461 | (home-page "https://ccl.clozure.com/")
|
| 462 | (synopsis "Common Lisp implementation")
|
| 463 | (description "Clozure CL (often called CCL for short) is a Common Lisp
|
| 464 | implementation featuring fast compilation speed, native threads, a precise,
|
| 465 | generational, compacting garbage collector, and a convenient foreign-function
|
| 466 | interface.")
|
| 467 | (license license:asl2.0)))
|
| 468 |
|
| 469 | (define-public clasp-cl
|
| 470 | (package
|
| 471 | (name "clasp-cl")
|
| 472 | (version "2.7.0")
|
| 473 | (source
|
| 474 | (origin
|
| 475 | (method url-fetch)
|
| 476 | (uri (string-append
|
| 477 | "https://github.com/clasp-developers/clasp/releases/download/"
|
| 478 | version "/clasp-" version ".tar.gz"))
|
| 479 | (sha256
|
| 480 | (base32 "1sf8m0w3d4kagf4chb7viqndnr152crpsy979ll61krcfxaybc4j"))))
|
| 481 | (build-system gnu-build-system)
|
| 482 | (inputs
|
| 483 | (list boost clang-toolchain-19 fmt `(,gcc "lib") gmp elfutils libunwind))
|
| 484 | (native-inputs
|
| 485 | (list binutils-gold ninja pkg-config sbcl))
|
| 486 | (arguments
|
| 487 | `(#:phases
|
| 488 | (modify-phases %standard-phases
|
| 489 | (delete 'check)
|
| 490 | (add-after 'unpack 'fix-sh-paths
|
| 491 | (lambda _
|
| 492 | (substitute* '("dependencies/quicklisp-client/asdf.lisp"
|
| 493 | "src/lisp/modules/asdf/uiop/run-program.lisp"
|
| 494 | "src/lisp/modules/asdf/uiop/launch-program.lisp"
|
| 495 | "src/lisp/regression-tests/extensions.lisp")
|
| 496 | (("\"/bin/sh\"")
|
| 497 | (string-append "\"" (which "sh") "\"")))))
|
| 498 | (add-after 'unpack 'patch-koga
|
| 499 | (lambda* _
|
| 500 | (call-with-port (open-file "src/koga/units.lisp" "a")
|
| 501 | (lambda (p)
|
| 502 | (display "(defmethod configure-unit (c (u (eql :git))))\n" p)))))
|
| 503 | (add-before 'configure 'set-configure-environment
|
| 504 | (lambda* _
|
| 505 | (setenv "SOURCE_DATE_EPOCH" "1")
|
| 506 | (setenv "ASDF_OUTPUT_TRANSLATIONS"
|
| 507 | (string-append (getenv "PWD")
|
| 508 | ":"
|
| 509 | (getenv "PWD")
|
| 510 | "/__fasls"))))
|
| 511 | (replace 'configure
|
| 512 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 513 | (let* ((out (assoc-ref outputs "out"))
|
| 514 | (clang (assoc-ref inputs "clang-toolchain"))
|
| 515 | (ld-flags (string-join
|
| 516 | (apply append
|
| 517 | (map (lambda (f)
|
| 518 | (list "-L" f "-rpath" f))
|
| 519 | |
| 520 | (cons (string-append out "/lib")
|
| 521 | (string-split (getenv "LIBRARY_PATH") #\:))))
|
| 522 | ",")))
|
| 523 | (invoke "sbcl"
|
| 524 | "--script"
|
| 525 | "./koga"
|
| 526 | "--skip-sync"
|
| 527 | "--build-mode=bytecode-faso"
|
| 528 | (string-append "--cc=" clang "/bin/clang")
|
| 529 | (string-append "--cxx=" clang "/bin/clang++")
|
| 530 | (string-append "--ldflags=-Wl," ld-flags)
|
| 531 | "--reproducible-build"
|
| 532 | "--package-path=/"
|
| 533 | (string-append "--bin-path=" out "/bin")
|
| 534 | (string-append "--lib-path=" out "/lib/clasp")
|
| 535 | (string-append "--dylib-path=" out "/lib")
|
| 536 | (string-append "--pkgconfig-path=" out "/lib/pkgconfig")
|
| 537 | (string-append "--share-path=" out "/share/clasp")))))
|
| 538 | (replace 'build
|
| 539 | (lambda* (#:key parallel-build? #:allow-other-keys)
|
| 540 | (let ((jobs (if parallel-build?
|
| 541 | (number->string (parallel-job-count))
|
| 542 | "1")))
|
| 543 | (setenv "CLASP_BUILD_JOBS" jobs)
|
| 544 | (invoke "ninja" "-C" "build" "-j" jobs))))
|
| 545 | (replace 'install
|
| 546 | (lambda* _
|
| 547 | (invoke "ninja" "-C" "build" "install")))
|
| 548 | (add-after 'install 'install-lib
|
| 549 | (lambda* (#:key outputs #:allow-other-keys)
|
| 550 | (install-file "build/boehmprecise/lib/libclasp.so"
|
| 551 | (string-append (assoc-ref outputs "out") "/lib")))))))
|
| 552 | (native-search-paths
|
| 553 | (list (search-path-specification
|
| 554 | (variable "XDG_DATA_DIRS")
|
| 555 | (files '("share")))
|
| 556 | (search-path-specification
|
| 557 | (variable "XDG_CONFIG_DIRS")
|
| 558 | (files '("etc/xdg")))))
|
| 559 | (home-page "https://clasp-developers.github.io/")
|
| 560 | (synopsis "Common Lisp implementation based on LLVM and C++")
|
| 561 | (description "Clasp is a new Common Lisp implementation that seamlessly
|
| 562 | interoperates with C++ libraries and programs using LLVM for compilation to
|
| 563 | native code. This allows Clasp to take advantage of a vast array of
|
| 564 | preexisting libraries and programs, such as out of the scientific computing
|
| 565 | ecosystem. Embedding them in a Common Lisp environment allows you to make use
|
| 566 | of rapid prototyping, incremental development, and other capabilities that
|
| 567 | make it a powerful language.")
|
| 568 | (license license:lgpl2.1+)))
|
| 569 |
|
| 570 | (define-public cl-asdf
|
| 571 | (package
|
| 572 | (name "cl-asdf")
|
| 573 | (version "3.3.7")
|
| 574 | (source
|
| 575 | (origin
|
| 576 | (method url-fetch)
|
| 577 | (uri
|
| 578 | (string-append "https://common-lisp.net/project/asdf/archives/asdf-"
|
| 579 | version ".lisp"))
|
| 580 | (sha256
|
| 581 | (base32 "12dirg0qaq2rk8s11z7nnw793l94ysqna9mbqy8a0cx6bqiqykl7"))))
|
| 582 | (build-system trivial-build-system)
|
| 583 | (native-inputs
|
| 584 | `(("config-patch" ,@(search-patches "cl-asdf-config-directories.patch"))
|
| 585 | ("patch" ,patch/pinned)))
|
| 586 | (arguments
|
| 587 | `(#:modules ((guix build utils)
|
| 588 | (guix build lisp-utils))
|
| 589 | #:builder
|
| 590 | (begin
|
| 591 | (use-modules (guix build utils)
|
| 592 | (guix build lisp-utils))
|
| 593 | (let* ((out (string-append (assoc-ref %outputs "out")))
|
| 594 | (asdf-install (string-append out %source-install-prefix
|
| 595 | "/source/asdf/"))
|
| 596 | (src-asdf (string-append (assoc-ref %build-inputs "source")))
|
| 597 | (dst-asdf (string-append asdf-install "asdf.lisp"))
|
| 598 | (patch (string-append (assoc-ref %build-inputs "patch")
|
| 599 | "/bin/patch"))
|
| 600 | (config-patch (assoc-ref %build-inputs "config-patch")))
|
| 601 | (mkdir-p asdf-install)
|
| 602 | (copy-file src-asdf dst-asdf)
|
| 603 | (invoke patch "-p1" "-i" config-patch dst-asdf)))))
|
| 604 | (home-page "https://common-lisp.net/project/asdf/")
|
| 605 | (synopsis "Another System Definition Facility")
|
| 606 | (description
|
| 607 | "ASDF is what Common Lisp hackers use to build and load software. It is
|
| 608 | the successor of the Lisp DEFSYSTEM of yore. ASDF stands for Another System
|
| 609 | Definition Facility.")
|
| 610 | |
| 611 | (license license:expat)))
|
| 612 |
|
| 613 | (define (make-clisp-tests-locales)
|
| 614 | (make-glibc-utf8-locales
|
| 615 | glibc
|
| 616 | #:locales (list "de_DE" "en_US" "fr_FR" "ru_RU")
|
| 617 | #:name "clisp-tests-locales"))
|
| 618 |
|
| 619 | (define-public clisp
|
| 620 | (package
|
| 621 | (name "clisp")
|
| 622 | (version "2.49-92")
|
| 623 | (source
|
| 624 | (origin
|
| 625 | (method git-fetch)
|
| 626 | (uri (git-reference
|
| 627 | (url "https://gitlab.com/gnu-clisp/clisp")
|
| 628 | (commit "clisp-2.49.92-2018-02-18")))
|
| 629 | (file-name (git-file-name name version))
|
| 630 | (sha256
|
| 631 | (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))))
|
| 632 | (build-system gnu-build-system)
|
| 633 | (native-inputs
|
| 634 | (list
|
| 635 | (make-clisp-tests-locales)
|
| 636 | cl-asdf
|
| 637 | coreutils)) |
| 638 | (inputs
|
| 639 | (list
|
| 640 | libffcall
|
| 641 | ncurses
|
| 642 | readline
|
| 643 | libsigsegv))
|
| 644 | (arguments
|
| 645 | `(#:configure-flags '(,@(if (string-prefix? "armhf-linux"
|
| 646 | (or (%current-system)
|
| 647 | (%current-target-system)))
|
| 648 | '("CFLAGS=-falign-functions=4")
|
| 649 | '())
|
| 650 | ,@(if (target-x86-64?)
|
| 651 | '("--enable-portability"
|
| 652 | "--with-threads=POSIX_THREADS")
|
| 653 | '())
|
| 654 | "--with-dynamic-ffi"
|
| 655 | "--with-dynamic-modules"
|
| 656 | "--with-ffcall"
|
| 657 | "--with-readline"
|
| 658 | "--with-sigsegv"
|
| 659 | "--with-module=asdf"
|
| 660 | "--with-module=rawsock")
|
| 661 | #:phases
|
| 662 | (modify-phases %standard-phases
|
| 663 | (add-after 'unpack 'patch-references
|
| 664 | (lambda _
|
| 665 | |
| 666 | |
| 667 | |
| 668 | |
| 669 | |
| 670 | (substitute* '("src/clisp-link.in"
|
| 671 | "src/unix.d"
|
| 672 | "src/makemake.in")
|
| 673 | (("/bin/sh") (which "sh")))
|
| 674 | (substitute* (find-files "." "configure|Makefile")
|
| 675 | (("/bin/sh") "sh"))
|
| 676 | (substitute* '("src/clisp-link.in")
|
| 677 | (("/bin/pwd") "pwd"))
|
| 678 | (substitute* '("tests/streamslong.tst")
|
| 679 | (("/bin/cat") "cat"))
|
| 680 | #t))
|
| 681 | (add-after 'unpack 'replace-asdf
|
| 682 | |
| 683 | (lambda* (#:key inputs #:allow-other-keys)
|
| 684 | (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
|
| 685 | (guix-asdf (string-append
|
| 686 | cl-asdf
|
| 687 | "/share/common-lisp/source/asdf/asdf.lisp"))
|
| 688 | (contrib-asdf "modules/asdf/asdf.lisp"))
|
| 689 | (delete-file contrib-asdf)
|
| 690 | (copy-file guix-asdf contrib-asdf))))
|
| 691 | (add-after 'configure 'patch-parallel-tests
|
| 692 | (lambda _
|
| 693 | |
| 694 | |
| 695 | |
| 696 | |
| 697 | |
| 698 | (substitute* "src/Makefile"
|
| 699 | ((" check-tests-parallel ") " check-tests-all "))
|
| 700 | #t)))))
|
| 701 | (native-search-paths
|
| 702 | (list (search-path-specification
|
| 703 | (variable "XDG_DATA_DIRS")
|
| 704 | (files '("share")))
|
| 705 | (search-path-specification
|
| 706 | (variable "XDG_CONFIG_DIRS")
|
| 707 | (files '("etc/xdg")))))
|
| 708 | (home-page "https://clisp.sourceforge.io/")
|
| 709 | (synopsis "Common Lisp implementation")
|
| 710 | (description
|
| 711 | "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
|
| 712 | high-level, object-oriented functional programming language. CLISP includes
|
| 713 | an interpreter, a compiler, a debugger, and much more.")
|
| 714 | (license license:gpl2+)))
|
| 715 |
|
| 716 | (define-public ecl
|
| 717 | (package
|
| 718 | (name "ecl")
|
| 719 | (version "24.5.10")
|
| 720 | (source
|
| 721 | (origin
|
| 722 | (method url-fetch)
|
| 723 | (uri (string-append
|
| 724 | "https://ecl.common-lisp.dev/static/files/release/"
|
| 725 | name "-" version ".tgz"))
|
| 726 | (sha256
|
| 727 | (base32 "0av2prf474cg0glr37fgsfb4w0dxfg38pykb72ay9q3132xnbsp4"))))
|
| 728 | (build-system gnu-build-system)
|
| 729 | |
| 730 | (native-inputs
|
| 731 | (list cl-asdf which texinfo))
|
| 732 | (inputs (list bash-minimal))
|
| 733 | |
| 734 | |
| 735 | |
| 736 | |
| 737 | |
| 738 | |
| 739 | (propagated-inputs
|
| 740 | (list gmp libatomic-ops libgc libffi))
|
| 741 | (arguments
|
| 742 | `(#:configure-flags '("--without-rt")
|
| 743 | #:parallel-tests? #f
|
| 744 | #:phases
|
| 745 | (modify-phases %standard-phases
|
| 746 | |
| 747 | |
| 748 | (delete 'check)
|
| 749 | (add-after 'unpack 'replace-asdf
|
| 750 | |
| 751 | (lambda* (#:key inputs #:allow-other-keys)
|
| 752 | (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
|
| 753 | (guix-asdf (string-append
|
| 754 | cl-asdf
|
| 755 | "/share/common-lisp/source/asdf/asdf.lisp"))
|
| 756 | (contrib-asdf "contrib/asdf/asdf.lisp"))
|
| 757 | (copy-file guix-asdf contrib-asdf))))
|
| 758 | (add-after 'install 'remove-build-stamp
|
| 759 | (lambda* (#:key outputs #:allow-other-keys)
|
| 760 | (delete-file (string-append (assoc-ref outputs "out")
|
| 761 | "/lib/ecl-" ,version "/build-stamp"))))
|
| 762 | (add-after 'remove-build-stamp 'wrap
|
| 763 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 764 | (let* ((ecl (assoc-ref outputs "out"))
|
| 765 | (input-path (lambda (lib path)
|
| 766 | (string-append
|
| 767 | (assoc-ref inputs lib) path)))
|
| 768 | (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
|
| 769 | (binaries '("gcc" "ld-wrapper" "binutils"))
|
| 770 | (library-directories
|
| 771 | (map (lambda (lib) (input-path lib "/lib"))
|
| 772 | libraries)))
|
| 773 | (wrap-program (string-append ecl "/bin/ecl")
|
| 774 | `("PATH" prefix
|
| 775 | ,(map (lambda (binary)
|
| 776 | (input-path binary "/bin"))
|
| 777 | binaries))
|
| 778 | `("CPATH" suffix
|
| 779 | ,(map (lambda (lib)
|
| 780 | (input-path lib "/include"))
|
| 781 | `("kernel-headers" ,@libraries)))
|
| 782 | `("LIBRARY_PATH" suffix ,library-directories)
|
| 783 | `("LD_LIBRARY_PATH" suffix ,library-directories)))))
|
| 784 | (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
|
| 785 | (add-before 'check 'fix-path-to-ecl
|
| 786 | (lambda _
|
| 787 | (substitute* "build/tests/Makefile"
|
| 788 | (("\\$\\{exec_prefix\\}/") "")))))))
|
| 789 | (native-search-paths
|
| 790 | (list (search-path-specification
|
| 791 | (variable "XDG_DATA_DIRS")
|
| 792 | (files '("share")))
|
| 793 | (search-path-specification
|
| 794 | (variable "XDG_CONFIG_DIRS")
|
| 795 | (files '("etc/xdg")))))
|
| 796 | (home-page "https://ecl.common-lisp.dev/")
|
| 797 | (synopsis "Embeddable Common Lisp")
|
| 798 | (supported-systems (remove target-hurd? %supported-systems))
|
| 799 | (description "ECL is an implementation of the Common Lisp language as
|
| 800 | defined by the ANSI X3J13 specification. Its most relevant features are: a
|
| 801 | bytecode compiler and interpreter, being able to compile Common Lisp with any
|
| 802 | C/C++ compiler, being able to build standalone executables and libraries, and
|
| 803 | supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
|
| 804 | |
| 805 | |
| 806 | |
| 807 | |
| 808 | (license license:lgpl2.1+)))
|
| 809 |
|
| 810 | (define-public eisl
|
| 811 | (package
|
| 812 | (name "eisl")
|
| 813 | (version "5.56")
|
| 814 | (source
|
| 815 | (origin
|
| 816 | (method git-fetch)
|
| 817 | (uri (git-reference
|
| 818 | (url "https://github.com/sasagawa888/eisl")
|
| 819 | (commit (string-append "v" version))))
|
| 820 | (file-name (git-file-name name version))
|
| 821 | (sha256
|
| 822 | (base32 "0a20qgk04018yc72zw6bzq88b0hgkjwfkl2zjypflx362hs8s48a"))))
|
| 823 | (build-system gnu-build-system)
|
| 824 | (inputs
|
| 825 | (list bash-minimal freeglut gdbm libiconv ncurses tcl tk))
|
| 826 | (arguments
|
| 827 | (list #:make-flags
|
| 828 | #~(list (string-append "PREFIX=" #$output)
|
| 829 | (string-append "CC=" #$(cc-for-target)))
|
| 830 | #:tests? #f |
| 831 | #:phases
|
| 832 | #~(modify-phases %standard-phases
|
| 833 | (add-after 'unpack 'fix-paths
|
| 834 | (lambda* (#:key inputs #:allow-other-keys)
|
| 835 | (substitute* "library/compiler.lsp"
|
| 836 | (("\"cc ")
|
| 837 | "\"gcc "))
|
| 838 | (substitute* "library/tcltk.lsp"
|
| 839 | (("include <tcl/tcl\\.h>")
|
| 840 | "include <tcl.h>")
|
| 841 | (("c-option \"-ltcl -ltk\" linux")
|
| 842 | "c-option \"-ltcl8.6 -ltk8.6\" linux"))))
|
| 843 | (delete 'configure)
|
| 844 | (add-after 'build 'build-library
|
| 845 | (lambda _
|
| 846 | (setenv "CFLAGS"
|
| 847 | (string-append "-Wno-implicit-function-declaration "
|
| 848 | "-Wno-int-conversion "
|
| 849 | "-Wno-incompatible-pointer-types "))
|
| 850 | (invoke "make" "lisp")))
|
| 851 | (add-after 'install 'wrap
|
| 852 | (lambda* (#:key inputs #:allow-other-keys)
|
| 853 | (wrap-program (string-append #$output "/bin/eisl")
|
| 854 | `("PATH" prefix
|
| 855 | ,(map (lambda (bin)
|
| 856 | (string-append (assoc-ref inputs bin) "/bin"))
|
| 857 | '("binutils" "coreutils" "gcc" "ld-wrapper")))
|
| 858 | `("LIBRARY_PATH" suffix
|
| 859 | ,(map (lambda (lib)
|
| 860 | (string-append (assoc-ref inputs lib) "/lib"))
|
| 861 | '("libc")))))))))
|
| 862 | (home-page "https://github.com/sasagawa888/eisl")
|
| 863 | (synopsis "Implementation of ISLisp")
|
| 864 | (description "Easy ISLISP (eisl) is an implementation of ISLisp which
|
| 865 | includes a compiler as well as an interpreter.")
|
| 866 | (license (list license:bsd-2 |
| 867 | license:expat |
| 868 | license:gpl2+ |
| 869 | license:bsd-3)))) |
| 870 |
|
| 871 | (define-public gcl
|
| 872 | (package
|
| 873 | (name "gcl")
|
| 874 | (version "2.7.1")
|
| 875 | (source
|
| 876 | (origin
|
| 877 | (method git-fetch)
|
| 878 | (uri (git-reference
|
| 879 | (url "https://git.savannah.gnu.org/r/gcl.git")
|
| 880 | (commit (string-append "Version_"
|
| 881 | (string-map (lambda (c)
|
| 882 | (if (char=? c #\.) #\_ c))
|
| 883 | version)))))
|
| 884 | (file-name (git-file-name name version))
|
| 885 | (sha256
|
| 886 | (base32 "00jyzmpp8kszg5y6r62irlkwm40wg1l3gxxpgc9chld3mjx6w0q0"))))
|
| 887 | (build-system gnu-build-system)
|
| 888 | (arguments
|
| 889 | (list
|
| 890 | #:parallel-build? #f |
| 891 | #:phases
|
| 892 | #~(modify-phases %standard-phases
|
| 893 | (add-after 'unpack 'realpath-workaround
|
| 894 | |
| 895 | |
| 896 | |
| 897 | (lambda _
|
| 898 | (substitute* "gcl/o/main.c"
|
| 899 | (("massert\\(realpath\\(s,o\\)\\);" all)
|
| 900 | "massert((realpath(s, o) != NULL) && ((errno = 0) == 0));"))))
|
| 901 | (add-after 'unpack 'fix-missing-enum
|
| 902 | (lambda _
|
| 903 | |
| 904 | |
| 905 | (substitute* "gcl/o/main.c"
|
| 906 | (("my_fprintf_styled\\(void \\*v,enum disassembler_style,")
|
| 907 | "my_fprintf_styled(void *v,int disassembler_style,"))))
|
| 908 | (add-after 'unpack 'fix-makefile
|
| 909 | (lambda _
|
| 910 | |
| 911 | |
| 912 | |
| 913 | (substitute* "gcl/Makefile.in"
|
| 914 | (("C_INCLUDE_PATH=\\$\\(srcdir\\)/h:\\$\\(srcdir\\)/gcl-tk")
|
| 915 | "C_INCLUDE_PATH:=$(srcdir)/h:$(srcdir)/gcl-tk:$(C_INCLUDE_PATH)"))))
|
| 916 | (add-before 'configure 'pre-conf
|
| 917 | (lambda* (#:key inputs #:allow-other-keys)
|
| 918 | (chdir "gcl")
|
| 919 | (substitute* "configure"
|
| 920 | (("/usr/include/tirpc")
|
| 921 | (search-input-directory inputs "include/tirpc")))
|
| 922 | (substitute* "lsp/gcl_top.lsp"
|
| 923 | (("\\(or \\(get-path \\*cc\\*\\) \\*cc\\*\\)")
|
| 924 | (string-append "\"" (search-input-file inputs "bin/gcc") "\""))
|
| 925 |
|
| 926 | (("\\(or \\(get-path \\*ld\\*\\) \\*ld\\*\\)")
|
| 927 | (string-append "\"" (search-input-file inputs "bin/ld") "\""))
|
| 928 |
|
| 929 | (("\\(get-path \"objdump --source \"\\)")
|
| 930 | (string-append "\"" (search-input-file inputs "bin/objdump")
|
| 931 | " --source \"")))))
|
| 932 | (add-after 'install 'wrap
|
| 933 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 934 | (let* ((gcl #$output)
|
| 935 | (input-path (lambda (lib path)
|
| 936 | (string-append
|
| 937 | (assoc-ref inputs lib) path)))
|
| 938 | (binaries '("binutils")))
|
| 939 | |
| 940 | |
| 941 | |
| 942 | |
| 943 | |
| 944 | (wrap-program (string-append gcl "/bin/gcl")
|
| 945 | `("PATH" prefix ,(map (lambda (binary)
|
| 946 | (input-path binary "/bin"))
|
| 947 | binaries))))))
|
| 948 | |
| 949 | |
| 950 | (delete 'strip))))
|
| 951 | (inputs
|
| 952 | (list bash-minimal gmp libtirpc readline))
|
| 953 | (native-inputs
|
| 954 | (list m4 texinfo))
|
| 955 | (home-page "https://www.gnu.org/software/gcl/")
|
| 956 | (synopsis "Common Lisp implementation")
|
| 957 | (description "GCL is an implementation of the Common Lisp language. It
|
| 958 | features the ability to compile to native object code and to load native
|
| 959 | object code modules directly into its lisp core. It also features a
|
| 960 | stratified garbage collection strategy, a source-level debugger and a built-in
|
| 961 | interface to the Tk widget system.")
|
| 962 | (license license:lgpl2.0+)))
|
| 963 |
|
| 964 | (define-public janet
|
| 965 | (package
|
| 966 | (name "janet")
|
| 967 | (version "1.41.2")
|
| 968 | (source
|
| 969 | (origin
|
| 970 | (method git-fetch)
|
| 971 | (uri (git-reference
|
| 972 | (url "https://github.com/janet-lang/janet")
|
| 973 | (commit (string-append "v" version))))
|
| 974 | (file-name (git-file-name name version))
|
| 975 | (sha256
|
| 976 | (base32 "0fxczvlml5j1nmlzksalpq1ympha30cpkmvi7hk2n9xwc5q63m5h"))))
|
| 977 | (build-system gnu-build-system)
|
| 978 | (arguments
|
| 979 | (list #:make-flags
|
| 980 | #~(list
|
| 981 | (string-append "PREFIX=" #$output)
|
| 982 | (string-append "CC=" #$(cc-for-target)))
|
| 983 | #:test-target "test"
|
| 984 | #:phases
|
| 985 | #~(modify-phases %standard-phases
|
| 986 | (delete 'configure))))
|
| 987 | (native-search-paths
|
| 988 | (list (search-path-specification
|
| 989 | (variable "JANET_PATH")
|
| 990 | (files (list "lib/janet")))))
|
| 991 | (home-page "https://janet-lang.org/")
|
| 992 | (synopsis "Functional, imperative and embeddable programming language")
|
| 993 | (description
|
| 994 | "Janet is a functional and imperative programming language. It can be
|
| 995 | used for rapid prototyping, dynamic systems, and other domains where dynamic
|
| 996 | languages shine. You can also add Janet scripting to an application by
|
| 997 | embedding a single C file and two headers. It can be easily ported to new
|
| 998 | platforms. The entire language (core library, interpreter, compiler,
|
| 999 | assembler, PEG) is less than 1MB.")
|
| 1000 | (license license:expat)))
|
| 1001 |
|
| 1002 | (define-public jpm
|
| 1003 | (package
|
| 1004 | (name "jpm")
|
| 1005 | (version "1.2.0")
|
| 1006 | (source
|
| 1007 | (origin
|
| 1008 | (method git-fetch)
|
| 1009 | (uri (git-reference
|
| 1010 | (url "https://github.com/janet-lang/jpm")
|
| 1011 | (commit (string-append "v" version))))
|
| 1012 | (file-name (git-file-name name version))
|
| 1013 | (sha256
|
| 1014 | (base32 "06ywq1ajvqx3lfpldwbakc21hxhb313r0196xnmrrbb6k1f8hsfx"))))
|
| 1015 | (build-system copy-build-system)
|
| 1016 | (arguments
|
| 1017 | (list
|
| 1018 | #:phases
|
| 1019 | #~(modify-phases %standard-phases
|
| 1020 | (add-after 'unpack 'fix-paths
|
| 1021 | (lambda* (#:key inputs #:allow-other-keys)
|
| 1022 | (substitute* "configs/linux_config.janet"
|
| 1023 | (("/usr/local")
|
| 1024 | #$output)
|
| 1025 | (("\"cc\"")
|
| 1026 | (string-append "\""
|
| 1027 | (search-input-file inputs "/bin/gcc")
|
| 1028 | "\""))
|
| 1029 | (("\"c\\+\\+\"")
|
| 1030 | (string-append "\""
|
| 1031 | (search-input-file inputs "/bin/g++")
|
| 1032 | "\""))
|
| 1033 | (("\"git\"")
|
| 1034 | (string-append "\""
|
| 1035 | (search-input-file inputs "/bin/git")
|
| 1036 | "\""))
|
| 1037 | (("\"curl\"")
|
| 1038 | (string-append "\""
|
| 1039 | (search-input-file inputs "/bin/curl")
|
| 1040 | "\"")))
|
| 1041 | (substitute* "jpm/shutil.janet"
|
| 1042 | (("cp")
|
| 1043 | (string-append (search-input-file inputs "/bin/cp"))))
|
| 1044 | (setenv "PREFIX"
|
| 1045 | #$output)))
|
| 1046 | (replace 'install
|
| 1047 | (lambda* (#:key inputs #:allow-other-keys)
|
| 1048 | (for-each (lambda (dir)
|
| 1049 | (mkdir-p (string-append #$output "/" dir)))
|
| 1050 | '("lib/janet/jpm" "share/man/man1"))
|
| 1051 | (invoke "janet" "bootstrap.janet"
|
| 1052 | "configs/linux_config.janet")
|
| 1053 | (let ((gcc-toolchain (assoc-ref inputs "gcc-toolchain"))
|
| 1054 | (core-min (assoc-ref inputs "coreutils-minimal")))
|
| 1055 | (wrap-program (string-append #$output "/bin/jpm")
|
| 1056 | `("JANET_HEADERPATH" ":" prefix
|
| 1057 | (,(string-append #$janet "/include/janet")))
|
| 1058 | `("JANET_LIBPATH" ":" prefix
|
| 1059 | (,(string-append #$janet "/lib")))
|
| 1060 | `("C_INCLUDE_PATH" ":" prefix
|
| 1061 | (,(string-append gcc-toolchain "/include")))
|
| 1062 | `("CPLUS_INCLUDE_PATH" ":" prefix
|
| 1063 | (,(string-append gcc-toolchain "/include/c++")
|
| 1064 | ,(string-append gcc-toolchain "/include")))
|
| 1065 | `("LIBRARY_PATH" ":" prefix
|
| 1066 | (,(string-append gcc-toolchain "/lib")
|
| 1067 | ,(string-append gcc-toolchain "/lib64")))
|
| 1068 | `("PATH" ":" prefix
|
| 1069 | (,(string-append gcc-toolchain "/bin")
|
| 1070 | ,(string-append core-min "/bin"))))))))))
|
| 1071 | (inputs
|
| 1072 | (list bash-minimal
|
| 1073 | coreutils-minimal
|
| 1074 | curl
|
| 1075 | gcc
|
| 1076 | git-minimal
|
| 1077 | |
| 1078 | |
| 1079 | (module-ref (resolve-interface '(gnu packages commencement))
|
| 1080 | 'gcc-toolchain)))
|
| 1081 | (propagated-inputs (list janet))
|
| 1082 | (native-search-paths (list $SSL_CERT_DIR $SSL_CERT_FILE))
|
| 1083 | (home-page "https://janet-lang.org/")
|
| 1084 | (synopsis "Janet Project Manager for the Janet programming language")
|
| 1085 | (description
|
| 1086 | "@code{jpm} is the Janet Project Manager tool. It is a build
|
| 1087 | tool and its main uses are installing dependencies, compiling C/C++ to native
|
| 1088 | libraries, and other management tasks for Janet projects.")
|
| 1089 | (license license:expat)))
|
| 1090 |
|
| 1091 | (define-public janet-spork
|
| 1092 | (package
|
| 1093 | (name "janet-spork")
|
| 1094 | (version "1.2.0")
|
| 1095 | (source
|
| 1096 | (origin
|
| 1097 | (method git-fetch)
|
| 1098 | (uri (git-reference
|
| 1099 | (url "https://github.com/janet-lang/spork")
|
| 1100 | (commit (string-append "v" version))))
|
| 1101 | (modules '((guix build utils)))
|
| 1102 | (snippet #~(for-each
|
| 1103 | delete-file-recursively
|
| 1104 | '("deps/miniz" "deps/stb")))
|
| 1105 | (file-name (git-file-name name version))
|
| 1106 | (sha256
|
| 1107 | (base32 "0c9f54wl8g7zazrqk5f6nhp9lp38pymkxmcipagrip915i8ks0v8"))))
|
| 1108 | (build-system gnu-build-system)
|
| 1109 | (arguments
|
| 1110 | (list
|
| 1111 | #:phases
|
| 1112 | #~(modify-phases %standard-phases
|
| 1113 | (delete 'configure)
|
| 1114 | (delete 'check)
|
| 1115 | (add-after 'unpack 'fixes
|
| 1116 | (lambda* (#:key inputs #:allow-other-keys)
|
| 1117 | (substitute* '("test/suite-cjanet.janet")
|
| 1118 | (("\\(end-jit\\)" all)
|
| 1119 | (simple-format #f "(setdyn :cc ~s)\n~a"
|
| 1120 | #$(cc-for-target) all)))
|
| 1121 | (substitute* '("src/zip.c")
|
| 1122 | (("\"\\.\\./deps/miniz/miniz\\.h\"") "<miniz/miniz.h>"))
|
| 1123 | (let ((stb (dirname (search-input-file inputs "stb_image.h"))))
|
| 1124 | (substitute* '("project.janet")
|
| 1125 | (("\"deps/miniz/miniz\\.c\"") "")
|
| 1126 | ((":headers @\\[\"deps/miniz/miniz\\.h\"\\]")
|
| 1127 | ":ldflags @[\"-lminiz\"]")
|
| 1128 | (("\"-Ideps/stb\"") (string-append "\"-I" stb "\""))))))
|
| 1129 | (replace 'build
|
| 1130 | (lambda _
|
| 1131 | (invoke "janet" "-l" "./bundle" "-e" "(build)")))
|
| 1132 | (replace 'install
|
| 1133 | (lambda _
|
| 1134 | (let* ((janet-path (string-append #$output "/lib/janet")))
|
| 1135 | (mkdir-p janet-path)
|
| 1136 | (setenv "JANET_PATH" janet-path))
|
| 1137 | (invoke "janet" "--install" ".")))
|
| 1138 | (add-after 'install 'fix-output
|
| 1139 | (lambda _
|
| 1140 | (let* ((inc (string-append #$output "/include/janet/spork"))
|
| 1141 | (bin (string-append #$output "/lib/janet/bin"))
|
| 1142 | (man (string-append #$output "/lib/janet/man")))
|
| 1143 | (mkdir-p inc)
|
| 1144 | (rename-file
|
| 1145 | (string-append #$output "/lib/janet/tarray.h")
|
| 1146 | (string-append inc "/tarray.h"))
|
| 1147 | (rename-file bin (string-append #$output "/bin"))
|
| 1148 | (mkdir-p (string-append #$output "/share"))
|
| 1149 | (rename-file man (string-append #$output "/share/man")))))
|
| 1150 | (add-after 'fix-output 'check
|
| 1151 | (lambda* (#:key tests? #:allow-other-keys)
|
| 1152 | (when tests?
|
| 1153 | (invoke "janet" "-l" "./bundle" "-e" "(check)")))))))
|
| 1154 | (inputs (list janet miniz stb))
|
| 1155 | (home-page "https://github.com/janet-lang/spork")
|
| 1156 | (synopsis "Extended standard library for Janet")
|
| 1157 | (description
|
| 1158 | "Spork is a utility library for Janet. It contains small modules
|
| 1159 | that should be useful for general programming in Janet but are not included
|
| 1160 | in the standard library.")
|
| 1161 | (license license:expat)))
|
| 1162 |
|
| 1163 | (define-public lisp-repl-core-dumper
|
| 1164 | (package
|
| 1165 | (name "lisp-repl-core-dumper")
|
| 1166 | (version "0.8.0")
|
| 1167 | (source
|
| 1168 | (origin
|
| 1169 | (method git-fetch)
|
| 1170 | (uri (git-reference
|
| 1171 | (url "https://gitlab.com/ambrevar/lisp-repl-core-dumper.git")
|
| 1172 | (commit version)))
|
| 1173 | (file-name (git-file-name name version))
|
| 1174 | (sha256
|
| 1175 | (base32 "04c12gi5izpkv8ha98z9qdkbmyrsq6ga060adrx53da8z31gnhk1"))))
|
| 1176 | (build-system copy-build-system)
|
| 1177 | (arguments
|
| 1178 | '(#:install-plan
|
| 1179 | '(("lisp-repl-core-dumper" "bin/"))
|
| 1180 | #:phases
|
| 1181 | (modify-phases %standard-phases
|
| 1182 | (add-before 'install 'fix-utils-path
|
| 1183 | (lambda* (#:key inputs #:allow-other-keys)
|
| 1184 | (let* ((cat (search-input-file inputs "/bin/cat"))
|
| 1185 | (paste (search-input-file inputs "/bin/paste"))
|
| 1186 | (sort (search-input-file inputs "/bin/sort"))
|
| 1187 | (basename (search-input-file inputs "/bin/basename"))
|
| 1188 | (sed (search-input-file inputs "/bin/sed")))
|
| 1189 | (substitute* "lisp-repl-core-dumper"
|
| 1190 | (("\\$\\(basename") (string-append "$(" basename))
|
| 1191 | (("\\<cat\\>") cat)
|
| 1192 | (("\\<paste\\>") paste)
|
| 1193 | (("\\<sed\\>") sed)
|
| 1194 | (("\\<sort\\>") sort))))))))
|
| 1195 | (inputs
|
| 1196 | `(("coreutils" ,coreutils-minimal)
|
| 1197 | ("sed" ,sed)))
|
| 1198 | (home-page "https://gitlab.com/ambrevar/lisp-repl-core-dumper")
|
| 1199 | (synopsis "Generate REPL-optimized Lisp cores on demand")
|
| 1200 | (description
|
| 1201 | "This tool generates Lisp images that can embed the provided systems
|
| 1202 | and make for REPLs that start blazing fast.
|
| 1203 |
|
| 1204 | @itemize
|
| 1205 | @item It’s portable and should work with any compiler.
|
| 1206 | @item It works for any REPL.
|
| 1207 | @item It allows you to include arbitrary libraries.
|
| 1208 | @end itemize\n")
|
| 1209 | (license license:gpl3+)))
|
| 1210 |
|
| 1211 | (define-public picolisp
|
| 1212 | (package
|
| 1213 | (name "picolisp")
|
| 1214 | (version "25.6")
|
| 1215 | (supported-systems '("aarch64-linux"
|
| 1216 | "powerpc64le-linux"
|
| 1217 | "x86_64-linux"))
|
| 1218 | (source
|
| 1219 | (origin
|
| 1220 | (method url-fetch)
|
| 1221 | (uri (string-append "https://software-lab.de/picoLisp-" version ".tgz"))
|
| 1222 | (sha256
|
| 1223 | (base32 "0cr1w4lcszipfp7d0pk7v42dzqrd6i7b498f81lqymijgp3v4vkd"))))
|
| 1224 | (build-system gnu-build-system)
|
| 1225 | (inputs (list clang-13 readline libffi openssl pkg-config))
|
| 1226 | (arguments
|
| 1227 | '(#:phases (modify-phases %standard-phases
|
| 1228 | (delete 'configure)
|
| 1229 | (add-after 'unpack 'fix-paths
|
| 1230 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1231 | (let* ((out (assoc-ref outputs "out"))
|
| 1232 | (picolisp-shebang (string-append "#!" out
|
| 1233 | "/bin/picolisp " out
|
| 1234 | "/lib/picolisp/lib.l"))
|
| 1235 | (pil-shebang (string-append "#!" out "/bin/pil")))
|
| 1236 | (substitute* '("bin/pil" "bin/psh" "bin/pty" "bin/vip"
|
| 1237 | "bin/watchdog")
|
| 1238 | (("#\\!bin/picolisp lib.l")
|
| 1239 | picolisp-shebang)
|
| 1240 | (("#\\!\\.\\./bin/picolisp \\.\\./lib.l")
|
| 1241 | picolisp-shebang)
|
| 1242 | (("#\\!/usr/bin/picolisp /usr/lib/picolisp/lib.l")
|
| 1243 | picolisp-shebang)
|
| 1244 | (("#\\!/usr/bin/pil")
|
| 1245 | pil-shebang)))))
|
| 1246 | (replace 'build
|
| 1247 | (lambda _
|
| 1248 | (invoke "make" "-C" "src")))
|
| 1249 | (add-before 'check 'set-home-for-tests
|
| 1250 | (lambda _
|
| 1251 | (setenv "HOME" "/tmp")))
|
| 1252 | (replace 'check
|
| 1253 | (lambda _
|
| 1254 | (invoke "./pil" "test/lib.l" "-bye" "+")))
|
| 1255 | (replace 'install
|
| 1256 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1257 | (let* ((out (assoc-ref outputs "out"))
|
| 1258 | (bin (string-append out "/bin"))
|
| 1259 | (doc (string-append out "/share/doc"))
|
| 1260 | (man (string-append out "/share/man"))
|
| 1261 | (picolisp (string-append out "/lib/picolisp")))
|
| 1262 | (copy-recursively "man" man)
|
| 1263 | (copy-recursively "doc" doc)
|
| 1264 | (copy-recursively "." picolisp)
|
| 1265 | (for-each (lambda (name)
|
| 1266 | (let ((path (string-append picolisp "/"
|
| 1267 | name)))
|
| 1268 | (delete-file-recursively path)))
|
| 1269 | '("doc" "COPYING"
|
| 1270 | "INSTALL"
|
| 1271 | "man"
|
| 1272 | "pil"
|
| 1273 | "README"
|
| 1274 | "src"
|
| 1275 | "test"))
|
| 1276 | (mkdir-p bin)
|
| 1277 | (for-each (lambda (name)
|
| 1278 | (symlink name
|
| 1279 | (string-append bin "/"
|
| 1280 | (basename name))))
|
| 1281 | (find-files (string-append picolisp "/bin")))))))))
|
| 1282 | (synopsis "Interpreter for the PicoLisp programming language")
|
| 1283 | (description
|
| 1284 | "PicoLisp is a programming language, or really a programming system,
|
| 1285 | including a built-in database engine and a GUI system.")
|
| 1286 | (home-page "https://picolisp.com/wiki/?home")
|
| 1287 | (license license:expat)))
|
| 1288 |
|
| 1289 | (define-public roswell
|
| 1290 | (package
|
| 1291 | (name "roswell")
|
| 1292 | (version "24.10.115")
|
| 1293 | (home-page "https://github.com/roswell/roswell")
|
| 1294 | (source
|
| 1295 | (origin
|
| 1296 | (method git-fetch)
|
| 1297 | (uri (git-reference
|
| 1298 | (url "https://github.com/roswell/roswell")
|
| 1299 | (commit (string-append "v" version))))
|
| 1300 | (file-name (git-file-name name version))
|
| 1301 | (sha256
|
| 1302 | (base32 "1az9295cp2swyms0bkrb7l00x5s04b9zk8b4yf67cgfi1ka019nr"))))
|
| 1303 | (build-system gnu-build-system)
|
| 1304 | (arguments
|
| 1305 | (list #:configure-flags #~(list (string-append "--prefix=" #$output))
|
| 1306 | #:tests? #f))
|
| 1307 | (native-inputs
|
| 1308 | (list autoconf automake intltool))
|
| 1309 | (inputs
|
| 1310 | (list curl))
|
| 1311 | (propagated-inputs
|
| 1312 | |
| 1313 | (list gnu-make patchelf))
|
| 1314 | (synopsis "Common Lisp implementation manager, launcher, and more")
|
| 1315 | (description
|
| 1316 | "Roswell started out as a command-line tool with the aim to make
|
| 1317 | installing and managing Common Lisp implementations really simple and easy.
|
| 1318 | Roswell has now evolved into a full-stack environment for Common Lisp
|
| 1319 | development, and has many features that makes it easy to test, share, and
|
| 1320 | distribute your Lisp applications.
|
| 1321 |
|
| 1322 | Roswell is still in beta. Despite this, the basic interfaces are stable and
|
| 1323 | not likely to change.")
|
| 1324 | (license license:expat)))
|
| 1325 |
|
| 1326 | (define-public s7-bootstrap
|
| 1327 | |
| 1328 | (let ((commit "23a64facfac06c4bc23a7de8f04691c55f88bd40") |
| 1329 | (revision "0"))
|
| 1330 | (hidden-package
|
| 1331 | (package
|
| 1332 | (name "s7-bootstrap")
|
| 1333 | (version (git-version "24.1" revision commit))
|
| 1334 | (source (origin
|
| 1335 | (method git-fetch)
|
| 1336 | (uri (git-reference
|
| 1337 | (url "https://cm-gitlab.stanford.edu/bil/s7.git")
|
| 1338 | (commit commit)))
|
| 1339 | (file-name (git-file-name name version))
|
| 1340 | (sha256
|
| 1341 | (base32
|
| 1342 | "0fiw8lb7rswglixvn271la2q2hgwszrf2ckykhr6jjxdvmb9a7d0"))
|
| 1343 | (patches (search-patches "s7-flint-3.patch"))))
|
| 1344 | (build-system gnu-build-system)
|
| 1345 | (arguments
|
| 1346 | (list #:tests? #f |
| 1347 | #:phases #~(modify-phases %standard-phases
|
| 1348 | (delete 'configure) |
| 1349 | (replace 'build
|
| 1350 | (lambda _
|
| 1351 | |
| 1352 | (display "[BUILD] repl\n")
|
| 1353 | (invoke #$(cc-for-target) "s7.c" "-o" "repl"
|
| 1354 | "-I." "-O2" "-g"
|
| 1355 | "-DWITH_MAIN"
|
| 1356 | (string-append
|
| 1357 | "-DS7_LOAD_PATH=\""
|
| 1358 | #$output "/share/s7/scm\"")
|
| 1359 | "-ldl" "-lm"
|
| 1360 | "-Wl,-export-dynamic")
|
| 1361 | (display "[BUILD] nrepl\n")
|
| 1362 | (invoke #$(cc-for-target) "s7.c" "-o" "nrepl"
|
| 1363 | "-I." "-O2" "-g"
|
| 1364 | "-DWITH_MAIN" "-DWITH_NOTCURSES"
|
| 1365 | (string-append
|
| 1366 | "-DS7_LOAD_PATH=\""
|
| 1367 | #$output "/share/s7/scm\"")
|
| 1368 | "-ldl" "-lm" "-lnotcurses-core"
|
| 1369 | "-Wl,-export-dynamic")
|
| 1370 | (display "[BUILD] libarb_s7.so\n")
|
| 1371 | (invoke #$(cc-for-target) "libarb_s7.c"
|
| 1372 | "-I." "-O2" "-g"
|
| 1373 | "-shared" "-o" "libarb_s7.so"
|
| 1374 | "-lflint" "-lmpc" "-fPIC")
|
| 1375 | (display "[BUILD] libnotcurses_s7.so\n")
|
| 1376 | (invoke #$(cc-for-target) "notcurses_s7.c"
|
| 1377 | "-I." "-O2" "-g"
|
| 1378 | "-shared" "-o" "libnotcurses_s7.so"
|
| 1379 | "-lnotcurses-core" "-fPIC"
|
| 1380 | "-Wno-error=implicit-function-declaration")
|
| 1381 | |
| 1382 | (display "[BUILD] s7.o\n")
|
| 1383 | (invoke #$(cc-for-target) "-c" "s7.c" "-o"
|
| 1384 | "s7.o" "-I." "-O2" "-ldl" "-lm")
|
| 1385 | (display "[BUILD] ffitest\n")
|
| 1386 | (invoke #$(cc-for-target) "-o" "ffitest"
|
| 1387 | "ffitest.c" "-g2" "s7.o" "-lm" "-I."
|
| 1388 | "-ldl" "-Wl,-export-dynamic")))
|
| 1389 | (add-before 'check 'install-scm
|
| 1390 | |
| 1391 | (lambda _
|
| 1392 | (for-each (lambda (x)
|
| 1393 | (install-file
|
| 1394 | x (string-append
|
| 1395 | #$output "/share/s7/scm/")))
|
| 1396 | (find-files "." "\\.scm"))))
|
| 1397 | (replace 'install
|
| 1398 | (lambda _
|
| 1399 | (let ((bin (string-append #$output "/bin"))
|
| 1400 | (share (string-append #$output
|
| 1401 | "/share/s7/"))
|
| 1402 | (doc (string-append #$output
|
| 1403 | "/share/doc/s7/"))
|
| 1404 | (lib (string-append #$output "/lib"))
|
| 1405 | (inc (string-append #$output "/include/")))
|
| 1406 | (install-file "repl" bin)
|
| 1407 | (install-file "nrepl" bin)
|
| 1408 | (install-file "ffitest" bin)
|
| 1409 | (install-file "libarb_s7.so" lib)
|
| 1410 | (install-file "libnotcurses_s7.so" lib)
|
| 1411 | (install-file "s7.c" share)
|
| 1412 | (install-file "s7.h" inc)
|
| 1413 | (install-file "s7.html" doc)))))))
|
| 1414 | (inputs (list flint mpc notcurses))
|
| 1415 | (home-page "https://ccrma.stanford.edu/software/snd/snd/s7.html")
|
| 1416 | (synopsis "Scheme interpreter intended as an extension language")
|
| 1417 | (description
|
| 1418 | "s7 is a Scheme interpreter intended as an extension language for
|
| 1419 | other applications. It exists as just two files, @code{s7.c} and @code{s7.h},
|
| 1420 | that may be copied into the source tree of another application. There are no
|
| 1421 | libraries, no run-time init files, and no configuration scripts. It can also
|
| 1422 | be built as a stand-alone REPL interpreter.")
|
| 1423 | (license license:bsd-0)))))
|
| 1424 |
|
| 1425 | (define-public s7
|
| 1426 | (package
|
| 1427 | (inherit s7-bootstrap)
|
| 1428 | (name "s7")
|
| 1429 | (arguments
|
| 1430 | (substitute-keyword-arguments
|
| 1431 | (strip-keyword-arguments
|
| 1432 | '(#:tests?)
|
| 1433 | (package-arguments s7-bootstrap))
|
| 1434 | ((#:phases phases)
|
| 1435 | #~(modify-phases #$phases
|
| 1436 | (add-after 'unpack 'patch
|
| 1437 | (lambda _
|
| 1438 | (substitute* "s7.c"
|
| 1439 | (("libc_s7.so")
|
| 1440 | (string-append #$output "/lib/libc_s7.so")))))
|
| 1441 | (add-after 'build 'build-full
|
| 1442 | (lambda _
|
| 1443 | (invoke "repl" "./libc.scm")))
|
| 1444 | (replace 'check
|
| 1445 | (lambda* (#:key tests? #:allow-other-keys)
|
| 1446 | (when tests?
|
| 1447 | (invoke "repl" "./s7test.scm"))))
|
| 1448 | (add-after 'install 'install-full
|
| 1449 | (lambda _
|
| 1450 | (install-file "libc_s7.so"
|
| 1451 | (string-append #$output "/lib/"))
|
| 1452 | (delete-file (string-append #$output "/bin/ffitest"))))))))
|
| 1453 | (native-inputs (list s7-bootstrap))
|
| 1454 | (properties (alist-delete 'hidden? (package-properties s7-bootstrap)))))
|
| 1455 |
|
| 1456 | (define-public sbcl
|
| 1457 | (package
|
| 1458 | (name "sbcl")
|
| 1459 | (version "2.6.4")
|
| 1460 | (source
|
| 1461 | (origin
|
| 1462 | (method url-fetch)
|
| 1463 | (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
|
| 1464 | version "-source.tar.bz2"))
|
| 1465 | (sha256
|
| 1466 | (base32 "0yym01a6a2vp9cns46vi3ikg4q2jdnfijrh4yp2bgzk09djkx99v"))
|
| 1467 | (modules '((guix build utils)))
|
| 1468 | (snippet
|
| 1469 | '(begin
|
| 1470 | |
| 1471 | (substitute* "src/runtime/Config.arm-linux"
|
| 1472 | (("-march=armv5t") ""))))))
|
| 1473 | (build-system gnu-build-system)
|
| 1474 | (outputs '("out" "doc"))
|
| 1475 | (native-inputs
|
| 1476 | |
| 1477 | |
| 1478 | |
| 1479 | |
| 1480 | |
| 1481 | |
| 1482 | |
| 1483 | |
| 1484 | |
| 1485 | |
| 1486 | |
| 1487 | |
| 1488 | |
| 1489 | |
| 1490 | |
| 1491 | |
| 1492 | |
| 1493 | |
| 1494 | |
| 1495 | |
| 1496 | |
| 1497 | (list (match (%current-system)
|
| 1498 | ("powerpc-linux" |
| 1499 | ecl)
|
| 1500 | (_
|
| 1501 | clisp))
|
| 1502 | cl-asdf
|
| 1503 | ed
|
| 1504 | inetutils |
| 1505 | texinfo
|
| 1506 | (texlive-local-tree (list texlive-texinfo))
|
| 1507 | which))
|
| 1508 | (inputs
|
| 1509 | (list bash-minimal
|
| 1510 | gmp |
| 1511 | mpfr |
| 1512 | (list zstd "lib")))
|
| 1513 | (arguments
|
| 1514 | `(#:modules ((guix build gnu-build-system)
|
| 1515 | (guix build utils)
|
| 1516 | (srfi srfi-1))
|
| 1517 | #:phases
|
| 1518 | (modify-phases %standard-phases
|
| 1519 | (delete 'configure)
|
| 1520 | (add-after 'unpack 'fix-build-id
|
| 1521 | |
| 1522 | |
| 1523 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1524 | (let ((hash (substring (assoc-ref outputs "out")
|
| 1525 | (+ (string-length (%store-directory)) 1)
|
| 1526 | (+ (string-length (%store-directory)) 9))))
|
| 1527 | (substitute* "make-config.sh"
|
| 1528 | (("echo .* > output/build-id.inc")
|
| 1529 | (string-append "echo '\"'guix-sbcl-"
|
| 1530 | hash
|
| 1531 | "'\"' > output/build-id.inc"))))))
|
| 1532 | (add-after 'unpack 'replace-asdf
|
| 1533 | |
| 1534 | |
| 1535 | |
| 1536 | |
| 1537 | |
| 1538 | |
| 1539 | (lambda* (#:key inputs #:allow-other-keys)
|
| 1540 | (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
|
| 1541 | (guix-asdf (string-append
|
| 1542 | cl-asdf
|
| 1543 | "/share/common-lisp/source/asdf/asdf.lisp"))
|
| 1544 | (contrib-asdf "contrib/asdf/asdf.lisp"))
|
| 1545 | (copy-file guix-asdf contrib-asdf))))
|
| 1546 | (add-before 'build 'patch-unix-tool-paths
|
| 1547 | (lambda* (#:key outputs inputs #:allow-other-keys)
|
| 1548 | (let ((out (assoc-ref outputs "out"))
|
| 1549 | (bash (assoc-ref inputs "bash"))
|
| 1550 | (coreutils (assoc-ref inputs "coreutils"))
|
| 1551 | (ed (assoc-ref inputs "ed")))
|
| 1552 | (define (quoted-path input path)
|
| 1553 | (string-append "\"" input path "\""))
|
| 1554 | |
| 1555 | |
| 1556 | |
| 1557 | (with-fluids ((%default-port-encoding #f))
|
| 1558 | |
| 1559 | |
| 1560 | (substitute* (delete
|
| 1561 | "./tests/data/compile-file-pos-utf16be.lisp"
|
| 1562 | (find-files "." "\\.(lisp|sh)$"))
|
| 1563 | (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
|
| 1564 | (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
|
| 1565 | (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
|
| 1566 | (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
|
| 1567 | (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
|
| 1568 | (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
|
| 1569 | |
| 1570 | (substitute* '("tests/foreign.test.sh")
|
| 1571 | |
| 1572 | ((" /bin/sh ") " sh "))
|
| 1573 | |
| 1574 | |
| 1575 | |
| 1576 | |
| 1577 | |
| 1578 | (substitute* '("contrib/sb-executable/sb-executable.lisp")
|
| 1579 | (("/bin/sh") (string-append bash "/bin/sh"))
|
| 1580 | (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
|
| 1581 | |
| 1582 | (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
|
| 1583 | |
| 1584 | (("\\(deftest get-protocol-by-name/error" all)
|
| 1585 | (string-append "#+nil ;disabled by Guix\n" all)))
|
| 1586 | (substitute* '("contrib/sb-posix/posix-tests.lisp")
|
| 1587 | |
| 1588 | (("\\(deftest pwent\\.[12]" all)
|
| 1589 | (string-append "#+nil ;disabled by Guix\n" all))
|
| 1590 | (("\\(deftest grent\\.[12]" all)
|
| 1591 | (string-append "#+nil ;disabled by Guix\n" all))))))
|
| 1592 | (add-before 'build 'fix-contrib-library-path
|
| 1593 | (lambda* (#:key inputs #:allow-other-keys)
|
| 1594 | (let ((gmp (assoc-ref inputs "gmp"))
|
| 1595 | (mpfr (assoc-ref inputs "mpfr")))
|
| 1596 | (substitute* '("contrib/sb-gmp/gmp.lisp")
|
| 1597 | (("\"libgmp\\.so")
|
| 1598 | (string-append "\"" gmp "/lib/libgmp.so")))
|
| 1599 | (substitute* '("contrib/sb-mpfr/mpfr.lisp")
|
| 1600 | (("\"libmpfr\\.so")
|
| 1601 | (string-append "\"" mpfr "/lib/libmpfr.so"))))))
|
| 1602 | (replace 'build
|
| 1603 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1604 | (setenv "CC" "gcc")
|
| 1605 | (invoke "sh" "make.sh" ,@(match (%current-system)
|
| 1606 | ("powerpc-linux"
|
| 1607 | `("ecl"))
|
| 1608 | (_
|
| 1609 | `("clisp")))
|
| 1610 | (string-append "--prefix="
|
| 1611 | (assoc-ref outputs "out"))
|
| 1612 | ,@(if (or (target-ppc32?)
|
| 1613 | (target-x86-32?))
|
| 1614 | |
| 1615 | `("--dynamic-space-size=2048")
|
| 1616 | `("--dynamic-space-size=3072"))
|
| 1617 | "--with-sb-core-compression"
|
| 1618 | "--with-sb-xref-for-internals"
|
| 1619 | |
| 1620 | |
| 1621 | |
| 1622 | "--without-sb-simd")))
|
| 1623 | (add-after 'build 'build-shared-library
|
| 1624 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1625 | (setenv "CC" "gcc")
|
| 1626 | (invoke "sh" "make-shared-library.sh")))
|
| 1627 | (replace 'install
|
| 1628 | (lambda _
|
| 1629 | (invoke "sh" "install.sh")))
|
| 1630 | (add-after 'build 'build-doc
|
| 1631 | (lambda _
|
| 1632 | (with-directory-excursion "doc/manual"
|
| 1633 | (and (invoke "make" "info")
|
| 1634 | (invoke "make" "dist")))))
|
| 1635 | (add-after 'build 'build-source
|
| 1636 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1637 | (let* ((out (assoc-ref outputs "out"))
|
| 1638 | (rc (string-append out "/lib/sbcl/sbclrc"))
|
| 1639 | (source-dir (string-append out "/share/sbcl")))
|
| 1640 | (for-each (lambda (p)
|
| 1641 | (copy-recursively p (string-append source-dir "/" p)))
|
| 1642 | '("src" "contrib"))
|
| 1643 | (mkdir-p (dirname rc))
|
| 1644 | (with-output-to-file rc
|
| 1645 | (lambda ()
|
| 1646 | (display
|
| 1647 | (string-append "(sb-ext:set-sbcl-source-location \""
|
| 1648 | source-dir "\")") ))))))
|
| 1649 | (add-after 'install 'remove-coreutils-references
|
| 1650 | |
| 1651 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1652 | (let* ((out (assoc-ref outputs "out"))
|
| 1653 | (share-dir (string-append out "/share/sbcl/")))
|
| 1654 | (substitute* (string-append share-dir "src/code/run-program.lisp")
|
| 1655 | (("\\(run-program \".*uname\"")
|
| 1656 | "(run-program \"uname\""))
|
| 1657 | (substitute* (string-append share-dir "contrib/asdf/asdf.lisp")
|
| 1658 | (("\\(\".*/usr/bin/env\"")
|
| 1659 | "(\"/usr/bin/env\""))
|
| 1660 | (substitute* (string-append share-dir "contrib/asdf/uiop.lisp")
|
| 1661 | (("\\(\".*/usr/bin/env\"")
|
| 1662 | "(\"/usr/bin/env\"")))))
|
| 1663 | (add-after 'install 'install-shared-library
|
| 1664 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1665 | (let* ((out (assoc-ref outputs "out"))
|
| 1666 | (lib-dir (string-append out "/lib")))
|
| 1667 | (install-file "src/runtime/libsbcl.so" lib-dir))))
|
| 1668 | (add-after 'install 'install-doc
|
| 1669 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1670 | (let* ((out (assoc-ref outputs "out"))
|
| 1671 | (doc (assoc-ref outputs "doc"))
|
| 1672 | (old-doc-dir (string-append out "/share/doc"))
|
| 1673 | (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
|
| 1674 | (rmdir (string-append old-doc-dir "/sbcl/html"))
|
| 1675 | (mkdir-p new-doc/sbcl-dir)
|
| 1676 | (copy-recursively (string-append old-doc-dir "/sbcl")
|
| 1677 | new-doc/sbcl-dir)
|
| 1678 | (delete-file-recursively old-doc-dir)))))
|
| 1679 | |
| 1680 | #:tests? #f))
|
| 1681 | (native-search-paths
|
| 1682 | (list (search-path-specification
|
| 1683 | (variable "XDG_DATA_DIRS")
|
| 1684 | (files '("share")))
|
| 1685 | (search-path-specification
|
| 1686 | (variable "XDG_CONFIG_DIRS")
|
| 1687 | (files '("etc/xdg")))))
|
| 1688 | (home-page "https://www.sbcl.org/")
|
| 1689 | (supported-systems (remove target-hurd? %supported-systems))
|
| 1690 | (synopsis "Common Lisp implementation")
|
| 1691 | (description "Steel Bank Common Lisp (SBCL) is a high performance Common
|
| 1692 | Lisp compiler. In addition to the compiler and runtime system for ANSI Common
|
| 1693 | Lisp, it provides an interactive environment including a debugger, a
|
| 1694 | statistical profiler, a code coverage tool, and many other extensions.")
|
| 1695 | |
| 1696 | |
| 1697 | (license (list license:public-domain license:bsd-2
|
| 1698 | (license:x11-style "file://src/code/loop.lisp")))))
|
| 1699 |
|
| 1700 | (define man-for-txr
|
| 1701 | (let ((commit "dfbf19b9a96474b8c1bacac85e43605e5691ceb2")
|
| 1702 | |
| 1703 | |
| 1704 | (revision "41"))
|
| 1705 | (package
|
| 1706 | (name "man-for-txr")
|
| 1707 | (version (git-version "1.6g" revision commit))
|
| 1708 | (source
|
| 1709 | (origin
|
| 1710 | (method git-fetch)
|
| 1711 | (uri (git-reference
|
| 1712 | (url "http://www.kylheku.com/git/man/")
|
| 1713 | (commit commit)))
|
| 1714 | (file-name (git-file-name name version))
|
| 1715 | (sha256
|
| 1716 | (base32 "1zy0g8fj9nsfwzvg88hyaiy94r8j14xhs8vy2ln2niqdm6x2lvy2"))))
|
| 1717 | (build-system gnu-build-system)
|
| 1718 | (arguments
|
| 1719 | `(#:tests? #f |
| 1720 | #:phases
|
| 1721 | (modify-phases %standard-phases
|
| 1722 | (add-after 'unpack 'fix-man2html-makefile
|
| 1723 | (lambda _
|
| 1724 | (substitute* "man2html/Makefile.in"
|
| 1725 | |
| 1726 | (("^(bindir = \\$\\(DESTDIR\\)\\$\\(PREFIX\\)).*" _ prefix)
|
| 1727 | (string-append prefix "@bindir@\n")))
|
| 1728 | #t))
|
| 1729 | (add-after 'unpack 'delete-generated-files
|
| 1730 | (lambda _
|
| 1731 | (for-each delete-file
|
| 1732 | (append
|
| 1733 | (list "conf_script")
|
| 1734 | (map (lambda (d) (string-append d "/Makefile"))
|
| 1735 | '("." "man" "man2html" "src"))
|
| 1736 | (map (lambda (f) (string-append "src/" f))
|
| 1737 | '("makewhatis.in" "man.conf"
|
| 1738 | "paths.h" "version.h"))))
|
| 1739 | #t))
|
| 1740 | (replace 'configure
|
| 1741 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1742 | (setenv "CC" ,(cc-for-target))
|
| 1743 | |
| 1744 | (invoke "./configure" "+lang" "en" "+fhs"
|
| 1745 | (string-append "-prefix=" (assoc-ref outputs "out")))
|
| 1746 | #t)))))
|
| 1747 | (home-page "https://www.kylheku.com/cgit/man/")
|
| 1748 | (synopsis "Modifications to the man utilities, specifically man2html")
|
| 1749 | (description
|
| 1750 | "This is a fork of the man utilities intended specifically for building
|
| 1751 | the HTML documentation of TXR.")
|
| 1752 | (license license:gpl2))))
|
| 1753 |
|
| 1754 | (define-public txr
|
| 1755 | (package
|
| 1756 | (name "txr")
|
| 1757 | (version "302")
|
| 1758 | (source
|
| 1759 | (origin
|
| 1760 | (method git-fetch)
|
| 1761 | (uri (git-reference
|
| 1762 | (url "https://www.kylheku.com/git/txr/")
|
| 1763 | (commit (string-append "txr-" version))))
|
| 1764 | (file-name (git-file-name name version))
|
| 1765 | (sha256
|
| 1766 | (base32 "01h09lbpgyzv64m8ycpr2vavdpdxhxdgvmc3p0jqrkvnrzhkdlhj"))))
|
| 1767 | (build-system gnu-build-system)
|
| 1768 | (arguments
|
| 1769 | (list #:configure-flags
|
| 1770 | #~(list (string-append "cc=" #$(cc-for-target))
|
| 1771 | (string-append "--prefix=" #$output))
|
| 1772 | #:test-target "tests"
|
| 1773 | #:phases
|
| 1774 | #~(modify-phases %standard-phases
|
| 1775 | (add-after 'unpack 'fix-license-installation
|
| 1776 | (lambda _
|
| 1777 | (substitute* "Makefile"
|
| 1778 | (("INSTALL(,.*LICENSE,.*)\\$\\(datadir\\)" _ match)
|
| 1779 | (string-append "INSTALL" match #$output
|
| 1780 | "/share/doc/" #$name "-" #$version)))))
|
| 1781 | (delete 'install-license-files)
|
| 1782 | (add-after 'unpack 'fix-paths
|
| 1783 | (lambda* (#:key inputs #:allow-other-keys)
|
| 1784 | (substitute* "stream.c"
|
| 1785 | (("/bin/sh")
|
| 1786 | (search-input-file inputs "/bin/bash")))))
|
| 1787 | (add-after 'unpack 'fix-tests
|
| 1788 | (lambda _
|
| 1789 | (substitute* (list "tests/017/realpath.tl"
|
| 1790 | "tests/017/realpath.expected")
|
| 1791 | (("/usr/bin") "/"))))
|
| 1792 | (add-after 'unpack 'fix-doc-build
|
| 1793 | (lambda _
|
| 1794 | (substitute* "Makefile"
|
| 1795 | (("pdfroff -ww -man --no-toc")
|
| 1796 | "groff -Tpdf -ww -man"))))
|
| 1797 | (replace 'configure
|
| 1798 | |
| 1799 | |
| 1800 | (lambda* (#:key configure-flags #:allow-other-keys)
|
| 1801 | (setenv "txr_shell" (which "bash"))
|
| 1802 | (apply invoke "./configure" configure-flags)))
|
| 1803 | (add-after 'build 'build-doc
|
| 1804 | (lambda _
|
| 1805 | (setenv "GS_GENERATE_UUIDS" "0")
|
| 1806 | (invoke "make" "txr-manpage.html" "txr-manpage.pdf")))
|
| 1807 | (add-after 'install 'install-doc
|
| 1808 | (lambda _
|
| 1809 | (let ((doc (string-append #$output "/share/doc/"
|
| 1810 | #$name "-" #$version)))
|
| 1811 | (for-each (lambda (f) (install-file f doc))
|
| 1812 | '("txr-manpage.html" "txr-manpage.pdf")))))
|
| 1813 | (add-after 'install 'install-vim-files
|
| 1814 | (lambda _
|
| 1815 | (let ((syntax (string-append
|
| 1816 | #$output
|
| 1817 | "/share/vim/vimfiles/pack/guix/start/txr/syntax")))
|
| 1818 | (install-file "tl.vim" syntax)
|
| 1819 | (install-file "txr.vim" syntax)))))))
|
| 1820 | (native-inputs
|
| 1821 | |
| 1822 | (list ghostscript
|
| 1823 | groff
|
| 1824 | man-for-txr))
|
| 1825 | (inputs
|
| 1826 | (list bash-minimal
|
| 1827 | libffi
|
| 1828 | libxcrypt
|
| 1829 | zlib))
|
| 1830 | (synopsis "General-purpose, multi-paradigm programming language")
|
| 1831 | (description
|
| 1832 | "TXR is a general-purpose, multi-paradigm programming language. It
|
| 1833 | comprises two languages integrated into a single tool: a text scanning and
|
| 1834 | extraction language referred to as the TXR Pattern Language (sometimes just
|
| 1835 | \"TXR\"), and a general-purpose dialect of Lisp called TXR Lisp. TXR can be
|
| 1836 | used for everything from \"one liner\" data transformation tasks at the
|
| 1837 | command line, to data scanning and extracting scripts, to full application
|
| 1838 | development in a wide-range of areas.")
|
| 1839 | (home-page "https://www.nongnu.org/txr/")
|
| 1840 | (license license:bsd-2)))
|