bidiv: build works
This commit is contained in:
parent
4626c4077c
commit
7f59a5c06e
3 changed files with 81 additions and 15 deletions
|
@ -8,6 +8,7 @@ addons:
|
|||
- gnupg wget grep sed
|
||||
|
||||
env:
|
||||
- FILE=dfsg/main/bidiv.scm
|
||||
- FILE=dfsg/main/brendan_gregg.scm
|
||||
- FILE=dfsg/main/confclerk.scm
|
||||
- FILE=dfsg/main/cpuid2cpuflags.scm
|
||||
|
|
50
bidiv-update-fribidi.patch
Normal file
50
bidiv-update-fribidi.patch
Normal file
|
@ -0,0 +1,50 @@
|
|||
https://sources.debian.org/data/main/b/bidiv/1.5-6/debian/patches/fribidi_019
|
||||
|
||||
Description: Fix building with fribidi 1.9
|
||||
Author: أحمد المحمودي <aelmahmoudy@users.sourceforge.net>
|
||||
Bug-Debian: http://bugs.debian.org/568130
|
||||
|
||||
--- a/bidiv.c
|
||||
+++ b/bidiv.c
|
||||
@@ -141,8 +141,9 @@ bidiv(FILE *fp)
|
||||
*/
|
||||
if(c1<0x80||c1>0xbf){
|
||||
ungetc(c1, fp);
|
||||
- unicode_in[len]=
|
||||
- fribidi_iso8859_8_to_unicode_c(c);
|
||||
+ fribidi_charset_to_unicode(
|
||||
+ FRIBIDI_CHAR_SET_ISO8859_8,
|
||||
+ &c, 1, &unicode_in[len]);
|
||||
} else
|
||||
unicode_in[len]=((c & 037) << 6) + (c1 & 077);
|
||||
newline=0;
|
||||
@@ -153,8 +154,9 @@ bidiv(FILE *fp)
|
||||
In the future we will have a language
|
||||
option, which will control this (as well
|
||||
as the output encoding). */
|
||||
- unicode_in[len]=
|
||||
- fribidi_iso8859_8_to_unicode_c(c);
|
||||
+ fribidi_charset_to_unicode(
|
||||
+ FRIBIDI_CHAR_SET_ISO8859_8,
|
||||
+ &c, 1, &unicode_in[len]);
|
||||
#else
|
||||
in[len]=c;
|
||||
#endif
|
||||
@@ -206,11 +208,11 @@ bidiv(FILE *fp)
|
||||
rtl_line=0;
|
||||
|
||||
if(out_utf8)
|
||||
- fribidi_unicode_to_utf8(unicode_out, len,
|
||||
- out);
|
||||
+ fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8,
|
||||
+ unicode_out, len, out);
|
||||
else
|
||||
- fribidi_unicode_to_iso8859_8(unicode_out, len,
|
||||
- out);
|
||||
+ fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_ISO8859_8,
|
||||
+ unicode_out, len, out);
|
||||
/* if rtl_line (i.e., base_dir is RL), and we didn't fill the
|
||||
entire width, we need to pad with spaces. Maybe in the
|
||||
future this should be an option.
|
||||
--
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;;
|
||||
;;; This file is an addendum to GNU Guix.
|
||||
;;;
|
||||
|
@ -15,13 +15,13 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (wip bidiv)
|
||||
(define-module (dfsg main bidiv)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (gnu packages fribidi)
|
||||
#:use-module (gnu packages pkg-config))
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages fribidi))
|
||||
|
||||
(define-public bidiv
|
||||
(package
|
||||
|
@ -34,24 +34,39 @@
|
|||
version ".orig.tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"05p5m2ihxbmc1qsgs8rjlww08fy9859fhl7xf196p8g5qygqd7cv"))))
|
||||
"05p5m2ihxbmc1qsgs8rjlww08fy9859fhl7xf196p8g5qygqd7cv"))
|
||||
(patches (search-patches "bidiv-update-fribidi.patch"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(delete 'configure) ; no configure
|
||||
(add-after 'unpack 'misc-fixes
|
||||
(lambda _
|
||||
(substitute* "bidiv.c"
|
||||
(("FriBidiCharType") "FriBidiParType")
|
||||
(("&c") "(char *)&c"))
|
||||
#t))
|
||||
;; We don't want to use the handwritten makefile
|
||||
(replace 'build
|
||||
(lambda* (#:key (make-flags '()) #:allow-other-keys)
|
||||
(zero?
|
||||
(apply system* "gcc" "-o" "bidiv" "bidiv.c" make-flags)))))
|
||||
#:make-flags (list (string-append "PREFIX=" %output))))
|
||||
(native-inputs
|
||||
`(("pkg-config" ,pkg-config)
|
||||
; ))
|
||||
;(inputs
|
||||
; `(
|
||||
("fribidi" ,fribidi)))
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(let ((fribidi (assoc-ref inputs "fribidi")))
|
||||
(invoke "gcc" "-o" "bidiv" "bidiv.c"
|
||||
;; pkg-config --cflags fribidi
|
||||
(string-append "-I" fribidi "/include/fribidi")
|
||||
;; pkg-config --libs fribidi
|
||||
(string-append "-L" fribidi "/lib") "-lfribidi"))))
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(bin (string-append out "/bin"))
|
||||
(man (string-append out "/share/man/man1")))
|
||||
(install-file "bidiv" bin)
|
||||
(install-file "bidiv.1" man))
|
||||
#t)))
|
||||
#:tests? #f)) ; no tests
|
||||
(inputs
|
||||
`(("fribidi" ,fribidi)))
|
||||
(home-page "https://tracker.debian.org/pkg/bidiv")
|
||||
(synopsis "BiDi viewer - command-line tool displaying logical Hebrew/Arabic")
|
||||
(description "bidiv is a simple utility for converting logical-Hebrew input
|
Loading…
Reference in a new issue