unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50329: Missing icon folder in emacs-lsp-treemacs package.
@ 2021-09-01 23:31 Cayetano Santos
  2022-03-19 14:33 ` bug#50329: [PATCH v2 1/2] gnu: emacs-lsp-treemacs: Remove unclearly licensed icons r0man
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Cayetano Santos @ 2021-09-01 23:31 UTC (permalink / raw)
  To: 50329


Context:

Using guix as a (emacs packages) package manager on top of 
archlinux.


Problem

I get the following error when using emacs-lsp-treemacs.

  Cannot find image file 
  ‘/gnu/store/famkwbglv5sl7x08z671jyqdj1ngbw6p-emacs-lsp-treemacs-0.3/share/emacs/site-lisp/lsp-treemacs-0.3/icons/vscode/symbol-method.png’ 
  [8 times]

Indeed, the icons folder is missing.


Solution

From the github repository

    https://github.com/emacs-lsp/lsp-treemacs

the icons folder is present.

Additionally, when installing from melpa, I observe that the icons 
folder gets installed.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH v2 1/2] gnu: emacs-lsp-treemacs: Remove unclearly licensed icons.
  2021-09-01 23:31 bug#50329: Missing icon folder in emacs-lsp-treemacs package Cayetano Santos
@ 2022-03-19 14:33 ` r0man
  2023-01-22  9:09   ` Liliana Marie Prikler
  2022-03-19 15:29 ` bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs Roman Scherer
  2022-03-20 13:29 ` bug#50329: [PATCH v2 2/2] gnu: emacs-company-box: Remove unclearly licensed icons from source Liliana Marie Prikler
  2 siblings, 1 reply; 15+ messages in thread
From: r0man @ 2022-03-19 14:33 UTC (permalink / raw)
  To: 50329; +Cc: Maxime Devos, Nicolas Goaziou, Roman Scherer

emacs-lsp-treemacs bundles icons with unclear licenses.
See also <https://github.com/emacs-lsp/lsp-treemacs/issues/123>.

* gnu/packages/emacs-xyz.scm (%emacs-lsp-treemacs-upstream-source): New
variable.
(emacs-treemacs)[source]: Use a computed origin to remove unclearly licensed
icons.  Also remove source code which mentions said icons.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
---
 gnu/packages/emacs-xyz.scm | 72 ++++++++++++++++++++++++++++++++++----
 1 file changed, 65 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index b5c2c011db..caa9b4ca6e 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -27305,19 +27305,77 @@ (define-public emacs-lsp-mode
 and Projectile.")
       (license license:gpl3+))))
 
+(define* (%emacs-lsp-treemacs-upstream-source #:key commit version hash)
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://github.com/emacs-lsp/lsp-treemacs")
+          (commit commit)))
+    (file-name (git-file-name "emacs-lsp-treemacs" version))
+    (hash hash)))
+
 (define-public emacs-lsp-treemacs
   (package
     (name "emacs-lsp-treemacs")
     (version "0.4")
     (source
      (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/emacs-lsp/lsp-treemacs")
-             (commit version)))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "05ivqa5900139jzjhwc3nggwznhm8564dz4ydcxym2ddd63571k0"))))
+       (method (@@ (guix packages) computed-origin-method))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256 #f)
+       (uri
+        (delay
+          (with-imported-modules '((guix build emacs-utils)
+                                   (guix build utils))
+            #~(begin
+                (use-modules (guix build utils)
+                             (guix build emacs-utils))
+                (let* ((dir (string-append "emacs-lsp-treemacs-" #$version)))
+
+                  (set-path-environment-variable
+                   "PATH" '("bin")
+                   (list #+emacs-minimal
+                         #+(canonical-package bash)
+                         #+(canonical-package coreutils)
+                         #+(canonical-package gzip)
+                         #+(canonical-package tar)))
+
+                  ;; Copy the upstream source
+                  (copy-recursively
+                   #+(%emacs-lsp-treemacs-upstream-source
+                      #:commit version #:version version
+                      #:hash
+                      (content-hash
+                       "05ivqa5900139jzjhwc3nggwznhm8564dz4ydcxym2ddd63571k0"))
+                   dir)
+
+                  (with-directory-excursion dir
+                    ;; The icons are unclearly licensed and possibly non-free,
+                    ;; see <https://github.com/emacs-lsp/lsp-treemacs/issues/123>
+                    (with-directory-excursion "icons"
+                      (for-each delete-file-recursively
+                                '("eclipse" "idea" "netbeans")))
+
+                    ;; Also remove any mentions in the source code.
+                    (make-file-writable "lsp-treemacs-themes.el")
+                    (emacs-batch-edit-file "lsp-treemacs-themes.el"
+                      '(progn
+                        (while (search-forward-regexp
+                                "(treemacs-create-theme \"\\([^\"]*\\)\""
+                                nil t)
+                          (pcase (match-string 1)
+                                 ("Iconless" nil)
+                                 (_ (beginning-of-line)
+                                    (kill-sexp)))
+                          (basic-save-buffer)))))
+
+                  (invoke "tar" "cvfa" #$output
+                          "--mtime=@0"
+                          "--owner=root:0"
+                          "--group=root:0"
+                          "--sort=name"
+                          "--hard-dereference"
+                          dir))))))))
     (build-system emacs-build-system)
     (propagated-inputs
      (list emacs-lsp-mode emacs-treemacs))

base-commit: 8be0a97a8139fdd4d196092008b98668f1a8b2bb
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2021-09-01 23:31 bug#50329: Missing icon folder in emacs-lsp-treemacs package Cayetano Santos
  2022-03-19 14:33 ` bug#50329: [PATCH v2 1/2] gnu: emacs-lsp-treemacs: Remove unclearly licensed icons r0man
