gnu: libchewing: Update to 0.9.0.

* gnu/packages/language.scm (libchewing): Update to 0.9.0.
[build-system]: Switch to cargo-build-system.
[arguments]: Adjust for switch to cargo-build-system.  Enable
parallel-tests.  Add a phase to allow older versions of
rust-clap-mangen.  Add the cmake version of 'configure after 'configure.
Use the cmake versions of 'build, 'check and 'install.
[native-inputs]: Add corrosion, cmake-minimal.  Remove autoconf,
automake, libtool, perl, pkg-config, python-wrapper, texinfo.

Co-authored-by: Charles <charles@charje.net>
Change-Id: Ic11e38646fc47cfc2c575320f43b9355a1c83b39
Signed-off-by: jgart <jgart@dismail.de>
This commit is contained in:
Efraim Flashner 2024-09-29 10:55:04 +03:00 committed by jgart
parent 8ac0b82e35
commit 515c1619cf
No known key found for this signature in database
GPG key ID: A52AA2B477B6DD35

View file

@ -8,6 +8,8 @@
;;; Copyright © 2022 Milran <milranmike@protonmail.com> ;;; Copyright © 2022 Milran <milranmike@protonmail.com>
;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com> ;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
;;; Copyright © 2024 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2024 Charles <charles@charje.net>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -31,6 +33,9 @@
#:use-module (gnu packages audio) #:use-module (gnu packages audio)
#:use-module (gnu packages base) #:use-module (gnu packages base)
#:use-module (gnu packages compression) #:use-module (gnu packages compression)
#:use-module (gnu packages cmake)
#:use-module (gnu packages crates-io)
#:use-module (gnu packages crates-tls)
#:use-module (gnu packages dbm) #:use-module (gnu packages dbm)
#:use-module (gnu packages docbook) #:use-module (gnu packages docbook)
#:use-module (gnu packages emacs) #:use-module (gnu packages emacs)
@ -63,6 +68,7 @@
#:use-module (gnu packages xdisorg) #:use-module (gnu packages xdisorg)
#:use-module (gnu packages xorg) #:use-module (gnu packages xorg)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix build-system cargo)
#:use-module (guix build-system cmake) #:use-module (guix build-system cmake)
#:use-module (guix build-system copy) #:use-module (guix build-system copy)
#:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system glib-or-gtk)
@ -264,55 +270,63 @@ Random Cage Fighting Birds, Cool Music etc.")
(define-public libchewing (define-public libchewing
(package (package
(name "libchewing") (name "libchewing")
(version "0.5.1") (version "0.9.0")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
(uri (uri (git-reference
(git-reference (url "https://github.com/chewing/libchewing")
(url "https://github.com/chewing/libchewing.git") (commit (string-append "v" version))))
(commit (file-name (git-file-name name version))
(string-append "v" version))))
(file-name
(git-file-name name version))
(sha256 (sha256
(base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my")))) (base32 "1n0w9niff46w7vncs699gj4y2xghn1sbl0f4mg5x33dcapqd14sg"))))
(build-system gnu-build-system) (build-system cargo-build-system)
(arguments (arguments
`(;; test-easy-symbol and test-fullshape fail with multiple cores. `(#:modules ((guix build cargo-build-system)
#:parallel-tests? #f (guix build utils)
((guix build cmake-build-system) #:prefix cmake:))
#:imported-modules ((guix build cmake-build-system)
,@%cargo-build-system-modules)
#:install-source? #f
;; Keep the vendor-dir outside of cmake's directories.
#:vendor-dir "../guix-vendor"
#:cargo-inputs
(("rust-anyhow" ,rust-anyhow-1)
("rust-clap" ,rust-clap-4)
("rust-clap-mangen" ,rust-clap-mangen-0.2)
("rust-der" ,rust-der-0.7)
("rust-directories" ,rust-directories-5)
("rust-env-logger" ,rust-env-logger-0.10)
("rust-log" ,rust-log-0.4)
("rust-rusqlite" ,rust-rusqlite-0.29))
#:cargo-development-inputs
(("rust-tempfile" ,rust-tempfile-3))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'disable-failing-tests (add-after 'unpack 'allow-older-version-of-clap-mangen
(lambda _ (lambda _
(substitute* "test/Makefile.am" (substitute* "tools/Cargo.toml"
((" test-bopomofo ") (("0.2.12") "0.2.11"))))
"") (add-after 'configure 'cmake-configure
((" test-config ") (lambda args
"") (apply (assoc-ref cmake:%standard-phases 'configure)
((" test-reset ") ;; For the tests.
"") (append args (list #:out-of-source? #f)))))
((" test-symbol ") (add-after 'unpack 'work-around-genkeystroke
"") (lambda _
((" test-keyboardless ") ;; Remove this phase when we can find ncurses with cmake.
"") (substitute* "tests/CMakeLists.txt"
((" test-special-symbol ") (("CURSES_FOUND") "FALSE"))))
"") (replace 'build
((" test-keyboard ") (assoc-ref cmake:%standard-phases 'build))
"") (replace 'check
((" test-regression ") (lambda* (#:key tests? #:allow-other-keys #:rest args)
"") (when tests?
((" test-userphrase ") ((assoc-ref cmake:%standard-phases 'check)))))
"")) (replace 'install
#t))))) (assoc-ref cmake:%standard-phases 'install)))))
(native-inputs (native-inputs
`(("autoconf" ,autoconf) (list corrosion cmake-minimal))
("automake" ,automake)
("libtool" ,libtool)
("perl" ,perl)
("pkg-config" ,pkg-config)
("python" ,python-wrapper)
("texinfo" ,texinfo)))
(inputs (inputs
(list ncurses sqlite)) (list ncurses sqlite))
(synopsis "Chinese phonetic input method") (synopsis "Chinese phonetic input method")