guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packaging


From: Tobias Geerinckx-Rice
Subject: Re: Packaging
Date: Sat, 06 Mar 2021 15:40:18 +0100

Mecqor, Guix,

mecqor labi 写道:
Please package (Dialect <https://github.com/gi-lom/dialect>) for Guix;

Guix is run by volunteers who don't tend to package software on demand. The best way to see something added to Guix is to package it yourself and submit it to guix-patches at gnu.org.

Getting into packaging is easier than most people think. We try to be as responsive and helpful as possible, either via e-mail at help-guix at gnu.org, or on the Freenode IRC network's #guix channel.

That said: I packaged this programme back in January. I never submitted it to Guix because it quickly became obvious that it's harmful.

Dialect is not a ‘translation app’ at all but simply replaces the HTML text field at translate.google.com with a GTK-native one. In fact it was already rendered useless by a Google API change that requires shipping an alpha release of a library.

I won't rehash the FSF's excellent article[0] about such ‘fake software’ here, but I will attach the patches. Because if this *is* added to Guix, I'd very much like my warnings to be included in the description.

Related: <http://issues.guix.gnu.org/46385>.

Kind regards,

T G-R

[0]: https://www.gnu.org/philosophy/who-does-that-server-really-serve.html

From b2112ac230a17d6ae1a350145d50a31a715167b9 Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sun, 3 Jan 2021 15:09:30 +0100
Subject: [PATCH 1/3] gnu: Add python-gtts.

* gnu/packages/python-web.scm (python-gtts): New public variable.
---
 gnu/packages/python-web.scm | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index b0268e5a31..75f07b92d6 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -558,6 +558,45 @@ over a different origin than that of the web application.")
 (define-public python2-furl
   (package-with-python2 python-furl))
 
+(define-public python-gtts
+  (package
+    (name "python-gtts")
+    (version "2.2.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "gTTS" version))
+       (sha256
+        (base32 "03qah9gxhx8m6apviqyffay2dpijm2k5h88ikzgndyvs6zc18dxm"))))
+    (build-system python-build-system)
+    (arguments
+     ;; XXX: The test suite requires unpackaged python-testfixtures, at least.
+     `(#:tests? #f))
+    (propagated-inputs
+     `(("python-click" ,python-click)
+       ("python-requests" ,python-requests)
+       ("python-six" ,python-six)))
+    ;;(native-inputs
+    ;; `(("python-flake8" ,python-flake8)
+    ;;   ("python-mock" ,python-mock)
+    ;;   ("python-pytest" ,python-pytest)
+    ;;   ("python-pytest-cov" ,python-pytest-cov)
+    ;;   ("python-six" ,python-six)
+    ;;   ("python-testfixtures" ,python-testfixtures)))
+    (home-page "https://github.com/pndurette/gTTS";)
+    (synopsis "Google Translate text-to-speech SaaSS client and library")
+    (description
+     "This package provides a Python API to interact with the @acronym{gTTS,
+Google Translate text-to-speech} @acronym{SaaSS, Service as a Software
+Substitute}.
+
+You should not use this library in your software: it does nothing but send all
+submitted text on to Google and give them complete control over the result.
+It is useless without an Internet connection, or if the API is changed.  When
+the service is discontinued, all copies of your software will become useless as
+well.")
+    (license license:expat)))
+
 (define-public python-httplib2
   (package
     (name "python-httplib2")
-- 
2.30.1

From 0a7a98f127834e368a2944a994fe72b2a735d01b Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sun, 3 Jan 2021 15:11:56 +0100
Subject: [PATCH 2/3] gnu: Add python-googletrans.

* gnu/packages/python-web.scm (python-googletrans): New public variable.
---
 gnu/packages/python-web.scm | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 75f07b92d6..b0dc135537 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -558,6 +558,45 @@ over a different origin than that of the web application.")
 (define-public python2-furl
   (package-with-python2 python-furl))
 
+(define-public python-googletrans
+  (package
+    (name "python-googletrans")
+    ;; This is an alpha version.  Google helpfully broke the 3.0.0 release to
+    ;; validate the warning in the description below -- thanks!
+    ;; <https://github.com/gi-lom/dialect/issues/104#issuecomment-739972652>
+    (version "3.1.0a0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "googletrans" version))
+       (sha256
+        (base32 "015fvyk1fq61n33bzawg1fcplb810lr6wv2xgs5334apjykp60yj"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'relax-version-restrictions
+           (lambda _
+             (substitute* "setup.py"
+               (("==") ">=")))))))
+    (native-inputs
+     `(("python-coveralls" ,python-coveralls)
+       ("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-httpx" ,python-httpx)))
+    (home-page "https://github.com/ssut/py-googletrans";)
+    (synopsis "Google Translate SaaSS Python client library")
+    (description
+     "This package provides a Python API to interact with the Google Translate
+@acronym{SaaSS, Service as a Software Substitute}.
+
+You should not use this library in your software: it does nothing but send the
+translation queries on to Google and give them complete control over the 
result.
+It is useless without an Internet connection, or if the API is changed.  When
+the service is discontinued, all copies of your software will become useless as
+well.")
+    (license license:expat)))
+
 (define-public python-gtts
   (package
     (name "python-gtts")
-- 
2.30.1

From ef297af5bd73eb6148843b879c451916df7de405 Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sun, 3 Jan 2021 15:15:26 +0100
Subject: [PATCH 3/3] gnu: Add dialect.

* gnu/packages/language.scm (dialect): New public variable.
---
 gnu/packages/language.scm   | 61 ++++++++++++++++++++++++++++++++++++-
 gnu/packages/python-web.scm |  2 +-
 2 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 651b2305c9..ffd2be5ae6 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Nikita <nikita@n0.is>
 ;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
@@ -33,6 +33,7 @@
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
@@ -45,6 +46,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
@@ -58,6 +60,7 @@
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt)
@@ -68,6 +71,62 @@
   #:use-module (guix git-download)
   #:use-module (guix utils))
 
+(define-public dialect
+  ;; XXX The ‘About’ dialogue icon is missing.
+  (package
+    (name "dialect")
+    (version "1.1.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/gi-lom/dialect";)
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0yvayqi80c3cwhs2hx186ybr15jp1d9frp8fzg38lf6pi44nypvk"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap-typelib
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (wrap-program (string-append out "/bin/dialect")
+                 `("GI_TYPELIB_PATH" prefix
+                   ,(search-path-as-string->list (getenv "GI_TYPELIB_PATH")))
+                 `("PYTHONPATH" prefix
+                   ,(search-path-as-string->list (getenv "PYTHONPATH"))))))))))
+    (native-inputs
+     `(("desktop-file-utils" ,desktop-file-utils) ; for update-desktop-database
+       ("gettext" ,gettext-minimal)
+       ("glib:bin" ,glib "bin")         ; for glib-compile-resources
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-bin" ,gtk+ "bin")         ; for gtk-update-icon-cache
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("libhandy" ,libhandy)))
+    (propagated-inputs
+     `(("python-googletrans" ,python-googletrans)
+       ("python-gst" ,python-gst)
+       ("python-gtts" ,python-gtts)
+       ("python-pygobject" ,python-pygobject)))
+    (home-page "https://github.com/gi-lom/dialect";)
+    (synopsis "Desktop client for the Google Translate network SaaSS")
+    (description
+     "Dialect is a very thin graphical desktop client for the Google Translate
+network @acronym{SaaSS, Service as a Software Substitute} that replaces the Web
+interface with a native GTK 3 window.  It lets you translate text between many
+languages without opening a browser.
+
+Dialect is not translation software: it simply forwards input to Google's
+servers and displays the result.  It's useless without an Internet connection,
+if you are blocked for performing too many translations, or when the service
+is discontinued.")
+    (license gpl3+)))
+
 (define-public nimf
   (package
     (name "nimf")
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index b0dc135537..6126fa26b4 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -14,7 +14,7 @@
 ;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com>
 ;;; Copyright © 2015, 2016, 2017, 2019 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
-;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice 
<me@tobias.gr>
+;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2015, 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2015, 2016 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
-- 
2.30.1

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]