PageRenderTime 786ms CodeModel.GetById 29ms RepoModel.GetById 17ms app.codeStats 0ms

/gnu/packages/mastodon.scm

https://gitlab.com/daym/guix
Scheme | 174 lines | 150 code | 4 blank | 20 comment | 5 complexity | 44c8902c27550a96ca79191ee6d02fab MD5 | raw file
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  3. ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages mastodon)
  20. #:use-module (guix packages)
  21. #:use-module (guix download)
  22. #:use-module (guix git-download)
  23. #:use-module (guix build-system meson)
  24. #:use-module (guix build-system python)
  25. #:use-module ((guix licenses) #:prefix license:)
  26. #:use-module (gnu packages check)
  27. #:use-module (gnu packages freedesktop)
  28. #:use-module (gnu packages gettext)
  29. #:use-module (gnu packages glib)
  30. #:use-module (gnu packages gnome)
  31. #:use-module (gnu packages gtk)
  32. #:use-module (gnu packages pkg-config)
  33. #:use-module (gnu packages python-check)
  34. #:use-module (gnu packages python-crypto)
  35. #:use-module (gnu packages python-web)
  36. #:use-module (gnu packages python-xyz)
  37. #:use-module (gnu packages time))
  38. (define-public toot
  39. (package
  40. (name "toot")
  41. (version "0.27.0")
  42. (source
  43. (origin
  44. (method url-fetch)
  45. (uri (pypi-uri "toot" version))
  46. (sha256
  47. (base32 "1mfbqmgna7046d134pc5qx1vyfd60vwcn0xr9lxzlmc5rjdbmz8x"))))
  48. (build-system python-build-system)
  49. (arguments
  50. '(#:phases
  51. (modify-phases %standard-phases
  52. (replace 'check
  53. (lambda* (#:key inputs outputs #:allow-other-keys)
  54. (add-installed-pythonpath inputs outputs)
  55. (invoke "py.test"))))))
  56. (native-inputs
  57. `(("python-pytest" ,python-pytest)))
  58. (inputs
  59. `(("python-beautifulsoup4" ,python-beautifulsoup4)
  60. ("python-requests" ,python-requests)
  61. ("python-urwid" ,python-urwid)
  62. ("python-wcwidth" ,python-wcwidth)))
  63. (home-page "https://github.com/ihabunek/toot/")
  64. (synopsis "Mastodon CLI client")
  65. (description "Interact with Mastodon social network from the command line.
  66. Features include:
  67. @itemize
  68. @item Posting, replying, deleting statuses
  69. @item Support for media uploads, spoiler text, sensitive content
  70. @item Search by account or hash tag
  71. @item Following, muting and blocking accounts
  72. @item Simple switching between authenticated in Mastodon accounts
  73. @end itemize")
  74. (license license:gpl3)))
  75. (define-public tootle
  76. (package
  77. (name "tootle")
  78. (version "1.0")
  79. (source
  80. (origin
  81. (method git-fetch)
  82. (uri (git-reference
  83. (url "https://github.com/bleakgrey/tootle")
  84. (commit version)))
  85. (file-name (git-file-name name version))
  86. (sha256
  87. (base32
  88. "1nm57239mhdq462an6bnhdlijpijxmjs9mqbyirwxwa048d3n4rm"))))
  89. (build-system meson-build-system)
  90. (arguments
  91. `(#:glib-or-gtk? #t
  92. #:phases
  93. (modify-phases %standard-phases
  94. (add-after 'unpack 'skip-gtk-update-icon-cache
  95. ;; Don't create 'icon-theme.cache'.
  96. (lambda _
  97. (substitute* "meson/post_install.py"
  98. (("gtk-update-icon-cache") "true"))
  99. #t))
  100. (add-after 'unpack 'patch-source
  101. (lambda _
  102. (substitute* "src/Dialogs/NewAccount.vala"
  103. (("xdg-mime") (which "xdg-mime")))
  104. ;; Patch for building on glib < 2.64
  105. (substitute* "src/Build.vala"
  106. (("(os_name = ).*" _ first) (string-append first "\"GNU\";\n"))
  107. (("(os_ver = ).*" _ first) (string-append first "\"Guix\";\n"))
  108. (("GLib.Environment.get_os_info.*") "\"unknown\";\n"))
  109. #t))
  110. (add-after 'install 'symlink-package
  111. (lambda* (#:key outputs #:allow-other-keys)
  112. (symlink "com.github.bleakgrey.tootle"
  113. (string-append (assoc-ref outputs "out") "/bin/tootle"))
  114. #t)))))
  115. (native-inputs
  116. `(("gettext" ,gettext-minimal)
  117. ("glib:bin" ,glib "bin") ; for glib-compile-resources
  118. ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
  119. ("pkg-config" ,pkg-config)))
  120. (inputs
  121. `(("glib-networking" ,glib-networking)
  122. ("gtk+" ,gtk+)
  123. ("json-glib" ,json-glib)
  124. ("libgee" ,libgee)
  125. ("libhandy" ,libhandy)
  126. ("libsoup" ,libsoup)
  127. ("vala" ,vala-0.50)
  128. ("xdg-utils" ,xdg-utils)))
  129. (home-page "https://github.com/bleakgrey/tootle")
  130. (synopsis "GTK3 client for Mastodon")
  131. (description "Tootle is a GTK client for Mastodon. It provides a clean,
  132. native interface that allows you to integrate Mastodon's social experience
  133. seamlessly with your desktop environment.")
  134. (license license:gpl3+)))
  135. (define-public python-mastodon-py
  136. (package
  137. (name "python-mastodon-py")
  138. (version "1.5.1")
  139. (source
  140. (origin
  141. (method url-fetch)
  142. (uri (pypi-uri "Mastodon.py" version))
  143. (sha256
  144. (base32
  145. "1vikvkzcij2gd730cssigxi38vlmzqmwdy58r3y2cwsxifnxpz9a"))))
  146. (build-system python-build-system)
  147. (propagated-inputs
  148. `(("python-blurhash" ,python-blurhash)
  149. ("python-dateutil" ,python-dateutil)
  150. ("python-decorator" ,python-decorator)
  151. ("python-magic" ,python-magic)
  152. ("python-pytz" ,python-pytz)
  153. ("python-requests" ,python-requests)
  154. ("python-six" ,python-six)))
  155. (native-inputs
  156. `(("python-blurhash" ,python-blurhash)
  157. ("python-cryptography" ,python-cryptography)
  158. ("python-http-ece" ,python-http-ece)
  159. ("python-pytest" ,python-pytest)
  160. ("python-pytest-cov" ,python-pytest-cov)
  161. ("python-pytest-mock" ,python-pytest-mock)
  162. ("python-pytest-runner" ,python-pytest-runner)
  163. ("python-pytest-vcr" ,python-pytest-vcr)
  164. ("python-requests-mock" ,python-requests-mock)
  165. ("python-vcrpy" ,python-vcrpy)))
  166. (home-page "https://github.com/halcy/Mastodon.py")
  167. (synopsis "Python wrapper for the Mastodon API")
  168. (description
  169. "This package provides a python wrapper for the Mastodon API.")
  170. (license license:expat)))