scripts.scm (1654B)
1 (define-module (mt scripts) 2 #:use-module (gnu packages shells) 3 #:use-module (guix build-system trivial) 4 #:use-module (guix gexp) 5 #:use-module (guix packages) 6 #:export (mt-scripts)) 7 8 (define dash-w-sh-symlink 9 (package 10 (inherit dash) 11 (arguments 12 `(#:phases 13 (modify-phases %standard-phases 14 (add-after 'install 'install-sh-symlink 15 (lambda* (#:key outputs #:allow-other-keys) 16 ;; Add a `sh' -> `dash' link. 17 (let ((out (assoc-ref outputs "out"))) 18 (with-directory-excursion (string-append out "/bin") 19 (symlink "dash" "sh") 20 #t))))))))) 21 22 (define mt-scripts 23 (package 24 (name "mt-scripts") 25 (version "0.1") 26 (source (local-file "scripts" #:recursive? #t)) 27 (build-system trivial-build-system) 28 (arguments 29 `(#:modules ((guix build utils)) 30 #:builder 31 (begin 32 (use-modules (guix build utils)) 33 (let* ((bin-dir (string-append %output "/bin")) 34 (dash-bin (string-append (assoc-ref %build-inputs "dash") 35 "/bin")) 36 (copy-script (lambda (file dest) 37 (copy-file file dest) 38 (patch-shebang dest (list dash-bin)) 39 (chmod dest #o555)))) 40 (mkdir-p bin-dir) 41 (copy-recursively (assoc-ref %build-inputs "source") bin-dir 42 #:copy-file copy-script))))) 43 (inputs `(("dash" ,dash-w-sh-symlink))) 44 (home-page #f) 45 (synopsis "MonasTech shell scripts") 46 (description #f) 47 (license #f)))