(use-modules ((gnu packages base) #:select (tar)) ((gnu packages bash) #:select (bash-minimal)) ((gnu packages compression) #:select (lzip)) ((gnu packages python) #:select (python)) (guix) (guix build-system trivial)) (package (name "blog") (version "3") (source (origin (method url-fetch) (uri (string-append "file:///home/phf/programs/blog/releases/release_" version ".tar.lz")) (sha256 (base32 "1y819b53ksyas6asldysr0r8p73n5i8ipbpmbgjrfx8qz8cy2zsx")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (newline) (display "Start of build expression execution") (newline) (newline) (display "Show inputs") (newline) ((lambda (name value) (display (string-join (list name "=" (format #f "~a" value) "\n")))) " %build-inputs" %build-inputs) (newline) (display "Show outputs") (newline) ((lambda (name value) (display (string-join (list name "=" (format #f "~a" value) "\n")))) " %outputs" %outputs) (newline) (display "Unpack source") (newline) (let ((source (assoc-ref %build-inputs "source")) (tar (assoc-ref %build-inputs "tar")) (lzip (assoc-ref %build-inputs "lzip"))) (setenv "PATH" (string-append tar "/bin" ":" lzip "/bin")) (invoke "tar" "--lzip" "-xvf" source)) (newline) (display "Reference interpreters available in the build") (newline) (let ((bash (assoc-ref %build-inputs "bash")) (python (assoc-ref %build-inputs "python"))) (substitute* "blog/bin/program" (("/usr/bin/env bash") (string-append bash "/bin/bash")) (("python3") (string-append python "/bin/python3")))) (newline) (display "Make executable available to the host system") (newline) (let ((out (assoc-ref %outputs "out"))) (chmod "blog/bin/program" #o775) (copy-recursively "blog" out)) (newline) (newline) (display "End of build expression execution") (newline) (newline) ))) (inputs `(("bash" ,bash-minimal) ("python" ,python))) (native-inputs `(("lzip" ,lzip) ("tar" ,tar))) (synopsis #f) (description #f) (home-page #f) (license #f))