@ 2022-03-19 15:29 ` Roman Scherer
  2022-03-19 20:10   ` Maxime Devos
  2022-03-20 13:29 ` bug#50329: [PATCH v2 2/2] gnu: emacs-company-box: Remove unclearly licensed icons from source Liliana Marie Prikler
  2 siblings, 1 reply; 15+ messages in thread
From: Roman Scherer @ 2022-03-19 15:29 UTC (permalink / raw)
  To: guix-patches

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]


Hello,

the emacs-lsp-treemacs package does not bundle it's icons. This patch
fixes the issue by copying the icons to `share/emacs-lsp-treemacs/icons`
and patching the paths in `lsp-treemacs-themes.el`.

This is the link to the issue in bug tracker: https://issues.guix.gnu.org/50329

Would you like to apply this patch?

Thanks, Roman.

This is my 2nd mail, because I forgot to set the subject in the previous.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch --]
[-- Type: text/x-patch, Size: 1524 bytes --]

From 70b409e51ea655c79fac20d9990b9644ddd4f19c Mon Sep 17 00:00:00 2001
From: r0man <roman@burningswell.com>
Date: Sat, 19 Mar 2022 15:33:24 +0100
Subject: [PATCH] Bundle emacs-lsp-treemacs icons

---
 gnu/packages/emacs-xyz.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index dcd36291fb..a1328ef57a 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -24429,6 +24429,19 @@ (define-public emacs-lsp-treemacs
        (sha256
         (base32 "05ivqa5900139jzjhwc3nggwznhm8564dz4ydcxym2ddd63571k0"))))
     (build-system emacs-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'install 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* "lsp-treemacs-themes.el"
+                 (("\\(f-join \\(f-dirname \\(or load-file-name buffer-file-name\\)\\) \"icons/([^\"]+)\"\\)" all name)
+                  (string-append "\"" out "/share/" ,name "/icons/" name "\""))))))
+         (add-after 'install 'install-data
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (copy-recursively "icons" (string-append out "/share/" ,name "/icons"))))))))
     (propagated-inputs
      (list emacs-lsp-mode emacs-treemacs))
     (home-page "https://github.com/emacs-lsp/lsp-treemacs")
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-19 15:29 ` bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs Roman Scherer
@ 2022-03-19 20:10   ` Maxime Devos
  2022-03-20  8:59     ` Roman Scherer
  0 siblings, 1 reply; 15+ messages in thread
From: Maxime Devos @ 2022-03-19 20:10 UTC (permalink / raw)
  To: Roman Scherer, guix-patches; +Cc: Nicolas Goaziou

[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]

Roman Scherer schreef op za 19-03-2022 om 16:29 [+0100]:
> the emacs-lsp-treemacs package does not bundle it's icons. This patch
> fixes the issue by copying the icons to `share/emacs-lsp-
> treemacs/icons` and patching the paths in `lsp-treemacs-themes.el`.

That might technically solves matter, though instead of copying, why
not just change

  (string-append "\"" out "/share/" ,name "/icons/" name "\"")

to the location of the icons?  Unless you meant something else with
bundling here ...

