bidiv: build works

This commit is contained in:
Efraim Flashner 2018-12-24 17:24:08 +02:00
parent 4626c4077c
commit 7f59a5c06e
Signed by: efraim
GPG key ID: 41AAE7DCCA3D8351
3 changed files with 81 additions and 15 deletions

View file

@ -8,6 +8,7 @@ addons:
- gnupg wget grep sed - gnupg wget grep sed
env: env:
- FILE=dfsg/main/bidiv.scm
- FILE=dfsg/main/brendan_gregg.scm - FILE=dfsg/main/brendan_gregg.scm
- FILE=dfsg/main/confclerk.scm - FILE=dfsg/main/confclerk.scm
- FILE=dfsg/main/cpuid2cpuflags.scm - FILE=dfsg/main/cpuid2cpuflags.scm

View 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.
--

View file

@ -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. ;;; This file is an addendum to GNU Guix.
;;; ;;;
@ -15,13 +15,13 @@
;;; You should have received a copy of the GNU General Public License ;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. ;;; 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 licenses) #:prefix license:)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (gnu packages fribidi) #:use-module (gnu packages)
#:use-module (gnu packages pkg-config)) #:use-module (gnu packages fribidi))
(define-public bidiv (define-public bidiv
(package (package
@ -34,24 +34,39 @@
version ".orig.tar.gz")) version ".orig.tar.gz"))
(sha256 (sha256
(base32 (base32
"05p5m2ihxbmc1qsgs8rjlww08fy9859fhl7xf196p8g5qygqd7cv")))) "05p5m2ihxbmc1qsgs8rjlww08fy9859fhl7xf196p8g5qygqd7cv"))
(patches (search-patches "bidiv-update-fribidi.patch"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:phases `(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) ; no configure (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 ;; We don't want to use the handwritten makefile
(replace 'build (replace 'build
(lambda* (#:key (make-flags '()) #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(zero? (let ((fribidi (assoc-ref inputs "fribidi")))
(apply system* "gcc" "-o" "bidiv" "bidiv.c" make-flags))))) (invoke "gcc" "-o" "bidiv" "bidiv.c"
#:make-flags (list (string-append "PREFIX=" %output)))) ;; pkg-config --cflags fribidi
(native-inputs (string-append "-I" fribidi "/include/fribidi")
`(("pkg-config" ,pkg-config) ;; pkg-config --libs fribidi
; )) (string-append "-L" fribidi "/lib") "-lfribidi"))))
;(inputs (replace 'install
; `( (lambda* (#:key outputs #:allow-other-keys)
("fribidi" ,fribidi))) (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") (home-page "https://tracker.debian.org/pkg/bidiv")
(synopsis "BiDi viewer - command-line tool displaying logical Hebrew/Arabic") (synopsis "BiDi viewer - command-line tool displaying logical Hebrew/Arabic")
(description "bidiv is a simple utility for converting logical-Hebrew input (description "bidiv is a simple utility for converting logical-Hebrew input