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