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