diff options
| author | Orahcio FelĂcio de Sousa <orahcio@gmail.com> | 2026-06-13 18:00:31 -0300 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2026-06-20 19:14:48 +0100 |
| commit | 008e6d5da57ab7a73e6fdf02583c0ebb8f199814 (patch) | |
| tree | a4b72013cea51dc06f084758a0274d863da742a4 | |
| parent | b3506e9f7d76c0ca02135ef5b1849601eac1c930 (diff) | |
gnu: Add twtxt.
* gnu/packages/messaging.scm (twtxt): New variable.
* gnu/packages/patches/python-twtxt-replace-pkg-resources.patch: New file.
* gnu/local.mk (dist_patch_DATA): Reference it here.
Merges: guix/guix!9282
Reviewed-by: Hugo Buddelmeijer <hugo@buddelmeijer.nl>
Modified-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/messaging.scm | 42 | ||||
| -rw-r--r-- | gnu/packages/patches/python-twtxt-replace-pkg-resources.patch | 30 |
3 files changed, 73 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index d8c4afac13c..4dc18379651 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -2146,6 +2146,7 @@ dist_patch_DATA = \ | |||
| 2146 | %D%/packages/patches/python-sphobjinv-defer-ssl-import.patch \ | 2146 | %D%/packages/patches/python-sphobjinv-defer-ssl-import.patch \ |
| 2147 | %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch \ | 2147 | %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch \ |
| 2148 | %D%/packages/patches/python-sshtunnel-pep518.patch \ | 2148 | %D%/packages/patches/python-sshtunnel-pep518.patch \ |
| 2149 | %D%/packages/patches/python-twtxt-replace-pkg-resources.patch \ | ||
| 2149 | %D%/packages/patches/python-zeroc-ice-3.6.5-python-3.11-support.patch \ | 2150 | %D%/packages/patches/python-zeroc-ice-3.6.5-python-3.11-support.patch \ |
| 2150 | %D%/packages/patches/python-zeroc-ice-3.6.5-python-3.12-support.patch \ | 2151 | %D%/packages/patches/python-zeroc-ice-3.6.5-python-3.12-support.patch \ |
| 2151 | %D%/packages/patches/python-zipfile2-python-3.12-support.patch \ | 2152 | %D%/packages/patches/python-zipfile2-python-3.12-support.patch \ |
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 4aaa6172f0f..1b2f19cf880 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm | |||
| @@ -3109,6 +3109,48 @@ It's a spin-off of the Psi XMPP client.") | |||
| 3109 | (define-deprecated-package psi | 3109 | (define-deprecated-package psi |
| 3110 | psi-plus) | 3110 | psi-plus) |
| 3111 | 3111 | ||
| 3112 | (define-public twtxt | ||
| 3113 | (package | ||
| 3114 | (name "twtxt") | ||
| 3115 | (version "1.3.1") | ||
| 3116 | (source | ||
| 3117 | (origin | ||
| 3118 | (method git-fetch) | ||
| 3119 | (uri (git-reference | ||
| 3120 | (url "https://github.com/buckket/twtxt") | ||
| 3121 | (commit (string-append "v" version)))) | ||
| 3122 | (file-name (git-file-name name version)) | ||
| 3123 | (sha256 | ||
| 3124 | (base32 "1k7187fva6pmnyrz1pq37pq7wfnxix8qgzn5dzgjk3l8ipb63c89")) | ||
| 3125 | (patches | ||
| 3126 | ;; Patch already merged in the project for future release. | ||
| 3127 | (search-patches "python-twtxt-replace-pkg-resources.patch")))) | ||
| 3128 | (build-system pyproject-build-system) | ||
| 3129 | (native-inputs | ||
| 3130 | (list python-pytest | ||
| 3131 | python-setuptools)) | ||
| 3132 | (inputs | ||
| 3133 | (list python-aiohttp | ||
| 3134 | python-click | ||
| 3135 | python-humanize | ||
| 3136 | python-dateutil)) | ||
| 3137 | (home-page "https://github.com/buckket/twtxt") | ||
| 3138 | (synopsis "Decentralised, minimalist microblogging service") | ||
| 3139 | (description | ||
| 3140 | "@command{twtxt} is a decentralised, minimalist microblogging service for | ||
| 3141 | hackers. | ||
| 3142 | |||
| 3143 | So you want to get some thoughts out on the internet in a convenient and slick | ||
| 3144 | way while also following the gibberish of others? Instead of signing up at a | ||
| 3145 | closed and/or regulated microblogging platform, getting your status updates | ||
| 3146 | out with twtxt is as easy as putting them in a publicly accessible text file. | ||
| 3147 | The URL pointing to this file is your identity, your account. @code{twtxt} | ||
| 3148 | then tracks these text files, like a feedreader, and builds your unique | ||
| 3149 | timeline out of them, depending on which files you track. The format is | ||
| 3150 | simple, human readable, and integrates well with UNIX command line | ||
| 3151 | utilities.") | ||
| 3152 | (license license:expat))) | ||
| 3153 | |||
| 3112 | (define-public python-zulip | 3154 | (define-public python-zulip |
| 3113 | (package | 3155 | (package |
| 3114 | (name "python-zulip") | 3156 | (name "python-zulip") |
diff --git a/gnu/packages/patches/python-twtxt-replace-pkg-resources.patch b/gnu/packages/patches/python-twtxt-replace-pkg-resources.patch new file mode 100644 index 00000000000..7a7450f84ea --- /dev/null +++ b/gnu/packages/patches/python-twtxt-replace-pkg-resources.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From: Branch Vincent (PR #178, twtxt repository) | ||
| 2 | Date: Apr 21, 2024 | ||
| 3 | Subject: replace pkg_resources for python 3.12 | ||
| 4 | |||
| 5 | * Python 3.12 has removed bundled setuptools (aka pkg_resources): | ||
| 6 | https://docs.python.org/3.12/whatsnew/3.12.html#removed | ||
| 7 | |||
| 8 | --- a/twtxt/helper.py 2026-06-12 23:37:01.869106540 -0300 | ||
| 9 | +++ b/twtxt/helper.py 2026-06-12 23:40:04.335252026 -0300 | ||
| 10 | @@ -14,7 +14,6 @@ | ||
| 11 | import textwrap | ||
| 12 | |||
| 13 | import click | ||
| 14 | -import pkg_resources | ||
| 15 | |||
| 16 | from twtxt.mentions import format_mentions | ||
| 17 | from twtxt.parser import parse_iso8601 | ||
| 18 | @@ -164,11 +163,7 @@ | ||
| 19 | |||
| 20 | |||
| 21 | def generate_user_agent(): | ||
| 22 | - try: | ||
| 23 | - version = pkg_resources.require("twtxt")[0].version | ||
| 24 | - except pkg_resources.DistributionNotFound: | ||
| 25 | - version = "unknown" | ||
| 26 | - | ||
| 27 | + from twtxt import __version__ as version | ||
| 28 | conf = click.get_current_context().obj["conf"] | ||
| 29 | if conf.disclose_identity and conf.nick and conf.twturl: | ||
| 30 | user_agent = "twtxt/{version} (+{url}; @{nick})".format( | ||