Also, what do you mean with bundling exactly?  AFAICT, the icons _are_
bundled, in the directory 'icons', and so far they have not yet been
unbundled in Guix -- the problem is that they are not installed (yet)
-- in that case, the patch seems reasonable to me.

Additionally, there may be some licensing problems.  The icons
apparently come from ‘eclipse’, ‘idea’ and ‘netbeans’.  I don't
actually know which license these have, but:

  * idea is propietary, so probably its icons are as well
  * Eclipse is ASL, which probably has some kind of requirement
    that you need to preserve license and copyright information,
    which seems to be completely ignored here.
  * the relevant licenses don't appear to be entioned in the
    'licenses' field.

As such, if these problems are not resolved, I think it will be
necessary to remove emacs-lsp-treemacs.

It seems like emacs-company-box
(https://github.com/sebastiencs/company-box/tree/master/images)
has the same problem as well.

Also seem upstream <https://github.com/emacs-lsp/lsp-treemacs/issues/123>.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-19 20:10   ` Maxime Devos
@ 2022-03-20  8:59     ` Roman Scherer
  2022-03-20  9:41       ` Maxime Devos
  0 siblings, 1 reply; 15+ messages in thread
From: Roman Scherer @ 2022-03-20  8:59 UTC (permalink / raw)
  To: Maxime Devos; +Cc: guix-patches, Nicolas Goaziou

[-- Attachment #1: Type: text/plain, Size: 4184 bytes --]


Hi Maxime,

thanks for taking a look at my patch and uncovering this license
issue. I was not aware of that.

When I said the emacs-lsp-treemacs package is not bundling it's icons, I
meant that the Guix emacs-lsp-treemacs package does not install them.

So, without my patch, I see the following files installed on my system:

[roman@thinkpad ~]$ find /gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs/site-lisp
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs/site-lisp/lsp-treemacs-0.4
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs/site-lisp/lsp-treemacs-0.4/lsp-treemacs-pkg.el
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs/site-lisp/lsp-treemacs-0.4/lsp-treemacs.elc
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs/site-lisp/lsp-treemacs-0.4/lsp-treemacs-autoloads.el
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs/site-lisp/lsp-treemacs-0.4/lsp-treemacs-themes.el
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs/site-lisp/lsp-treemacs-0.4/lsp-treemacs.el
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs/site-lisp/lsp-treemacs-0.4/lsp-treemacs-themes.elc
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/emacs/site-lisp/lsp-treemacs-0.4/lsp-treemacs-autoloads.elc
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/doc
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/doc/emacs-lsp-treemacs-0.4
/gnu/store/z634qq81f0qfvqzr0rcavpc16bdc9zs3-emacs-lsp-treemacs-0.4/share/doc/emacs-lsp-treemacs-0.4/LICENSE

Since the icons are not installed on a Guix system right now, I think we
can leave the Guix emacs-lsp-treemacs packages as it is for now.

Once upstream has added the licenses for the icons, we could take
another look and maybe only install the ones that we are allowed to
include.

What do you think?

Thanks, Roman.

Maxime Devos <maximedevos@telenet.be> writes:

> [[PGP Signed Part:Undecided]]
> Roman Scherer schreef op za 19-03-2022 om 16:29 [+0100]:
>> the emacs-lsp-treemacs package does not bundle it's icons. This patch
>> fixes the issue by copying the icons to `share/emacs-lsp-
>> treemacs/icons` and patching the paths in `lsp-treemacs-themes.el`.
>
> That might technically solves matter, though instead of copying, why
> not just change
>
>   (string-append "\"" out "/share/" ,name "/icons/" name "\"")
>
> to the location of the icons?  Unless you meant something else with
> bundling here ...
>
> Also, what do you mean with bundling exactly?  AFAICT, the icons _are_
> bundled, in the directory 'icons', and so far they have not yet been
> unbundled in Guix -- the problem is that they are not installed (yet)
> -- in that case, the patch seems reasonable to me.
>
> Additionally, there may be some licensing problems.  The icons
> apparently come from ‘eclipse’, ‘idea’ and ‘netbeans’.  I don't
> actually know which license these have, but:
>
>   * idea is propietary, so probably its icons are as well
>   * Eclipse is ASL, which probably has some kind of requirement
>     that you need to preserve license and copyright information,
>     which seems to be completely ignored here.
>   * the relevant licenses don't appear to be entioned in the
>     'licenses' field.
>
> As such, if these problems are not resolved, I think it will be
> necessary to remove emacs-lsp-treemacs.
>
> It seems like emacs-company-box
> (https://github.com/sebastiencs/company-box/tree/master/images)
> has the same problem as well.
>
> Also seem upstream <https://github.com/emacs-lsp/lsp-treemacs/issues/123>.
>
> Greetings,
> Maxime.
>
> [[End of PGP Signed Part]]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-20  8:59     ` Roman Scherer
@ 2022-03-20  9:41       ` Maxime Devos
  2022-03-20 10:35         ` Roman Scherer
  0 siblings, 1 reply; 15+ messages in thread
From: Maxime Devos @ 2022-03-20  9:41 UTC (permalink / raw)
  To: Roman Scherer; +Cc: 50329, Nicolas Goaziou

[-- Attachment #1: Type: text/plain, Size: 1914 bytes --]

Roman Scherer schreef op zo 20-03-2022 om 09:59 [+0100]:
> Since the icons are not installed on a Guix system right now, I think
> we can leave the Guix emacs-lsp-treemacs packages as it is for now.
> 
> Once upstream has added the licenses for the icons, we could take
> another look and maybe only install the ones that we are allowed to
> include.
> 
> What do you think?

Even though they are not currently installed, I would still remove
them from the 'source', as per (guix)Software Freedom:

> Some otherwise free upstream package sources contain a small and
> optional subset that violates the above guidelines, for instance
> because this subset is itself non-free code.  When that happens,
> the offending items are removed with appropriate patches or code
> snippets in the ‘origin’ form of the package (*note Defining
> Packages::).  This way, ‘guix build --source’ returns the “freed”
> source rather than the unmodified upstream source.

That's about code, not icons, but the same principles apply I'd think.
(Though for some reason, the FSDG makes an exception for things like
images in the section ‘Non-functional Data’?)

(In this case, the idea icons are likely to be non-free, the netbeans 
and eclipse icons are presumabl non-free.)

Even if the ‘Non-Functional Data’ exception is followed, I think
the source should still remove things that do not seem to follow the
licensing requirements (*) (and hence, might be illegal to
redistribute), to avoid nasty surprises for users doing "guix build --
sources=transitive foo bar ...".

(*) TBC, I am not accusing emacs-lsp-treemacs of violating license
terms.  Rather, it is not clear to me that it does _not_ violate
licensing terms, and I'd like any potential licensing concerns to be
investigated (and corrected, if necessary) before including the icons
in Guix.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-20  9:41       ` Maxime Devos
@ 2022-03-20 10:35         ` Roman Scherer
  2022-03-20 11:15           ` Liliana Marie Prikler
  0 siblings, 1 reply; 15+ messages in thread
From: Roman Scherer @ 2022-03-20 10:35 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 50329, Nicolas Goaziou


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


Hi Maxime,

ok, I see. Thanks for the explanation. I attached a patch that removes
the icons from the source as per your suggestion.

What do you think about this one?

Thanks, Roman.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Remove icons from source --]
[-- Type: text/x-patch, Size: 1120 bytes --]

From 5468ef15c239133366314d0d5131e440c2e8893f Mon Sep 17 00:00:00 2001
From: r0man <roman@burningswell.com>
Date: Sat, 19 Mar 2022 15:33:24 +0100
Subject: [PATCH] Remove lsp-treemacs icons from source

There's an issue [1] with the icon licenses of the Emacs lsp-treemacs
package. This patch removes the icons directory from the sources.

[1] https://github.com/emacs-lsp/lsp-treemacs/issues/123
---
 gnu/packages/emacs-xyz.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index dcd36291fb..1b6e54ef18 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -24426,6 +24426,8 @@ (define-public emacs-lsp-treemacs
              (url "https://github.com/emacs-lsp/lsp-treemacs")
              (commit version)))
        (file-name (git-file-name name version))
+       (modules '((guix build utils)))
+       (snippet '(begin (delete-file-recursively "icons") #t))
        (sha256
         (base32 "05ivqa5900139jzjhwc3nggwznhm8564dz4ydcxym2ddd63571k0"))))
     (build-system emacs-build-system)
-- 
2.34.0


[-- Attachment #1.3: Type: text/plain, Size: 2090 bytes --]


Maxime Devos <maximedevos@telenet.be> writes:

> [[PGP Signed Part:Undecided]]
> Roman Scherer schreef op zo 20-03-2022 om 09:59 [+0100]:
>> Since the icons are not installed on a Guix system right now, I think
>> we can leave the Guix emacs-lsp-treemacs packages as it is for now.
>>
>> Once upstream has added the licenses for the icons, we could take
>> another look and maybe only install the ones that we are allowed to
>> include.
>>
>> What do you think?
>
> Even though they are not currently installed, I would still remove
> them from the 'source', as per (guix)Software Freedom:
>
>> Some otherwise free upstream package sources contain a small and
>> optional subset that violates the above guidelines, for instance
>> because this subset is itself non-free code.  When that happens,
>> the offending items are removed with appropriate patches or code
>> snippets in the ‘origin’ form of the package (*note Defining
>> Packages::).  This way, ‘guix build --source’ returns the “freed”
>> source rather than the unmodified upstream source.
>
> That's about code, not icons, but the same principles apply I'd think.
> (Though for some reason, the FSDG makes an exception for things like
> images in the section ‘Non-functional Data’?)
>
> (In this case, the idea icons are likely to be non-free, the netbeans
> and eclipse icons are presumabl non-free.)
>
> Even if the ‘Non-Functional Data’ exception is followed, I think
> the source should still remove things that do not seem to follow the
> licensing requirements (*) (and hence, might be illegal to
> redistribute), to avoid nasty surprises for users doing "guix build --
> sources=transitive foo bar ...".
>
> (*) TBC, I am not accusing emacs-lsp-treemacs of violating license
> terms.  Rather, it is not clear to me that it does _not_ violate
> licensing terms, and I'd like any potential licensing concerns to be
> investigated (and corrected, if necessary) before including the icons
> in Guix.
>
> Greetings,
> Maxime.
>
> [[End of PGP Signed Part]]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-20 10:35         ` Roman Scherer
@ 2022-03-20 11:15           ` Liliana Marie Prikler
  2022-03-20 11:21             ` Roman Scherer
  0 siblings, 1 reply; 15+ messages in thread
From: Liliana Marie Prikler @ 2022-03-20 11:15 UTC (permalink / raw)
  To: Roman Scherer, Maxime Devos; +Cc: Nicolas Goaziou, 50329

Hi Roman, hi Maxime,

Am Sonntag, dem 20.03.2022 um 11:35 +0100 schrieb Roman Scherer:
> Hi Maxime,
> 
> ok, I see. Thanks for the explanation. I attached a patch that
> removes the icons from the source as per your suggestion.
> 
> What do you think about this one?
> 
> Thanks, Roman.
The logic behind your patch LGTM, but it lacks an explanatory comment.
Don't worry about resending the patch, though -- I already added the
comment locally and am currently looking to also apply this to emacs-
company-box.  If either of you could check whether those icons are
referred to by name in emacs-lsp-treemacs while I'm working on company-
box, that'd be appreciated.

Cheers




^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-20 11:15           ` Liliana Marie Prikler
@ 2022-03-20 11:21             ` Roman Scherer
  2022-03-20 13:10               ` Liliana Marie Prikler
  0 siblings, 1 reply; 15+ messages in thread
From: Roman Scherer @ 2022-03-20 11:21 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: Nicolas Goaziou, 50329

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]


Hi Liliana,

thanks for adding the comment locally. I just checked the source of LSP
Treemacs and yes, they are all mentioned by name here:

https://github.com/emacs-lsp/lsp-treemacs/blob/master/lsp-treemacs-themes.el#L38

Is this a problem? Should the build script remove them?

If that's the case, we could remove all those "icon themes" and just
leave this "Iconless" theme in the file:

https://github.com/emacs-lsp/lsp-treemacs/blob/master/lsp-treemacs-themes.el#L209

Roman

Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> Hi Roman, hi Maxime,
>
> Am Sonntag, dem 20.03.2022 um 11:35 +0100 schrieb Roman Scherer:
>> Hi Maxime,
>>
>> ok, I see. Thanks for the explanation. I attached a patch that
>> removes the icons from the source as per your suggestion.
>>
>> What do you think about this one?
>>
>> Thanks, Roman.
> The logic behind your patch LGTM, but it lacks an explanatory comment.
> Don't worry about resending the patch, though -- I already added the
> comment locally and am currently looking to also apply this to emacs-
> company-box.  If either of you could check whether those icons are
> referred to by name in emacs-lsp-treemacs while I'm working on company-
> box, that'd be appreciated.
>
> Cheers

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-20 11:21             ` Roman Scherer
@ 2022-03-20 13:10               ` Liliana Marie Prikler
  2022-03-20 13:58                 ` Roman Scherer
  0 siblings, 1 reply; 15+ messages in thread
From: Liliana Marie Prikler @ 2022-03-20 13:10 UTC (permalink / raw)
  To: Roman Scherer; +Cc: Nicolas Goaziou, 50329

Hi Roman,

Am Sonntag, dem 20.03.2022 um 12:21 +0100 schrieb Roman Scherer:
> 
> Hi Liliana,
> 
> thanks for adding the comment locally. I just checked the source of
> LSP Treemacs and yes, they are all mentioned by name here:
> 
> https://github.com/emacs-lsp/lsp-treemacs/blob/master/lsp-treemacs-themes.el#L38
> 
> Is this a problem? Should the build script remove them?
> 
> If that's the case, we could remove all those "icon themes" and just
> leave this "Iconless" theme in the file:
> 
> https://github.com/emacs-lsp/lsp-treemacs/blob/master/lsp-treemacs-themes.el#L209
> 
> Roman
Sadly, replacing these in a snippet won't be that easy, given we can't
easily sneak emacs into it.  On the topic of icons to remove, vscode-
icons might actually be okay and are also required by default.

What should we do? 




^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH v2 2/2] gnu: emacs-company-box: Remove unclearly licensed icons from source.
  2021-09-01 23:31 bug#50329: Missing icon folder in emacs-lsp-treemacs package Cayetano Santos
  2022-03-19 14:33 ` bug#50329: [PATCH v2 1/2] gnu: emacs-lsp-treemacs: Remove unclearly licensed icons r0man
  2022-03-19 15:29 ` bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs Roman Scherer
@ 2022-03-20 13:29 ` Liliana Marie Prikler
  2 siblings, 0 replies; 15+ messages in thread
From: Liliana Marie Prikler @ 2022-03-20 13:29 UTC (permalink / raw)
  To: 50329; +Cc: Maxime Devos, Nicolas Goaziou, Roman Scherer

emacs-company-box bundles icons with unclear licenses.
Confer <https://github.com/emacs-lsp/lsp-treemacs/issues/123>.

* gnu/packages/emacs-xyz.scm (%emacs-company-box-upstream-source): New variable.
(emacs-company-box)[source]: Use a computed origin to remove unclearly licensed
icons.  Also remove source code which mentions said icons.
---
 gnu/packages/emacs-xyz.scm | 84 ++++++++++++++++++++++++++++++++++----
 1 file changed, 77 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index caa9b4ca6e..73f2e7a3a2 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -7845,6 +7845,15 @@ (define-public emacs-company
 These are distributed in separate files and can be used individually.")
     (license license:gpl3+)))
 
