guix.scm 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ;;; guix.scm --- Package to build/install shell script from this directory
  2. ;; Copyright © 2016 Alex Kost <alezost@gmail.com>
  3. ;; This program is free software; you can redistribute it and/or modify
  4. ;; it under the terms of the GNU General Public License as published by
  5. ;; the Free Software Foundation, either version 3 of the License, or
  6. ;; (at your option) any later version.
  7. ;;
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;;
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Commentary:
  16. ;; See <http://lists.gnu.org/archive/html/help-guix/2016-08/msg00101.html>.
  17. ;;; Code:
  18. (use-modules
  19. (guix gexp)
  20. (guix packages)
  21. ;; (guix licenses)
  22. (guix build-system trivial)
  23. (gnu packages bash))
  24. (let ((script-name "my-script"))
  25. (package
  26. (name script-name)
  27. (version "0.1")
  28. (source (local-file (string-append (dirname (current-filename))
  29. "/" script-name)))
  30. (build-system trivial-build-system)
  31. (arguments
  32. `(#:modules ((guix build utils))
  33. #:builder
  34. (begin
  35. (use-modules (guix build utils))
  36. (let* ((bin-dir (string-append %output "/bin"))
  37. (bin-file (string-append bin-dir "/" ,script-name))
  38. (bash-bin (string-append (assoc-ref %build-inputs "bash")
  39. "/bin")))
  40. (mkdir-p bin-dir)
  41. (copy-file (assoc-ref %build-inputs "source") bin-file)
  42. (patch-shebang bin-file (list bash-bin))
  43. (chmod bin-file #o555)))))
  44. (inputs `(("bash" ,bash)))
  45. (home-page #f)
  46. (synopsis "bla bla")
  47. (description "More verbose bla bla")
  48. (license #f)))
  49. ;;; guix.scm ends here