gnu: emacs-helm: Update to 3.8.7.
[jackhill/guix/guix.git] / gnu / packages / iso-codes.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2018, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
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 iso-codes)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system python)
28 #:use-module (gnu packages gettext)
29 #:use-module (gnu packages perl)
30 #:use-module (gnu packages python))
31
32 (define-public iso-codes/official
33 ;; This package variant is intended for ‘external’ use, such as users running
34 ;; ‘guix install’, where any deviation from ISO gospel might be harmful.
35 (package
36 (name "iso-codes")
37 (version "4.5.0")
38 (home-page "https://salsa.debian.org/iso-codes-team/iso-codes")
39 (source (origin
40 (method git-fetch)
41 (uri (git-reference
42 (url home-page)
43 (commit (string-append "iso-codes-" version))))
44 (file-name (git-file-name name version))
45 (sha256
46 (base32
47 "1q6x9c5x4x0x4q11iygldsmxdyzhz1mb4n8im76glwsgqsqyjs80"))))
48 (build-system gnu-build-system)
49 ;; TODO(staging): Unconditionally move inputs to native-inputs.
50 (native-inputs
51 (if (%current-target-system)
52 `(("python" ,python-wrapper)
53 ("perl" ,perl)
54 ("gettext" ,gettext-minimal))
55 '()))
56 (inputs
57 `(,@(if (%current-target-system)
58 '()
59 `(("gettext" ,gettext-minimal)
60 ("perl" ,perl)
61 ("python" ,python-wrapper)))))
62 (synopsis "Various ISO standards")
63 (description
64 "This package provides lists of various ISO standards (e.g. country,
65 language, language scripts, and currency names) in one place, rather
66 than repeated in many programs throughout the system.
67
68 Currently there are lists of languages and countries embedded in
69 several different programs, which leads to dozens of lists of
70 200 languages, translated into more than 30 languages... not
71 very efficient.
72
73 With this package, we create a single \"gettext domain\" for every
74 supported ISO standard which contains the translations of
75 that domain. It is easy for a programmer to re-use those
76 translations instead of maintaining their own translation
77 infrastructure. Moreover, the programmer does not need to follow
78 changes in the ISO standard and will not work with outdated
79 information.")
80 (license license:gpl2+))) ; some bits use the lgpl2
81
82 (define-public iso-codes
83 ;; This package should be used universally within Guix, e.g., as an input to
84 ;; other Guix packages or in the Guix System installer's country selector.
85 (hidden-package
86 (package
87 (inherit iso-codes/official)
88 (source
89 (origin
90 (inherit (package-source iso-codes/official))
91 (modules '((guix build utils)))
92 (snippet
93 '(begin
94 (substitute* (find-files "." "\\.po$")
95 (("#.*Name for TWN,.*") "")
96 (("^msgid \"Taiwan, .*") "# Guix doesn't use "))
97 (substitute* "data/iso_3166-1.json"
98 (("(Taiwan), [^\"]*" _ name) name))))))
99 (synopsis "Various ISO standards as used by GNU@tie{}Guix"))))
100
101 (define-public python-iso639
102 (package
103 (name "python-iso639")
104 (version "0.4.5")
105 (source
106 (origin
107 (method url-fetch)
108 (uri (pypi-uri "iso-639" version))
109 (sha256
110 (base32
111 "0jffmh4m20q8j27xb2fqbnlghjj0cx8pgsbzqisdg65qh2wd976w"))))
112 (build-system python-build-system)
113 (home-page "https://github.com/noumar/iso639")
114 (synopsis "Python library for ISO 639 standard")
115 (description "This package provides a Python library for ISO 639 standard
116 that is concerned with representation of names for languages and language
117 groups.")
118 (license license:agpl3+)))
119
120 (define-public python-iso3166
121 (package
122 (name "python-iso3166")
123 (version "0.9")
124 (source
125 (origin
126 (method url-fetch)
127 (uri (pypi-uri "iso3166" version))
128 (sha256
129 (base32
130 "0hm0xm30sprk1jssmn4cqks0x3nx5fp8r5ypvahcysmmayzrsnjl"))))
131 (build-system python-build-system)
132 (home-page "https://github.com/deactivated/python-iso3166")
133 (synopsis "Self-contained ISO 3166-1 country definitions")
134 (description "This package provides the ISO 3166-1 country definitions.")
135 (license license:expat)))