| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | (define-module (gnu packages forth)
|
| 22 | #:use-module (guix build-system gnu)
|
| 23 | #:use-module (guix build-system trivial)
|
| 24 | #:use-module (guix download)
|
| 25 | #:use-module (guix git-download)
|
| 26 | #:use-module (guix gexp)
|
| 27 | #:use-module ((guix licenses) #:prefix license:)
|
| 28 | #:use-module (guix packages)
|
| 29 | #:use-module (gnu packages assembly)
|
| 30 | #:use-module (gnu packages m4)
|
| 31 | #:use-module (gnu packages vim))
|
| 32 |
|
| 33 | (define-public gforth
|
| 34 | (package
|
| 35 | (name "gforth")
|
| 36 | (version "0.7.3")
|
| 37 | (source (origin
|
| 38 | (method url-fetch)
|
| 39 | (uri (string-append "mirror://gnu/gforth/gforth-"
|
| 40 | version ".tar.gz"))
|
| 41 | (sha256
|
| 42 | (base32
|
| 43 | "1c1bahc9ypmca8rv2dijiqbangm1d9av286904yw48ph7ciz4qig"))))
|
| 44 | (build-system gnu-build-system)
|
| 45 | (arguments
|
| 46 | '(#:parallel-build? #f |
| 47 | #:phases
|
| 48 | (modify-phases %standard-phases
|
| 49 | (add-after 'install 'install-gforth.el
|
| 50 | (lambda* (#:key outputs #:allow-other-keys)
|
| 51 | (let* ((out (assoc-ref outputs "out"))
|
| 52 | (emacs-sitedir (string-append
|
| 53 | out "/share/emacs/site-lisp")))
|
| 54 | |
| 55 | (install-file "gforth.el" emacs-sitedir)
|
| 56 | #t))))))
|
| 57 | (native-inputs
|
| 58 | (list m4))
|
| 59 | (synopsis "Forth interpreter")
|
| 60 | (description
|
| 61 | "Gforth is a fast and portable implementation of the ANSI Forth language.
|
| 62 | It includes an editing mode for Emacs and an interpreter featuring completion
|
| 63 | and history. A generic virtual machine environment, vmgen, is also
|
| 64 | included.")
|
| 65 | (home-page "https://www.gnu.org/software/gforth/")
|
| 66 | (license license:gpl3+)))
|
| 67 |
|
| 68 | (define-public freeforth2
|
| 69 | (package
|
| 70 | (name "freeforth2")
|
| 71 | (version "1.0.0")
|
| 72 | (source (origin
|
| 73 | (method git-fetch)
|
| 74 | (uri (git-reference
|
| 75 | (url "https://github.com/dan4thewin/FreeForth2")
|
| 76 | (commit (string-append "v" version))))
|
| 77 | (file-name (git-file-name name version))
|
| 78 | (sha256
|
| 79 | (base32
|
| 80 | "0nnbvqvv0q7mcy2paxknl97zk6vphflvqp3dy741p0kaghcpgli7"))))
|
| 81 | (build-system gnu-build-system)
|
| 82 | (arguments
|
| 83 | (list #:test-target "test"
|
| 84 | #:system "i686-linux" |
| 85 | #:make-flags
|
| 86 | #~(list (string-append "PREFIX=" #$output)
|
| 87 | "LD=gcc -m32 -nostartfiles -lc")
|
| 88 | #:phases
|
| 89 | #~(modify-phases %standard-phases
|
| 90 | (replace 'configure
|
| 91 | (lambda _
|
| 92 | (substitute* "fflin.boot"
|
| 93 | (("/usr/local/share/ff")
|
| 94 | (string-append #$output "/share/ff"))
|
| 95 | |
| 96 | (("46[+] create ffpath")
|
| 97 | "256+ create ffpath")))))))
|
| 98 | (native-inputs (list fasm))
|
| 99 | (synopsis "Lightweight x86 Forth")
|
| 100 | (home-page "https://github.com/dan4thewin/FreeForth2")
|
| 101 | (description
|
| 102 | "FreeForth2 offers a lightweight Forth for x86 GNU/Linux that deftly
|
| 103 | blends assembly and Forth.")
|
| 104 | (supported-systems '("i686-linux" "x86_64-linux"))
|
| 105 | (license license:asl2.0)))
|
| 106 |
|
| 107 | (define-public smithforth
|
| 108 | (package
|
| 109 | (name "smithforth")
|
| 110 | (version "220711")
|
| 111 | (source
|
| 112 | (origin
|
| 113 | (method url-fetch)
|
| 114 | (uri (string-append "https://dacvs.neocities.org/SF/SForth"
|
| 115 | version "dmp.txt"))
|
| 116 | (sha256
|
| 117 | (base32 "0a39pv7529llsa3f48fmvwvlcp3f9v8qkn5ziw2l6kxf0qvli3lm"))))
|
| 118 | (build-system trivial-build-system)
|
| 119 | (native-inputs (list xxd
|
| 120 | (origin
|
| 121 | (method url-fetch)
|
| 122 | (uri (string-append
|
| 123 | "https://dacvs.neocities.org/SF/system"
|
| 124 | version "fs.txt"))
|
| 125 | (sha256
|
| 126 | (base32
|
| 127 | "17v1pp64s6n8q8w3kg48nd7zdcx2208y4svr5fpfms5lkyzg7z1m")))))
|
| 128 | (arguments
|
| 129 | (list
|
| 130 | #:modules '((guix build utils))
|
| 131 | #:builder
|
| 132 | #~(begin
|
| 133 | (use-modules (guix build utils)
|
| 134 | (ice-9 textual-ports))
|
| 135 | (let* ((sforth.dmp #$(package-source this-package))
|
| 136 | (system.fs #$(this-package-native-input
|
| 137 | (string-append "system" version "fs.txt")))
|
| 138 | (xxd (string-append (assoc-ref %build-inputs "xxd")
|
| 139 | "/bin/xxd"))
|
| 140 | (bin (string-append (assoc-ref %outputs "out") "/bin")))
|
| 141 | (copy-file sforth.dmp "sforth.dmp")
|
| 142 | (substitute* "sforth.dmp" (("#.*$") "\n"))
|
| 143 | (with-output-to-file "sforth"
|
| 144 | (lambda _
|
| 145 | (invoke xxd "-p" "-r" "sforth.dmp")
|
| 146 | (call-with-input-file system.fs
|
| 147 | (lambda (port) (display (get-string-all port)))))
|
| 148 | #:binary #t)
|
| 149 | (chmod "sforth" #o755)
|
| 150 | (install-file "sforth" bin)))))
|
| 151 | (home-page "https://dacvs.neocities.org/SF/")
|
| 152 | (synopsis "Forth programming language for x86-64 desktop computers")
|
| 153 | (description "SmithForth is an implementation of the Forth programming
|
| 154 | language for x86-64 desktop computers. SmithForth is a text interpreter that
|
| 155 | runs in a Linux text console.")
|
| 156 | (supported-systems '("x86_64-linux"))
|
| 157 | (license license:expat-0)))
|