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>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
20 (define-module (gnu packages mastodon)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix git-download)
24 #:use-module (guix build-system meson)
25 #:use-module (guix build-system python)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (gnu packages check)
28 #:use-module (gnu packages freedesktop)
29 #:use-module (gnu packages gettext)
30 #:use-module (gnu packages glib)
31 #:use-module (gnu packages gnome)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages python-check)
35 #:use-module (gnu packages python-crypto)
36 #:use-module (gnu packages python-web)
37 #:use-module (gnu packages python-xyz)
38 #:use-module (gnu packages time))
47 (uri (pypi-uri "toot" version))
49 (base32 "1mfbqmgna7046d134pc5qx1vyfd60vwcn0xr9lxzlmc5rjdbmz8x"))))
50 (build-system python-build-system)
53 (modify-phases %standard-phases
55 (lambda* (#:key inputs outputs #:allow-other-keys)
56 (add-installed-pythonpath inputs outputs)
57 (invoke "py.test"))))))
59 `(("python-pytest" ,python-pytest)))
61 `(("python-beautifulsoup4" ,python-beautifulsoup4)
62 ("python-requests" ,python-requests)
63 ("python-urwid" ,python-urwid)
64 ("python-wcwidth" ,python-wcwidth)))
65 (home-page "https://github.com/ihabunek/toot/")
66 (synopsis "Mastodon CLI client")
67 (description "Interact with Mastodon social network from the command line.
70 @item Posting, replying, deleting statuses
71 @item Support for media uploads, spoiler text, sensitive content
72 @item Search by account or hash tag
73 @item Following, muting and blocking accounts
74 @item Simple switching between authenticated in Mastodon accounts
76 (license license:gpl3)))
86 (url "https://github.com/bleakgrey/tootle")
88 (file-name (git-file-name name version))
91 "1nm57239mhdq462an6bnhdlijpijxmjs9mqbyirwxwa048d3n4rm"))))
92 (build-system meson-build-system)
96 (modify-phases %standard-phases
97 (add-after 'unpack 'skip-gtk-update-icon-cache
98 ;; Don't create 'icon-theme.cache'.
100 (substitute* "meson/post_install.py"
101 (("gtk-update-icon-cache") "true"))
103 (add-after 'unpack 'patch-source
105 (substitute* "src/Dialogs/NewAccount.vala"
106 (("xdg-mime") (which "xdg-mime")))
107 ;; Patch for building on glib < 2.64
108 (substitute* "src/Build.vala"
109 (("(os_name = ).*" _ first) (string-append first "\"GNU\";\n"))
110 (("(os_ver = ).*" _ first) (string-append first "\"Guix\";\n"))
111 (("GLib.Environment.get_os_info.*") "\"unknown\";\n"))
113 (add-after 'install 'symlink-package
114 (lambda* (#:key outputs #:allow-other-keys)
115 (symlink "com.github.bleakgrey.tootle"
116 (string-append (assoc-ref outputs "out") "/bin/tootle"))
119 `(("gettext" ,gettext-minimal)
120 ("glib:bin" ,glib "bin") ; for glib-compile-resources
121 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
122 ("pkg-config" ,pkg-config)))
124 `(("glib-networking" ,glib-networking)
126 ("json-glib" ,json-glib)
128 ("libhandy" ,libhandy)
131 ("xdg-utils" ,xdg-utils)))
132 (home-page "https://github.com/bleakgrey/tootle")
133 (synopsis "GTK3 client for Mastodon")
134 (description "Tootle is a GTK client for Mastodon. It provides a clean,
135 native interface that allows you to integrate Mastodon's social experience
136 seamlessly with your desktop environment.")
137 (license license:gpl3+)))
139 (define-public python-mastodon-py
141 (name "python-mastodon-py")
146 (uri (pypi-uri "Mastodon.py" version))
149 "1vikvkzcij2gd730cssigxi38vlmzqmwdy58r3y2cwsxifnxpz9a"))))
150 (build-system python-build-system)
152 `(("python-blurhash" ,python-blurhash)
153 ("python-dateutil" ,python-dateutil)
154 ("python-decorator" ,python-decorator)
155 ("python-magic" ,python-magic)
156 ("python-pytz" ,python-pytz)
157 ("python-requests" ,python-requests)
158 ("python-six" ,python-six)))
160 `(("python-blurhash" ,python-blurhash)
161 ("python-cryptography" ,python-cryptography)
162 ("python-http-ece" ,python-http-ece)
163 ("python-pytest" ,python-pytest)
164 ("python-pytest-cov" ,python-pytest-cov)
165 ("python-pytest-mock" ,python-pytest-mock)
166 ("python-pytest-runner" ,python-pytest-runner)
167 ("python-pytest-vcr" ,python-pytest-vcr)
168 ("python-requests-mock" ,python-requests-mock)
169 ("python-vcrpy" ,python-vcrpy)))
170 (home-page "https://github.com/halcy/Mastodon.py")
171 (synopsis "Python wrapper for the Mastodon API")
173 "This package provides a python wrapper for the Mastodon API.")
174 (license license:expat)))