unicode.scm 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2020 Liliana Marie Prikler <liliana.prikler@gmail.com>
  3. ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
  4. ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
  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. (define-module (gnu packages unicode)
  21. #:use-module (gnu packages autotools)
  22. #:use-module (guix git-download)
  23. #:use-module (guix licenses)
  24. #:use-module (guix packages)
  25. #:use-module (guix download)
  26. #:use-module (guix utils)
  27. #:use-module (guix build-system copy)
  28. #:use-module (guix build-system gnu)
  29. #:use-module (guix build-system trivial))
  30. (define-public libunibreak
  31. (package
  32. (name "libunibreak")
  33. (version "5.0")
  34. (source (origin
  35. (method git-fetch)
  36. (uri (git-reference
  37. (url "https://github.com/adah1972/libunibreak")
  38. (commit (string-append "libunibreak_"
  39. (string-replace-substring version "." "_")))))
  40. (file-name (git-file-name name version))
  41. (sha256
  42. (base32
  43. "0r5dndhwsiy65lmavz3vdgal9nl8g97hbmdjg6zyq3zh5hs87vwf"))))
  44. (build-system gnu-build-system)
  45. (native-inputs
  46. (list autoconf-wrapper
  47. automake
  48. libtool
  49. ucd-next ; required for tests
  50. ))
  51. (arguments
  52. `(#:parallel-tests? #f ; parallel tests cause non-deterministic
  53. ; build failures
  54. #:phases
  55. (modify-phases %standard-phases
  56. (add-before 'check 'pre-check
  57. (lambda* (#:key inputs #:allow-other-keys)
  58. (for-each (lambda (file)
  59. (copy-file
  60. (search-input-file inputs
  61. (string-append "/share/ucd/auxiliary/"
  62. file))
  63. (string-append "src/" file)))
  64. '("LineBreakTest.txt"
  65. "WordBreakTest.txt"
  66. "GraphemeBreakTest.txt")))))))
  67. (home-page "http://vimgadgets.sourceforge.net/libunibreak/")
  68. (synopsis "Unicode line breaking and word breaking algorithms")
  69. (description
  70. "Libunibreak is an implementation of the line breaking and word
  71. breaking algorithms as described in Unicode Standard Annex 14 and
  72. Unicode Standard Annex 29. It is designed to be used in a generic text
  73. renderer.")
  74. (license zlib)))
  75. (define-public ucd
  76. (package
  77. (name "ucd")
  78. (version "12.0.0")
  79. (source
  80. (origin
  81. (method url-fetch/zipbomb)
  82. (uri (string-append "https://www.unicode.org/Public/zipped/" version
  83. "/UCD.zip"))
  84. (sha256
  85. (base32
  86. "1ighy39cjkmqnv1797wrxjz76mv1fdw7zp5j04q55bkwxsdkvrmh"))))
  87. (build-system copy-build-system)
  88. (arguments
  89. '(#:install-plan
  90. '(("." "share/ucd/"))))
  91. (home-page "https://www.unicode.org")
  92. (synopsis "Unicode Character Database")
  93. (description
  94. "The @dfn{Unicode Character Database} (UCD) consists of a number of data
  95. files listing Unicode character properties and related data. It also includes
  96. test data for conformance to several important Unicode algorithms.")
  97. (license unicode)))
  98. (define-public ucd-next
  99. (package
  100. (inherit ucd)
  101. (name "ucd-next")
  102. (version "14.0.0")
  103. (source
  104. (origin
  105. (method url-fetch/zipbomb)
  106. (uri (string-append "https://www.unicode.org/Public/zipped/" version
  107. "/UCD.zip"))
  108. (sha256
  109. (base32
  110. "001nq9w52ijma0vps40xwy2q6ylpyf1393lzb128ibypnmv54fh3"))))))
  111. (define (unicode-emoji-file name version hash)
  112. (origin
  113. (method url-fetch)
  114. (uri (string-append "https://www.unicode.org/Public/emoji/"
  115. version
  116. "/emoji-" name ".txt"))
  117. (sha256 (base32 hash))))
  118. (define-public unicode-emoji
  119. (package
  120. (name "unicode-emoji")
  121. (version "12.0")
  122. (source #f)
  123. (build-system trivial-build-system)
  124. (arguments
  125. `(#:modules ((guix build utils))
  126. #:builder
  127. (let ((out (string-append %output "/share/unicode/emoji")))
  128. (use-modules (guix build utils))
  129. (mkdir-p out)
  130. (for-each
  131. (lambda (input)
  132. (copy-file
  133. (cdr input)
  134. (string-append out "/"
  135. (substring (car input) 8) ; strip "unicode-"
  136. ".txt")))
  137. %build-inputs)
  138. #t)))
  139. (inputs
  140. `(("unicode-emoji-data"
  141. ,(unicode-emoji-file
  142. "data" version
  143. "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv"))
  144. ("unicode-emoji-sequences"
  145. ,(unicode-emoji-file
  146. "sequences" version
  147. "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs"))
  148. ("unicode-emoji-test"
  149. ,(unicode-emoji-file
  150. "test" version
  151. "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck"))
  152. ("unicode-emoji-variation-sequences"
  153. ,(unicode-emoji-file
  154. "variation-sequences" version
  155. "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a"))
  156. ("unicode-emoji-zwj-sequences"
  157. ,(unicode-emoji-file
  158. "zwj-sequences" version
  159. "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n"))))
  160. (home-page "https://www.unicode.org")
  161. (synopsis "Unicode Emoji data")
  162. (description
  163. "This package includes data files listing characters and sequences, that
  164. Unicode emoji supporting fonts or keyboards should support according to the
  165. Unicode Technological Standard #51.")
  166. (license unicode)))
  167. (define-public unicode-cldr-common
  168. (package
  169. (name "unicode-cldr-common")
  170. (version "36.0")
  171. (source
  172. (origin
  173. (method url-fetch/zipbomb)
  174. (uri (string-append "https://unicode.org/Public/cldr/"
  175. (version-major version)
  176. "/cldr-common-" version ".zip"))
  177. (sha256
  178. (base32
  179. "0hxsc3j5zb32hmiaj0r3ajchmklx6zng6zlh1ca6s9plq5b9w9q7"))))
  180. (build-system copy-build-system)
  181. (arguments
  182. '(#:install-plan
  183. '(("common" "share/unicode/cldr/"))))
  184. (home-page "https://www.unicode.org")
  185. (synopsis "Locale data repository")
  186. (description
  187. "The Unicode Common Locale Data Repository (CLDR) is a large repository
  188. of locale data, including among others
  189. @itemize
  190. @item patterns for formatting and parsing,
  191. @item name translations,
  192. @item and various information on languages, scripts and country-specific
  193. conventions.
  194. @end itemize\n")
  195. (license unicode)))