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