gnu: translate-shell: Update to 0.9.6.7.

* gnu/packages/patches/translate-shell-fix-curl-tests.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/dictionaries.scm (translate-shell): Update to 0.9.6.7.
[source](patches): Add it.  [home-page]: Append slash.
This commit is contained in:
Oleg Pykhalov 2018-03-25 11:40:44 +03:00
parent e5e5eb1fcf
commit 196c8b3739
No known key found for this signature in database
GPG Key ID: 7246E11C69B79569
3 changed files with 68 additions and 4 deletions

View File

@ -1117,6 +1117,7 @@ dist_patch_DATA = \
%D%/packages/patches/tipp10-fix-compiling.patch \ %D%/packages/patches/tipp10-fix-compiling.patch \
%D%/packages/patches/tipp10-remove-license-code.patch \ %D%/packages/patches/tipp10-remove-license-code.patch \
%D%/packages/patches/tk-find-library.patch \ %D%/packages/patches/tk-find-library.patch \
%D%/packages/patches/translate-shell-fix-curl-tests.patch \
%D%/packages/patches/ttf2eot-cstddef.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \
%D%/packages/patches/ttfautohint-source-date-epoch.patch \ %D%/packages/patches/ttfautohint-source-date-epoch.patch \
%D%/packages/patches/tophat-build-with-later-seqan.patch \ %D%/packages/patches/tophat-build-with-later-seqan.patch \

View File

@ -27,6 +27,7 @@
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (guix build-system trivial) #:use-module (guix build-system trivial)
#:use-module (gnu packages)
#:use-module (gnu packages base) #:use-module (gnu packages base)
#:use-module (gnu packages curl) #:use-module (gnu packages curl)
#:use-module (gnu packages emacs) #:use-module (gnu packages emacs)
@ -239,7 +240,7 @@ and a Python library.")
(define-public translate-shell (define-public translate-shell
(package (package
(name "translate-shell") (name "translate-shell")
(version "0.9.6.4") (version "0.9.6.7")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
@ -247,7 +248,8 @@ and a Python library.")
version ".tar.gz")) version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"1fg6nf1plvgimc57fsdr9rcjbf7jvmk5jrlj5ya509vpdcdgvj2s")) "0inv6r3qbihn2ff1sgcly89r04k4vgcbvvyl50ln0mxlapbhpy95"))
(patches (search-patches "translate-shell-fix-curl-tests.patch"))
(file-name (string-append name "-" version ".tar.gz")))) (file-name (string-append name "-" version ".tar.gz"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
@ -261,7 +263,8 @@ and a Python library.")
(emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs"))) (emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs")))
(install-file "google-translate-mode.el" dest) (install-file "google-translate-mode.el" dest)
(emacs-generate-autoloads ,name dest))))) (emacs-generate-autoloads ,name dest)))))
#:make-flags (list (string-append "PREFIX=" %output)) #:make-flags (list (string-append "PREFIX=" %output)
"NETWORK_ACCESS=no test")
#:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils)) #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils))
#:modules ((guix build gnu-build-system) #:modules ((guix build gnu-build-system)
(guix build emacs-utils) (guix build emacs-utils)
@ -274,7 +277,7 @@ and a Python library.")
(native-inputs (native-inputs
`(("emacs" ,emacs-minimal) `(("emacs" ,emacs-minimal)
("util-linux" ,util-linux))) ; hexdump, for the test ("util-linux" ,util-linux))) ; hexdump, for the test
(home-page "https://www.soimort.org/translate-shell") (home-page "https://www.soimort.org/translate-shell/")
(synopsis "Translations from the command line") (synopsis "Translations from the command line")
(description (description
"Translate Shell (formerly Google Translate CLI) is a command-line "Translate Shell (formerly Google Translate CLI) is a command-line

View File

@ -0,0 +1,60 @@
This patch fixes Curl related tests for 'translate-shell'.
Upstream bug URL:
https://github.com/soimort/translate-shell/issues/221
From bb9f32d3145125ba664b6b05bf0a2fd34108e9d2 Mon Sep 17 00:00:00 2001
From: Mort Yao <soi@mort.ninja>
Date: Sun, 25 Mar 2018 03:14:33 +0200
Subject: [PATCH] TestUtils: perform curl-related tests only if NETWORK_ACCESS
is set to yes (#221)
---
test/TestUtils.awk | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/test/TestUtils.awk b/test/TestUtils.awk
index 08bb2e9..1c141e5 100644
--- a/test/TestUtils.awk
+++ b/test/TestUtils.awk
@@ -30,22 +30,24 @@ BEGIN {
assertTrue(newerVersion("2", "1.9.9999"))
}
- T("curl()", 1)
- {
- delete tokens; delete ast
- tokenize(tokens, curl("https://httpbin.org/get"))
- parseJson(ast, tokens)
- assertEqual(unparameterize(ast[0 SUBSEP "url"]),
- "https://httpbin.org/get")
- }
+ if (yn(ENVIRON["NETWORK_ACCESS"])) { # if network access enabled
+ T("curl()", 1)
+ {
+ delete tokens; delete ast
+ tokenize(tokens, curl("https://httpbin.org/get"))
+ parseJson(ast, tokens)
+ assertEqual(unparameterize(ast[0 SUBSEP "url"]),
+ "https://httpbin.org/get")
+ }
- T("curlPost()", 1)
- {
- delete tokens; delete ast
- tokenize(tokens, curlPost("https://httpbin.org/post", "fizz=buzz"))
- parseJson(ast, tokens)
- assertEqual(unparameterize(ast[0 SUBSEP "url"]),
- "https://httpbin.org/post")
+ T("curlPost()", 1)
+ {
+ delete tokens; delete ast
+ tokenize(tokens, curlPost("https://httpbin.org/post", "fizz=buzz"))
+ parseJson(ast, tokens)
+ assertEqual(unparameterize(ast[0 SUBSEP "url"]),
+ "https://httpbin.org/post")
+ }
}
T("dump()", 3)