runcache.scm 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. (define-module (staging runcache)
  2. #:use-module ((guix licenses) #:prefix license:)
  3. #:use-module (guix packages)
  4. #:use-module (guix utils)
  5. #:use-module (guix git-download)
  6. #:use-module (gnu packages base)
  7. #:use-module (gnu packages bash)
  8. #:use-module (gnu packages gawk)
  9. #:use-module (guix build-system trivial))
  10. (define-public runcache
  11. (package
  12. (name "runcache")
  13. (version "0.1")
  14. (source (origin
  15. (method git-fetch)
  16. (uri (git-reference
  17. (url "https://github.com/moul/runcache.git")
  18. (commit "4bd818facaabc964f812e324281175e11b427c85")))
  19. (file-name (git-file-name name version))
  20. (sha256
  21. (base32
  22. "0pch8znlhf4zah9xfx07r0kqr78rx7gvcfn05vk8sy1cq7ami0jx"))))
  23. (build-system trivial-build-system)
  24. (arguments
  25. `(#:modules ((guix build utils))
  26. #:builder (begin
  27. (use-modules (guix build utils))
  28. (let* ((runcache-script (string-append (assoc-ref %build-inputs "source")
  29. "/runcache"))
  30. (bin-dir (string-append %output "/bin/"))
  31. (target-script (string-append bin-dir "/runcache"))
  32. (awk (string-append (assoc-ref %build-inputs "gawk")
  33. "/bin/awk"))
  34. (which (string-append (assoc-ref %build-inputs "which")
  35. "/bin/which"))
  36. (md5sum (string-append (assoc-ref %build-inputs "coreutils")
  37. "/bin/md5sum"))
  38. (bash (string-append (assoc-ref %build-inputs "bash")
  39. "/bin/bash")))
  40. (mkdir-p bin-dir)
  41. (copy-file runcache-script target-script)
  42. (chmod target-script #o755)
  43. (substitute* target-script
  44. (("/bin/bash") bash)
  45. (("awk") awk)
  46. (("which") which)
  47. (("md5sum") md5sum))
  48. #t))))
  49. (inputs
  50. `(("bash" ,bash)
  51. ("coreutils" ,coreutils)
  52. ("gawk" ,gawk)
  53. ("which" ,which)))
  54. (home-page "https://github.com/moul/runcache")
  55. (synopsis "Shell command caching")
  56. (description "runcache provides ccache-style caching for unix commands.")
  57. (license license:expat)))