projects/guix·blob python-team · refs

162 lines · 7.0 KiB

1;;; GNU Guix --- GNU Taler components and extension
2;;; Copyright © 2026 Maxim Cournoyer <[email protected]>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages taler)
20 #:use-module (gnu packages guile)
21 #:use-module (gnu packages python)
22 #:use-module (gnu packages sphinx)
23 #:use-module (gnu packages texinfo)
24 #:use-module (gnu packages web)
25 #:use-module (gnu packages xml)
26 #:use-module (guix gexp)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix git-download)
30 #:use-module (guix build-system cargo)
31 #:use-module (guix build-system gnu))
32
33(define-public robocop
34 (package
35 (name "robocop")
36 (version "1.6.1")
37 (source (origin
38 (method git-fetch)
39 (uri (git-reference
40 (url "git://git.taler.net/robocop.git")
41 (commit (string-append "v" version))))
42 (file-name (git-file-name name version))
43 (sha256
44 (base32
45 "09javwf0izasfa2480wp5x1rq64n9aqacnxrd7d2izd4rchb6hl6"))))
46 (build-system cargo-build-system)
47 (arguments
48 (list
49 #:install-source? #f
50 #:phases
51 #~(modify-phases %standard-phases
52 (add-after 'unpack 'patch-commands
53 (lambda* (#:key inputs #:allow-other-keys)
54 (substitute* "robocop-json-postprocess"
55 (("exec jq")
56 (string-append "exec " (search-input-file inputs "bin/jq"))))))
57 (add-after 'install 'install-doc
58 (lambda* (#:key native-inputs inputs #:allow-other-keys)
59 (install-file (search-input-file (or native-inputs inputs)
60 "share/man/robocop.1.zst")
61 (string-append #$output "/share/man"))))
62 (add-after 'install 'install-extra-scripts
63 (lambda _
64 (for-each (lambda (x)
65 (install-file x (string-append #$output "/bin")))
66 (list "robocop-ch-to-json"
67 "robocop-eu-to-json"
68 "robocop-un-to-json"
69 "robocop-ofac-to-json"
70 "robocop-uk-to-json"
71 "robocop-json-postprocess"))))
72 (add-after 'install-extra-scripts 'wrap-python-path
73 (lambda* (#:key outputs #:allow-other-keys)
74 (for-each (lambda (x)
75 (wrap-script (search-input-file
76 outputs (string-append "bin/" x))
77 `("GUIX_PYTHONPATH" prefix
78 (,(getenv "GUIX_PYTHONPATH")))))
79 ;; All these are Python scripts that depend on the
80 ;; lxml library.
81 (list "robocop-ch-to-json"
82 "robocop-eu-to-json"
83 "robocop-un-to-json"
84 "robocop-ofac-to-json"
85 "robocop-uk-to-json")))))))
86 (native-inputs (list taler-docs))
87 (inputs (cons* jq
88 guile-3.0 ;for wrap-script
89 python
90 python-lxml
91 (cargo-inputs 'robocop)))
92 (home-page "https://www.taler.net/")
93 (synopsis "@acronym{CTF, Counter Terrorist Financing} sanction \
94processing tool")
95 (description "Robocop is a @acronym{CTF, Counter Terrorist Financing}
96sanction processing tool. It can be used for compliance processes in software
97such as @url{https://taler.net, GNU Taler}.")
98 (license license:gpl3+)))
99
100(define-public taler-docs
101 ;; No tag or commit; use the latest commit.
102 (let ((commit "7944885e71fbf970d21e0d9f4fe88dcc08146457")
103 (revision "1"))
104 (package
105 (name "taler-docs")
106 (version (git-version "0.0.0" revision commit))
107 (source (origin
108 (method git-fetch)
109 (uri (git-reference
110 (url "git://git.taler.net/taler-docs.git")
111 (commit commit)))
112 (file-name (git-file-name name version))
113 (sha256
114 (base32
115 "1bn9594qh8p88llglgvr71qwl27i8c5sjx0b49wsjfz93d9d0bsa"))
116 (modules '((guix build utils)))
117 (snippet
118 #~(begin
119 ;; Delete 3rd party bundled Sphinx extensions.
120 (delete-all-but "_exts"
121 ;; These are custom extensions.
122 "ebicsdomain.py"
123 "typescriptdomain.py")
124 (substitute* "conf.py"
125 (("httpdomain.httpdomain")
126 "sphinxcontrib.httpdomain"))))))
127 (build-system gnu-build-system)
128 (arguments
129 (list
130 #:tests? #f ;no tests
131 #:make-flags #~(list "info" "man")
132 #:phases
133 #~(modify-phases %standard-phases
134 (delete 'configure) ;no configure phase
135 (replace 'install
136 (lambda _
137 ;; Take care to install the man pages before re-running make
138 ;; below again; it appears to remove some of the manpages like
139 ;; 'depolymerizer-bitcoin.1' otherwise.
140 (let ((mandir (string-append #$output "/share/man")))
141 (mkdir-p mandir)
142 (copy-recursively "_build/man" mandir))
143 (invoke "make" "-C" "_build/texinfo"
144 "install-info" (string-append "infodir=" #$output
145 "/share/info")))))))
146 (native-inputs
147 (list python-minimal
148 python-myst-parser
149 python-sphinx
150 python-sphinx-design
151 python-sphinx-multitoc-numbering
152 python-sphinx-plantuml
153 python-sphinxcontrib-httpdomain
154 python-sphinxcontrib-mermaid
155 texinfo))
156 (home-page "https://www.taler.net/")
157 (synopsis "Documentation of the GNU Taler project")
158 (description "This package includes the complete documentation of all
159the GNU Taler components, as Texinfo manuals and man pages.")
160 ;; The source headers say AGPL 2.1+, which is odd since there isn't an
161 ;; AGPL 2.1 version (see: <https://bugs.gnunet.org/view.php?id=11573>).
162 (license license:agpl3+))))