unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tobias Geerinckx-Rice <me@tobias.gr>
To: mecqor labi <mecqorlabi@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: Packaging
Date: Sat, 06 Mar 2021 15:40:18 +0100	[thread overview]
Message-ID: <871rcs8hwt.fsf@nckx> (raw)
In-Reply-To: <CAGxZdwJ7EVMBz5ygwG-HGoqOuuqz85YTFH7j0vobBpmXYu4n+Q@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1306 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-python-gtts.patch --]
[-- Type: text/x-patch, Size: 2388 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-gnu-Add-python-googletrans.patch --]
[-- Type: text/x-patch, Size: 2451 bytes --]

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


[-- Attachment #1.4: 0003-gnu-Add-dialect.patch --]
[-- Type: text/x-patch, Size: 5342 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

  parent reply	other threads:[~2021-03-06 14:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-06  9:59 Packaging mecqor labi
2021-03-06 14:14 ` Packaging Joshua Branson
2021-03-06 18:46   ` Packaging Leo Famulari
2021-03-06 14:40 ` Tobias Geerinckx-Rice [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-03-27  7:37 Packaging mecqor labi
2021-03-27 14:53 ` Packaging Maxime Devos
     [not found]   ` <CAGxZdwJ1=X8+JP5WetApL4p_6ACDhgFje7SO7wOwLgO_BVe0VA@mail.gmail.com>
2021-03-28 10:43     ` Packaging Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rcs8hwt.fsf@nckx \
    --to=me@tobias.gr \
    --cc=guix-devel@gnu.org \
    --cc=mecqorlabi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).