+(define* (%emacs-company-box-upstream-source #:key commit version hash)
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://github.com/sebastiencs/company-box")
+          (commit commit)))
+    (file-name (git-file-name "emacs-company-box" version))
+    (hash hash)))
+
 (define-public emacs-company-box
   ;; There is no release yet.  Version is extracted from the main
   ;; file.
@@ -7856,13 +7865,74 @@ (define-public emacs-company-box
       (version (git-version version revision commit))
       (source
        (origin
-         (method git-fetch)
-         (uri (git-reference
-               (url "https://github.com/sebastiencs/company-box")
-               (commit commit)))
-         (file-name (git-file-name name version))
-         (sha256
-          (base32 "13fgmdy51gqdwijqfvb784pirx4lgva0y7ysi0c3fcx8f82cdj59"))))
+         (method (@@ (guix packages) computed-origin-method))
+         (file-name (string-append name "-" version ".tar.gz"))
+         (sha256 #f)
+         (uri
+          (delay
+            (with-imported-modules '((guix build emacs-utils)
+                                     (guix build utils))
+              #~(begin
+                  (use-modules (guix build utils)
+                               (guix build emacs-utils))
+                  (let* ((dir (string-append "emacs-company-box-" #$version)))
+
+                    (set-path-environment-variable
+                     "PATH" '("bin")
+                     (list #+emacs-minimal
+                           #+(canonical-package bash)
+                           #+(canonical-package coreutils)
+                           #+(canonical-package gzip)
+                           #+(canonical-package tar)))
+
+                    ;; Copy the upstream source
+                    (copy-recursively
+                     #+(%emacs-lsp-treemacs-upstream-source
+                        #:commit commit #:version version
+                        #:hash
+                        (content-hash
+                         "13fgmdy51gqdwijqfvb784pirx4lgva0y7ysi0c3fcx8f82cdj59"))
+                     dir)
+
+                    (with-directory-excursion dir
+                      ;; The icons are unclearly licensed and possibly non-free,
+                      ;; see <https://github.com/emacs-lsp/lsp-treemacs/issues/123>
+                      (with-directory-excursion "images"
+                        (for-each delete-file-recursively
+                                  '("eclipse" "idea" "netbeans")))
+
+                      ;; Also remove any mentions in the source code.
+                      (make-file-writable "company-box-icons.el")
+                      (emacs-batch-edit-file "company-box-icons.el"
+                        '(progn
+                          (while (search-forward-regexp
+                                  "(defvar company-box-icons-\\([a-z-]*\\)"
+                                  nil t)
+                            (pcase (match-string 1)
+                                   ((or "images"
+                                        "all-the-icons"
+                                        "icons-in-terminal") nil)
+                                   (_ (beginning-of-line)
+                                      (kill-sexp)))
+                            (basic-save-buffer))))
+
+                      ;; Also patch source to not show broken icons as configuration
+                      ;; option.
+                      (substitute* "company-box-icons.el"
+                        (("- .*, from.*editor.*") "")
+                        (("\\(const :tag \"([a-z]*)\".*\\)" all tag)
+                         (if (member tag
+                                     '("images" "all-the-icons" "icons-in-terminal"))
+                             all
+                             ""))))
+
+                    (invoke "tar" "cvfa" #$output
+                            "--mtime=@0"
+                            "--owner=root:0"
+                            "--group=root:0"
+                            "--sort=name"
+                            "--hard-dereference"
+                            dir))))))))
       (build-system emacs-build-system)
       (propagated-inputs
        (list emacs-company emacs-dash emacs-frame-local))
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-20 13:10               ` Liliana Marie Prikler
@ 2022-03-20 13:58                 ` Roman Scherer
  2022-03-20 15:46                   ` Liliana Marie Prikler
  0 siblings, 1 reply; 15+ messages in thread
From: Roman Scherer @ 2022-03-20 13:58 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: Nicolas Goaziou, 50329

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]


Hi Liliana and Maxime,

if the icons are really coming from [1], they seem to be licensed under
the Creative Commons Attribution 4.0 International Public License.

If it is okay to include them, I could work on a patch that only
installs the VS Code icons. I think we need to give credit and link to
the Creative Commons license. Is it enough to add it to the license
field and mention/link the VS Code icons in the description field?

Before doing that, I would wait until someone clarified that the icons
are really coming from [1] in the upstream issue.

In the meantime I think it's best to include my patch that removes all
icons from the source.

What do you think?

Roman

[1] https://github.com/microsoft/vscode-icons

Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> Hi Roman,
>
> Am Sonntag, dem 20.03.2022 um 12:21 +0100 schrieb Roman Scherer:
>>
>> Hi Liliana,
>>
>> thanks for adding the comment locally. I just checked the source of
>> LSP Treemacs and yes, they are all mentioned by name here:
>>
>> https://github.com/emacs-lsp/lsp-treemacs/blob/master/lsp-treemacs-themes.el#L38
>>
>> Is this a problem? Should the build script remove them?
>>
>> If that's the case, we could remove all those "icon themes" and just
>> leave this "Iconless" theme in the file:
>>
>> https://github.com/emacs-lsp/lsp-treemacs/blob/master/lsp-treemacs-themes.el#L209
>>
>> Roman
> Sadly, replacing these in a snippet won't be that easy, given we can't
> easily sneak emacs into it.  On the topic of icons to remove, vscode-
> icons might actually be okay and are also required by default.
>
> What should we do?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-20 13:58                 ` Roman Scherer
@ 2022-03-20 15:46                   ` Liliana Marie Prikler
  2022-03-20 17:58                     ` Roman Scherer
  0 siblings, 1 reply; 15+ messages in thread
From: Liliana Marie Prikler @ 2022-03-20 15:46 UTC (permalink / raw)
  To: Roman Scherer; +Cc: Nicolas Goaziou, 50329

Hi Roman,

Am Sonntag, dem 20.03.2022 um 14:58 +0100 schrieb Roman Scherer:
> Hi Liliana and Maxime,
> 
> if the icons are really coming from [1], they seem to be licensed
> under the Creative Commons Attribution 4.0 International Public
> License.
> 
> If it is okay to include them, I could work on a patch that only
> installs the VS Code icons. I think we need to give credit and link
> to the Creative Commons license.  Is it enough to add it to the
> license field and mention/link the VS Code icons in the description
> field?
Adding the license to the field with an appropriate comment would be
enough imho.  If upstream decides to make a new release, we can also
use that -- or alternatively bump to the commit.

> Before doing that, I would wait until someone clarified that the
> icons are really coming from [1] in the upstream issue.
> 
> In the meantime I think it's best to include my patch that removes
> all icons from the source.
> 
> What do you think?
I'm in the "let's wait and do the correct thing" camp.  Having one
commit to restrict the sources to the correct set would be more
justifiable than overreacting, particularly given the FSDG stance on
non-functional data.  That said, long-term this data needs to go :)

Cheers




^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs
  2022-03-20 15:46                   ` Liliana Marie Prikler
@ 2022-03-20 17:58                     ` Roman Scherer
  0 siblings, 0 replies; 15+ messages in thread
From: Roman Scherer @ 2022-03-20 17:58 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: Nicolas Goaziou, 50329

[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]


Ok, sounds good to me. :)

Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> Hi Roman,
>
> Am Sonntag, dem 20.03.2022 um 14:58 +0100 schrieb Roman Scherer:
>> Hi Liliana and Maxime,
>>
>> if the icons are really coming from [1], they seem to be licensed
>> under the Creative Commons Attribution 4.0 International Public
>> License.
>>
>> If it is okay to include them, I could work on a patch that only
>> installs the VS Code icons. I think we need to give credit and link
>> to the Creative Commons license.  Is it enough to add it to the
>> license field and mention/link the VS Code icons in the description
>> field?
> Adding the license to the field with an appropriate comment would be
> enough imho.  If upstream decides to make a new release, we can also
> use that -- or alternatively bump to the commit.
>
>> Before doing that, I would wait until someone clarified that the
>> icons are really coming from [1] in the upstream issue.
>>
>> In the meantime I think it's best to include my patch that removes
>> all icons from the source.
>>
>> What do you think?
> I'm in the "let's wait and do the correct thing" camp.  Having one
> commit to restrict the sources to the correct set would be more
> justifiable than overreacting, particularly given the FSDG stance on
> non-functional data.  That said, long-term this data needs to go :)
>
> Cheers

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#50329: [PATCH v2 1/2] gnu: emacs-lsp-treemacs: Remove unclearly licensed icons.
  2022-03-19 14:33 ` bug#50329: [PATCH v2 1/2] gnu: emacs-lsp-treemacs: Remove unclearly licensed icons r0man
@ 2023-01-22  9:09   ` Liliana Marie Prikler
  0 siblings, 0 replies; 15+ messages in thread
From: Liliana Marie Prikler @ 2023-01-22  9:09 UTC (permalink / raw)
  To: 50329-done; +Cc: Maxime Devos, Nicolas Goaziou, Roman Scherer

Am Samstag, dem 19.03.2022 um 15:33 +0100 schrieb r0man:
> emacs-lsp-treemacs bundles icons with unclear licenses.
> See also <https://github.com/emacs-lsp/lsp-treemacs/issues/123>.
> 
> * gnu/packages/emacs-xyz.scm (%emacs-lsp-treemacs-upstream-source):
> New
> variable.
> (emacs-treemacs)[source]: Use a computed origin to remove unclearly
> licensed
> icons.  Also remove source code which mentions said icons.
> 
> Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
> ---
Pushed now.

Cheers




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-01-22  9:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 23:31 bug#50329: Missing icon folder in emacs-lsp-treemacs package Cayetano Santos
2022-03-19 14:33 ` bug#50329: [PATCH v2 1/2] gnu: emacs-lsp-treemacs: Remove unclearly licensed icons r0man
2023-01-22  9:09   ` Liliana Marie Prikler
2022-03-19 15:29 ` bug#50329: [PATCH] Bundle icons for emacs-lsp-treemacs Roman Scherer
2022-03-19 20:10   ` Maxime Devos
2022-03-20  8:59     ` Roman Scherer
2022-03-20  9:41       ` Maxime Devos
2022-03-20 10:35         ` Roman Scherer
2022-03-20 11:15           ` Liliana Marie Prikler
2022-03-20 11:21             ` Roman Scherer
2022-03-20 13:10               ` Liliana Marie Prikler
2022-03-20 13:58                 ` Roman Scherer
2022-03-20 15:46                   ` Liliana Marie Prikler
2022-03-20 17:58                     ` Roman Scherer
2022-03-20 13:29 ` bug#50329: [PATCH v2 2/2] gnu: emacs-company-box: Remove unclearly licensed icons from source Liliana Marie Prikler

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