dev.fron.io rc / c7d5d45
packages: add multios-usb Tony Olagbaiye a month ago
1 changed file(s) with 73 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 (define-module (rc packages multios-usb)
1 #:use-module (guix git-download)
2 #:use-module (guix utils)
3 #:use-module (guix packages)
4 #:use-module (guix build-system copy)
5 #:use-module (gnu packages bash)
6 #:use-module (gnu packages bootloaders)
7 #:use-module (gnu packages disk)
8 #:use-module (gnu packages linux)
9 #:export (multios-usb))
10
11 (define multios-usb
12 (package
13 (name "multios-usb")
14 (version "0.3.1")
15 (source (origin
16 (method git-fetch)
17 (uri (git-reference
18 (url "https://github.com/Mexit/MultiOS-USB")
19 (commit (string-append "v" version))))
20 (sha256
21 (base32
22 "15lm5r4mq7165q6q169lgxhhh3y3xf0afdmr75xqb35bs2wv5q1f"))))
23 (inputs `(("bash" ,bash)
24 ("e2fsprogs" ,e2fsprogs)
25 ("dosfstools" ,dosfstools)
26 ("grub" ,grub)))
27 (build-system copy-build-system)
28 (arguments
29 `(#:install-plan
30 '(("." "libexec"))
31 #:phases
32 (modify-phases %standard-phases
33 (add-after 'install 'clean
34 (lambda* (#:key inputs outputs #:allow-other-keys)
35 (let* ((out (assoc-ref outputs "out"))
36 (bash (assoc-ref inputs "bash"))
37 (binpath
38 (append
39 (map (lambda (i) (string-append (cdr i) "/sbin")) inputs)
40 (map (lambda (i) (string-append (cdr i) "/bin")) inputs))))
41 (mkdir-p (string-append out "/bin"))
42 (with-output-to-file
43 (string-append out "/bin/multios-usb-install")
44 (lambda _
45 (display (string-append "#!" (string-append bash "/bin/sh") "\n"))
46 (display (string-append "export PATH=" (string-join binpath ":") ":$PATH\n"))
47 (display (string-append "RUNDIR=$(mktemp -d /tmp/.multios-usb.XXX)\n"))
48 (display (string-append "cp -r " (string-append out "/libexec/* ") "$RUNDIR\n"))
49 (display (string-append "cd $RUNDIR\n"))
50 (display (string-append "source " (string-append out "/libexec/installer.sh ") "$@\n"))
51 (display (string-append "rm -rf $RUNDIR\n"))
52 (newline)))
53 (chmod (string-append out "/bin/multios-usb-install") #o555)
54 (with-output-to-file
55 (string-append out "/bin/multios-usb-update")
56 (lambda _
57 (display (string-append "#!" (string-append bash "/bin/sh") "\n"))
58 (display (string-append "export PATH=" (string-join binpath ":") ":$PATH\n"))
59 (display (string-append "RUNDIR=$(mktemp -d /tmp/.multios-usb.XXX)\n"))
60 (display (string-append "cp -r " (string-append out "/libexec/* ") "$RUNDIR\n"))
61 (display (string-append "cd $RUNDIR\n"))
62 (display (string-append "source " (string-append out "/libexec/updater.sh ") "$@\n"))
63 (display (string-append "rm -rf $RUNDIR\n"))
64 (newline)))
65 (chmod (string-append out "/bin/multios-usb-update") #o555)
66 #t))))))
67 (home-page "")
68 (synopsis "")
69 (description "")
70 (license #f)))
71
72 multios-usb