guix.scm 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ;;; guix.scm --- Guix package for texi-docstring-magic
  2. ;; Copyright © 2018 Jelle Licht <jlicht@fsfe.org>
  3. ;; This file is part of texi-docstring-magic.
  4. ;; texi-docstring-magic is free software; you can redistribute it
  5. ;; and/or modify it under the terms of the GNU General Public License version 2
  6. ;; as published by the Free Software Foundation.
  7. ;;
  8. ;; texi-docstring-magic is distributed in the hope that it will be
  9. ;; useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  10. ;; of 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 texi-docstring-magic. If not, see
  15. ;; <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;; This file contains Guix package for development version of
  18. ;; texi-docstring-magic. To build or install, run:
  19. ;;
  20. ;; guix build --file=guix.scm
  21. ;; guix package --install-from-file=guix.scm
  22. ;;; Code:
  23. (use-modules
  24. (ice-9 popen)
  25. (ice-9 rdelim)
  26. (guix build utils)
  27. (guix build-system emacs)
  28. (guix gexp)
  29. (guix licenses)
  30. (guix git-download)
  31. (guix packages)
  32. (gnu packages emacs))
  33. (define %source-dir (dirname (current-filename)))
  34. (define (git-output . args)
  35. "Execute 'git ARGS ...' command and return its output without trailing
  36. newspace."
  37. (with-directory-excursion %source-dir
  38. (let* ((port (apply open-pipe* OPEN_READ "git" args))
  39. (output (read-string port)))
  40. (close-port port)
  41. (string-trim-right output #\newline))))
  42. (define (current-commit)
  43. (git-output "log" "-n" "1" "--pretty=format:%H"))
  44. (define emacs-texi-docstring-magic
  45. (let ((commit (current-commit))
  46. (revision "0")
  47. (version "0.1.0"))
  48. (package
  49. (name "emacs-texi-docstring-magic")
  50. (version (string-append version "-" revision "." (string-take commit 7)))
  51. (source (local-file %source-dir
  52. #:recursive? #t
  53. #:select? (git-predicate %source-dir)))
  54. (build-system emacs-build-system)
  55. (propagated-inputs
  56. `(("emacs-geiser" ,emacs-geiser)))
  57. (home-page "https://notabug.org/jlicht/texi-docstring-magic")
  58. (synopsis "Munge internal docstrings into texi")
  59. (description "This package generates Texinfo source fragments
  60. from Emacs docstrings. This avoids documenting functions and
  61. variables in more than one place, and automatically adds Texinfo
  62. markup to docstrings.")
  63. (license gpl2))))
  64. emacs-texi-docstring-magic
  65. ;;; guix.scm ends here