guix.scm 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ;;; guix.scm --- Guix package for Guile-Daemon
  2. ;; Copyright © 2016–2017, 2020 Alex Kost <alezost@gmail.com>
  3. ;; This file is part of Guile-Daemon.
  4. ;; Guile-Daemon is free software; you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;;
  9. ;; Guile-Daemon is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;;
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with Guile-Daemon. If not, see <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;; This file contains Guix package for development version of
  18. ;; Guile-Daemon. To build or install, run:
  19. ;;
  20. ;; guix build --file=guix.scm
  21. ;; guix package --install-from-file=guix.scm
  22. ;; The main purpose of this file though is to make a development
  23. ;; environment for building Guile-Daemon:
  24. ;;
  25. ;; guix environment --pure --load=guix.scm
  26. ;; ./autogen.sh
  27. ;; ./configure
  28. ;; make
  29. ;;; Code:
  30. (use-modules
  31. (ice-9 popen)
  32. (ice-9 rdelim)
  33. (guix gexp)
  34. (guix packages)
  35. (guix git-download)
  36. (guix build utils)
  37. (gnu packages autotools)
  38. (gnu packages guile-xyz)
  39. (gnu packages pkg-config)
  40. (gnu packages texinfo))
  41. (define %source-dir (dirname (current-filename)))
  42. (define (git-output . args)
  43. "Execute 'git ARGS ...' command and return its output without trailing
  44. newspace."
  45. (with-directory-excursion %source-dir
  46. (let* ((port (apply open-pipe* OPEN_READ "git" args))
  47. (output (read-string port)))
  48. (close-pipe port)
  49. (string-trim-right output #\newline))))
  50. (define (current-commit)
  51. (git-output "log" "-n" "1" "--pretty=format:%H"))
  52. (define guile-daemon-devel
  53. (let ((commit (current-commit)))
  54. (package
  55. (inherit guile-daemon)
  56. (version (string-append (package-version guile-daemon)
  57. "-" (string-take commit 7)))
  58. (source (local-file %source-dir
  59. #:recursive? #t
  60. #:select? (git-predicate %source-dir)))
  61. (arguments
  62. '(#:phases
  63. (modify-phases %standard-phases
  64. (add-after 'unpack 'autogen
  65. (lambda _ (zero? (system* "sh" "autogen.sh")))))))
  66. (native-inputs
  67. (append (package-native-inputs guile-daemon)
  68. `(("autoconf" ,autoconf)
  69. ("automake" ,automake)
  70. ("texinfo" ,texinfo)))))))
  71. guile-daemon-devel
  72. ;;; guix.scm ends here