fribidi.scm 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014 Marek Benc <merkur32@gmail.com>
  3. ;;; Copyright © 2016, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
  4. ;;; Copyright © 2018 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. (define-module (gnu packages fribidi)
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix build-system gnu)
  24. #:use-module (guix licenses)
  25. #:use-module (gnu packages))
  26. (define-public fribidi
  27. (package
  28. (name "fribidi")
  29. (version "1.0.9")
  30. (source
  31. (origin
  32. (method url-fetch)
  33. (uri
  34. (string-append "https://github.com/fribidi/fribidi/releases"
  35. "/download/v" version "/fribidi-" version
  36. ".tar.xz"))
  37. (sha256
  38. (base32 "1iz06r6ha2nrgbzbn4141r58a60a9s5qiaadjjhhvdkg0alpxr65"))))
  39. (build-system gnu-build-system)
  40. (synopsis "Implementation of the Unicode bidirectional algorithm")
  41. (description
  42. "GNU FriBidi is an implementation of the Unicode Bidirectional
  43. Algorithm. This algorithm is used to properly display text in left-to-right
  44. or right-to-left ordering as necessary.")
  45. (home-page "https://github.com/fribidi/fribidi")
  46. (license lgpl2.1+)))
  47. (define-public bidiv
  48. (package
  49. (name "bidiv")
  50. (version "1.5")
  51. (source
  52. (origin
  53. (method url-fetch)
  54. (uri (string-append "mirror://debian/pool/main/b/bidiv/bidiv_"
  55. version ".orig.tar.gz"))
  56. (sha256
  57. (base32
  58. "05p5m2ihxbmc1qsgs8rjlww08fy9859fhl7xf196p8g5qygqd7cv"))
  59. (patches (search-patches "bidiv-update-fribidi.patch"))))
  60. (build-system gnu-build-system)
  61. (arguments
  62. `(#:phases
  63. (modify-phases %standard-phases
  64. (delete 'configure) ; no configure
  65. (add-after 'unpack 'misc-fixes
  66. (lambda _
  67. (substitute* "bidiv.c"
  68. (("FriBidiCharType") "FriBidiParType")
  69. (("&c") "(char *)&c"))
  70. #t))
  71. ;; We don't want to use the handwritten makefile
  72. (replace 'build
  73. (lambda* (#:key inputs #:allow-other-keys)
  74. (let ((fribidi (assoc-ref inputs "fribidi")))
  75. (invoke "gcc" "-o" "bidiv" "bidiv.c"
  76. ;; pkg-config --cflags fribidi
  77. (string-append "-I" fribidi "/include/fribidi")
  78. ;; pkg-config --libs fribidi
  79. (string-append "-L" fribidi "/lib") "-lfribidi"))))
  80. (replace 'install
  81. (lambda* (#:key outputs #:allow-other-keys)
  82. (let* ((out (assoc-ref outputs "out"))
  83. (bin (string-append out "/bin"))
  84. (man (string-append out "/share/man/man1")))
  85. (install-file "bidiv" bin)
  86. (install-file "bidiv.1" man))
  87. #t)))
  88. #:tests? #f)) ; no tests
  89. (inputs
  90. `(("fribidi" ,fribidi)))
  91. (home-page "https://tracker.debian.org/pkg/bidiv")
  92. (synopsis "BiDi viewer - command-line tool displaying logical Hebrew/Arabic")
  93. (description "bidiv is a simple utility for converting logical-Hebrew input
  94. to visual-Hebrew output. This is useful for reading Hebrew mail messages,
  95. viewing Hebrew texts, etc. It was written for Hebrew but Arabic (or other BiDi
  96. languages) should work equally well.")
  97. (license gpl2+)))