projects/guix·blob kernel-updates · refs

250 lines · 9.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Cyril Roelandt <[email protected]>
3;;; Copyright © 2016, 2019 Efraim Flashner <[email protected]>
4;;; Copyright © 2018, 2022 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2024 Sharlatan Hellseher <[email protected]>
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages iso-codes)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix gexp)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system pyproject)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages gettext)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages python)
34 #:use-module (gnu packages python-build)
35 #:use-module (gnu packages python-science))
36
37(define-public iso-codes/official
38 ;; This package variant is intended for ‘external’ use, such as users running
39 ;; ‘guix install’, where any deviation from ISO gospel might be harmful.
40 (package
41 (name "iso-codes")
42 (version "4.5.0")
43 (home-page "https://salsa.debian.org/iso-codes-team/iso-codes")
44 (source (origin
45 (method git-fetch)
46 (uri (git-reference
47 (url home-page)
48 (commit (string-append "iso-codes-" version))))
49 (file-name (git-file-name name version))
50 (sha256
51 (base32
52 "1q6x9c5x4x0x4q11iygldsmxdyzhz1mb4n8im76glwsgqsqyjs80"))))
53 (build-system gnu-build-system)
54 (native-inputs
55 (list gettext-minimal perl python-wrapper))
56 (synopsis "Various ISO standards")
57 (description
58 "This package provides lists of various ISO standards (e.g. country,
59language, language scripts, and currency names) in one place, rather
60than repeated in many programs throughout the system.
61
62Currently there are lists of languages and countries embedded in
63several different programs, which leads to dozens of lists of
64200 languages, translated into more than 30 languages... not
65very efficient.
66
67With this package, we create a single \"gettext domain\" for every
68supported ISO standard which contains the translations of
69that domain. It is easy for a programmer to re-use those
70translations instead of maintaining their own translation
71infrastructure. Moreover, the programmer does not need to follow
72changes in the ISO standard and will not work with outdated
73information.")
74 (license license:gpl2+))) ; some bits use the lgpl2
75
76(define-public iso-codes/pinned
77 ;; This package should be used universally within Guix, e.g., as an input to
78 ;; other Guix packages or in the Guix System installer's country selector.
79 (hidden-package
80 (package
81 (inherit iso-codes/official)
82 (source
83 (origin
84 (inherit (package-source iso-codes/official))
85 (modules '((guix build utils)))
86 (snippet
87 '(begin
88 (substitute* (find-files "." "\\.po$")
89 (("#.*Name for TWN,.*") "")
90 (("^msgid \"Taiwan, .*") "# Guix doesn't use "))
91 (substitute* "data/iso_3166-1.json"
92 (("(Taiwan), [^\"]*" _ name) name))))))
93 (synopsis "Various ISO standards as used by GNU@tie{}Guix"))))
94
95(define-public iso-codes
96 (package
97 (inherit iso-codes/pinned)
98 (version "4.17.0")
99 (source (origin
100 (inherit (package-source iso-codes/pinned))
101 (uri (git-reference
102 (url (package-home-page iso-codes/pinned))
103 (commit (string-append "v" version))))
104 (file-name (git-file-name (package-name iso-codes/pinned) version))
105 (sha256
106 (base32
107 "0a77b9aid68vakhsa3l3lx2jav5q9fp7vn50mwmzkr2lkr2l4k41"))))))
108
109(define-public python-country-converter
110 (package
111 (name "python-country-converter")
112 (version "1.3.2")
113 (source
114 (origin
115 (method git-fetch)
116 (uri (git-reference
117 (url "https://github.com/IndEcol/country_converter")
118 (commit (string-append "v" version))))
119 (file-name (git-file-name name version))
120 (sha256
121 (base32 "0hmz6ihh0lr8a98fvacc1xpg1zgwx7y02sbn0xi2sh5lg6qrqyap"))))
122 (build-system pyproject-build-system)
123 (native-inputs
124 (list python-pytest
125 python-setuptools))
126 (propagated-inputs
127 (list python-pandas))
128 (home-page "https://github.com/IndEcol/country_converter")
129 (synopsis "Auto conversion from different country name standards")
130 (description
131 "The country converter (coco) automates the conversion from different
132standards and version of country names. Internally, coco is based on a table
133specifying the different ISO and UN standards per country together with the
134official name and a regular expression which aim to match all English versions
135of a specific country name. In addition, coco includes classification based
136on UN-, EU-, OECD-membership, UN regions specifications, continents and
137various MRIO and IAM databases.
138
139Supported classification schemas: APEC, BASIC, BRIC, CC41, CIS, Cecilia 2050
140classification, DACcode, EEA membership, EU membership, EXIOBASE 1
141classification, EXIOBASE 2 classification, EXIOBASE 3 classification, Eora,
142FAOcode, G20, G7, GBDcode, GWcode, IEA, IMAGE, IOC ISO 3166-1 alpha-2, ISO
1433166-1 alpha-3, ISO 3166-1 numeric, MESSAGE 11-region classification, OECD
144membership, REMIND, Schengen region, UN membership, UN numeric code, UN
145region, WIOD classification, ccTLD.")
146 (license license:gpl3)))
147
148(define-public python-iso639
149 (package
150 (name "python-iso639")
151 (version "0.4.5")
152 (source
153 (origin
154 (method git-fetch)
155 (uri (git-reference
156 (url "https://github.com/noumar/iso639")
157 (commit version)))
158 (file-name (git-file-name name version))
159 (sha256
160 (base32 "02kx6kr3x43linxqafjlx85zdk04s6ab2fv5ikyglghwr5hsvic4"))))
161 (build-system pyproject-build-system)
162 (arguments
163 (list
164 #:test-flags
165 #~(list "tests/tests.py"
166 "-k" (string-join
167 (list
168 ;; module 'collections' has no attribute 'Iterable'
169 "not test_iter"
170 ;; 'Moroccan Arabic' != 'Arabic'
171 "test_logic_part2"
172 ;; 'Languages' object has no attribute 'indices'
173 "test_compare_alpha2"
174 "test_compare_bibliographic"
175 "test_compare_terminology")
176 " and not "))
177 #:phases
178 #~(modify-phases %standard-phases
179 (add-before 'check 'configure-tests
180 (lambda _
181 (setenv "PYTHONPATH"
182 (string-append (getcwd) ":"
183 (getenv "GUIX_PYTHONPATH"))))))))
184 (native-inputs (list python-pycountry python-pytest python-setuptools))
185 (home-page "https://github.com/noumar/iso639")
186 (synopsis "Python library for ISO 639 standard")
187 (description
188 "This package provides a Python library for ISO 639 standard that is
189concerned with representation of names for languages and language groups.")
190 (license license:agpl3+)))
191
192(define-public python-iso3166
193 (package
194 (name "python-iso3166")
195 (version "2.1.1")
196 (source
197 (origin
198 (method git-fetch)
199 (uri (git-reference
200 (url "https://github.com/deactivated/python-iso3166")
201 (commit (string-append "v" version))))
202 (file-name (git-file-name name version))
203 (sha256
204 (base32 "0j0bnm4bd23cyb7dga00gb20myg9skylchkw4d23yh31b7a315m8"))))
205 (build-system pyproject-build-system)
206 (native-inputs (list python-pytest python-setuptools))
207 (home-page "https://github.com/deactivated/python-iso3166")
208 (synopsis "Self-contained ISO 3166-1 country definitions")
209 (description "This package provides the ISO 3166-1 country definitions.")
210 (license license:expat)))
211
212(define-public python-pycountry
213 (package
214 (name "python-pycountry")
215 (version "24.6.1")
216 (source
217 (origin
218 (method git-fetch)
219 (uri (git-reference
220 (url "https://github.com/pycountry/pycountry")
221 (commit version)))
222 (file-name (git-file-name name version))
223 (sha256
224 (base32 "0qs99acz1vsj96s8pcwbnp3z3s01mzzvdayk7fm0nnl6lf3lz1g1"))))
225 (build-system pyproject-build-system)
226 (arguments
227 (list
228 #:phases
229 #~(modify-phases %standard-phases
230 (add-after 'unpack 'fix-pytest-config
231 (lambda _ ; Removes the need for python-pytest-cov.
232 (substitute* "pyproject.toml"
233 (("^required_plugins =.*")
234 "")))))))
235 (native-inputs (list python-poetry-core python-pytest))
236 (home-page "https://github.com/pycountry/pycountry")
237 (synopsis "ISO databases for languages, countries, currencies, etc.")
238 (description
239 "@code{pycountry} provides the ISO databases for the standards:
240@enumerate
241@item 639-3 (Languages)
242@item 3166 (Countries)
243@item 3166-3 (Deleted Countries)
244@item 3166-2 (Subdivisions of countries)
245@item 4217 (Currencies)
246@item 15924 (Scripts)
247@end enumerate
248It includes a copy from Debian’s pkg-isocodes and makes the data accessible
249through a Python API.")
250 (license license:lgpl2.1+)))