| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | (define-module (gnu packages inferno)
|
| 21 | #:use-module (guix build-system gnu)
|
| 22 | #:use-module (guix gexp)
|
| 23 | #:use-module (guix git-download)
|
| 24 | #:use-module (guix packages)
|
| 25 | #:use-module ((guix licenses)
|
| 26 | #:prefix license:)
|
| 27 | #:use-module (gnu packages)
|
| 28 | #:use-module (gnu packages plan9)
|
| 29 | #:use-module (gnu packages xorg)
|
| 30 | #:use-module (ice-9 match))
|
| 31 |
|
| 32 | (define-public inferno
|
| 33 | |
| 34 | (let ((commit "67e70befb2ad0058fd7894be34c492ddb6d09988")
|
| 35 | (revision "0"))
|
| 36 | (package
|
| 37 | (name "inferno")
|
| 38 | (version (git-version "4" revision commit))
|
| 39 | (source
|
| 40 | (origin
|
| 41 | (method git-fetch)
|
| 42 | (uri (git-reference
|
| 43 | (url "https://github.com/inferno-os/inferno-os")
|
| 44 | (commit commit)
|
| 45 | |
| 46 | |
| 47 | (recursive? #t)))
|
| 48 | (file-name (git-file-name name version))
|
| 49 | (sha256
|
| 50 | (base32 "0g3fzb991hbwa7r3vsnybw7m1v13nins5ajmygnvz4vmx5rzl405"))
|
| 51 | (patches (search-patches "inferno-fix-crash.patch"))
|
| 52 | (modules '((guix build utils)))
|
| 53 | |
| 54 | (snippet '(delete-file-recursively "fonts"))))
|
| 55 | (build-system gnu-build-system)
|
| 56 | (arguments
|
| 57 | (list
|
| 58 | |
| 59 | |
| 60 | |
| 61 | #:system (match (%current-system)
|
| 62 | ((or "armhf-linux" "aarch64-linux")
|
| 63 | "armhf-linux")
|
| 64 | (_ "i686-linux"))
|
| 65 | |
| 66 | #:tests? #f
|
| 67 | #:phases
|
| 68 | #~(modify-phases %standard-phases
|
| 69 | (replace 'unpack
|
| 70 | (lambda* (#:key source #:allow-other-keys)
|
| 71 | (let* ((root (string-append #$output "/inferno")))
|
| 72 | |
| 73 | |
| 74 | |
| 75 | (mkdir-p root)
|
| 76 | (copy-recursively source root)
|
| 77 | (chdir root))))
|
| 78 | |
| 79 | (delete 'patch-generated-file-shebangs)
|
| 80 | (delete 'patch-shebangs)
|
| 81 | (replace 'patch-source-shebangs
|
| 82 | (lambda* (#:key inputs #:allow-other-keys)
|
| 83 | |
| 84 | (for-each (lambda (file)
|
| 85 | (substitute* file
|
| 86 | (("/bin/sh")
|
| 87 | (search-input-file inputs "/bin/bash"))))
|
| 88 | '("makemk.sh"
|
| 89 | "mkfiles/mkhost-Linux"
|
| 90 | "emu/Linux/mk-wrt"
|
| 91 | "utils/mk/Posix.c"))))
|
| 92 | (add-after 'patch-source-shebangs 'patch-src-files
|
| 93 | (lambda _
|
| 94 | |
| 95 | |
| 96 | (substitute* "makemk.sh" (("-m32") ""))
|
| 97 | |
| 98 | (substitute* "mkfiles/mkfile-Linux-386"
|
| 99 | (("cc -")
|
| 100 | |
| 101 | "gcc -"))
|
| 102 | (substitute* "mkfiles/mkfile-Linux-arm"
|
| 103 | (("arm-gcc")
|
| 104 | "gcc"))
|
| 105 | |
| 106 | (for-each (lambda (file)
|
| 107 | (substitute* file
|
| 108 | (("fsub")
|
| 109 | "_fsub")))
|
| 110 | '("utils/libmach/vcodas.c"
|
| 111 | "utils/libmach/vdb.c"))
|
| 112 | |
| 113 | (for-each (lambda (file)
|
| 114 | (substitute* file
|
| 115 | (("^CFLAGS=")
|
| 116 | (string-append
|
| 117 | "CFLAGS=-D_GNU_SOURCE"
|
| 118 | " -Wno-error=implicit-function-declaration"
|
| 119 | " -Wno-error=incompatible-pointer-types"
|
| 120 | " -fcommon"))))
|
| 121 | '("mkfiles/mkfile-Linux-386"
|
| 122 | "mkfiles/mkfile-Linux-arm"
|
| 123 | "mkfiles/mkfile-Linux-power"
|
| 124 | "mkfiles/mkfile-Linux-spim"))
|
| 125 | |
| 126 | |
| 127 | |
| 128 | (substitute* "emu/Linux/mkfile"
|
| 129 | (("^KERNDATE=.*$")
|
| 130 | "KERNDATE=0\n"))))
|
| 131 | (replace 'configure
|
| 132 | (lambda* (#:key inputs #:allow-other-keys)
|
| 133 | (let* ((objtype #$@(match (%current-system)
|
| 134 | ((or "armhf-linux" "aarch64-linux")
|
| 135 | `("arm"))
|
| 136 | (_ `("386"))))
|
| 137 | (root (string-append #$output "/inferno"))
|
| 138 | (root/bindir (string-append root "/Linux/" objtype "/bin")))
|
| 139 | (substitute* "mkconfig"
|
| 140 | (("ROOT=/usr/inferno")
|
| 141 | (string-append "ROOT=" root))
|
| 142 | (("SYSHOST=Plan9")
|
| 143 | "SYSHOST=Linux")
|
| 144 | (("OBJTYPE=\\$objtype")
|
| 145 | (string-append "OBJTYPE=" objtype)))
|
| 146 | |
| 147 | (delete-file-recursively root/bindir)
|
| 148 | (mkdir-p root/bindir)
|
| 149 | |
| 150 | (symlink root/bindir (string-append #$output "/inferno/bin"))
|
| 151 | (setenv "PATH"
|
| 152 | (string-append
|
| 153 | |
| 154 | root/bindir ":"
|
| 155 | (getenv "PATH") ":"
|
| 156 | |
| 157 | (search-input-directory inputs "/plan9/bin"))))))
|
| 158 | (replace 'build
|
| 159 | (lambda _
|
| 160 | |
| 161 | (invoke "mk" "-s" "nuke" "mkdirs" "install")))
|
| 162 | (replace 'install
|
| 163 | (lambda* (#:key inputs #:allow-other-keys)
|
| 164 | (let* ((bindir (string-append #$output "/bin"))
|
| 165 | (emu-script (string-append bindir "/emu"))
|
| 166 | (infwm-script (string-append bindir "/infwm"))
|
| 167 | (root/bindir (string-append #$output "/inferno/bin"))
|
| 168 | (simulate-fonts
|
| 169 | (lambda (size targets)
|
| 170 | (string-concatenate
|
| 171 | (map (lambda (file)
|
| 172 | (string-append
|
| 173 | "ramfile /fonts/" file ".font; "
|
| 174 | "bind /fonts/fixed/unicode." size ".font"
|
| 175 | " /fonts/" file ".font; "))
|
| 176 | targets))))
|
| 177 | (write-script
|
| 178 | (lambda (file cmds)
|
| 179 | (with-output-to-file file
|
| 180 | (lambda ()
|
| 181 | (display
|
| 182 | (string-concatenate
|
| 183 | (cons* "#!"
|
| 184 | (search-input-file inputs "/bin/bash")
|
| 185 | "\n"
|
| 186 | cmds)))))
|
| 187 | (chmod file #o755))))
|
| 188 | (mkdir-p bindir)
|
| 189 | (mkdir-p "fonts")
|
| 190 | |
| 191 | (write-script emu-script (list
|
| 192 | "exec " root/bindir "/emu sh -c \""
|
| 193 | |
| 194 | "bind '#U*"
|
| 195 | (search-input-directory inputs "/plan9/font")
|
| 196 | "' /fonts; "
|
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | "memfs -b /fonts; "
|
| 203 | (string-concatenate
|
| 204 | (map (lambda (dir)
|
| 205 | (string-append
|
| 206 | "mkdir /fonts/" dir "; "
|
| 207 | "bind /fonts/fixed /fonts/" dir "; "))
|
| 208 | '("charon" "lucida" "lucidasans" "lucm" "pelm")))
|
| 209 | (simulate-fonts "6x9"
|
| 210 | '("charon/cw.tiny"
|
| 211 | "charon/plain.tiny"
|
| 212 | "lucida/unicode.6"
|
| 213 | "lucidasans/latin1.6"
|
| 214 | "lucidasans/typelatin1.6"
|
| 215 | "lucidasans/unicode.6"))
|
| 216 | (simulate-fonts "7x13"
|
| 217 | '("charon/cw.small"
|
| 218 | "charon/plain.small"
|
| 219 | "lucida/unicode.7"
|
| 220 | "lucidasans/latin1.7"
|
| 221 | "lucidasans/typelatin1.7"
|
| 222 | "lucidasans/unicode.7"))
|
| 223 | (simulate-fonts "8x13"
|
| 224 | '("charon/cw.normal"
|
| 225 | "charon/plain.normal"
|
| 226 | "lucida/unicode.8"
|
| 227 | "lucidasans/euro.8"
|
| 228 | "lucidasans/latin1.8"
|
| 229 | "lucidasans/typelatin1.8"
|
| 230 | "lucidasans/unicode.8"
|
| 231 | "pelm/unicode.8"))
|
| 232 | (simulate-fonts "9x15"
|
| 233 | '("charon/cw.large"
|
| 234 | "charon/plain.large"
|
| 235 | "lucida/unicode.10"
|
| 236 | "lucidasans/latin1.10"
|
| 237 | "lucidasans/typelatin1.10"
|
| 238 | "lucidasans/unicode.10"
|
| 239 | "lucm/unicode.9"
|
| 240 | "pelm/ascii.12"
|
| 241 | "pelm/latin1.9"
|
| 242 | "pelm/unicode.9"))
|
| 243 | (simulate-fonts "10x20"
|
| 244 | '("charon/cw.vlarge"
|
| 245 | "charon/plain.vlarge"
|
| 246 | "lucida/moo.16"
|
| 247 | "lucida/unicode.13"
|
| 248 | "lucidasans/latin1.13"
|
| 249 | "lucidasans/typelatin1.13"
|
| 250 | "lucidasans/unicode.13"
|
| 251 | "pelm/ascii.16"))
|
| 252 | (simulate-fonts "6x13O"
|
| 253 | '("charon/italic.tiny"
|
| 254 | "charon/italic.small"
|
| 255 | "lucidasans/italiclatin1.6"
|
| 256 | "lucidasans/italiclatin1.7"))
|
| 257 | (simulate-fonts "7x13O"
|
| 258 | '("charon/italic.normal"
|
| 259 | "lucidasans/italiclatin1.8"))
|
| 260 | (simulate-fonts "8x13O"
|
| 261 | '("charon/italic.large"
|
| 262 | "charon/italic.vlarge"
|
| 263 | "lucidasans/italiclatin1.10"
|
| 264 | "lucidasans/italiclatin1.13"))
|
| 265 | (simulate-fonts "6x13B"
|
| 266 | '("charon/bold.tiny"
|
| 267 | "lucidasans/boldlatin1.6"))
|
| 268 | (simulate-fonts "7x13B"
|
| 269 | '("charon/bold.small"
|
| 270 | "lucidasans/boldlatin1.7"))
|
| 271 | (simulate-fonts "8x13B"
|
| 272 | '("charon/bold.normal"
|
| 273 | "lucidasans/boldlatin1.8"))
|
| 274 | (simulate-fonts "9x15B"
|
| 275 | '("charon/bold.large"
|
| 276 | "lucidasans/boldlatin1.10"))
|
| 277 | (simulate-fonts "9x18B"
|
| 278 | '("charon/bold.vlarge"
|
| 279 | "lucidasans/boldlatin1.13"))
|
| 280 | |
| 281 | |
| 282 | "bind -bc '#U*/tmp' /tmp; "
|
| 283 | |
| 284 | |
| 285 | "bind '#U*/home' /usr; "
|
| 286 | "$*\"\n"))
|
| 287 | |
| 288 | (write-script infwm-script (list
|
| 289 | "exec " bindir "/emu $* wm/wm wm/logon -u $USER\n"))
|
| 290 | |
| 291 | (symlink (string-append root/bindir "/limbo")
|
| 292 | (string-append bindir "/limbo")))))
|
| 293 | |
| 294 | (delete 'compress-documentation))))
|
| 295 | (inputs (list libx11 libxext plan9port xorgproto))
|
| 296 | (home-page "https://www.inferno-os.org")
|
| 297 | (synopsis
|
| 298 | "Compact operating system for building cross-platform distributed systems")
|
| 299 | (description
|
| 300 | |
| 301 | |
| 302 | "Inferno is a virtualised operating system that can run natively across
|
| 303 | a wide range of processor architectures or hosted on a wide range of
|
| 304 | operating systems. The principal components of the system are:
|
| 305 | @itemize
|
| 306 | @item The Inferno kernel which can run both native and hosted on a
|
| 307 | range of platforms and which presents the same interface to programs
|
| 308 | in both cases.
|
| 309 | @item The Dis virtual machine.
|
| 310 | @item Styx - the tiny broad-spectrum file service protocol.
|
| 311 | @item Limbo - a new simple, modular, concurrent programming language.
|
| 312 | @item Tk and Prefab - graphical user interface (GUI) primitives
|
| 313 | without a lot of goo.
|
| 314 | @item The portable cross-development suites that allow any native
|
| 315 | Inferno platform to be cross-compiled on any hosted system.
|
| 316 | @end itemize
|
| 317 | This package provides hosted Inferno.
|
| 318 | ")
|
| 319 | (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"
|
| 320 | "aarch64-linux"))
|
| 321 | (license (list license:expat |
| 322 | license:freetype
|
| 323 | |
| 324 | |
| 325 | license:gpl2+
|
| 326 | license:lgpl2.0+)))))
|