gnu: emacs-lsp-treemacs: Remove unclearly licensed icons.
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>
This commit is contained in:
		
							parent
							
								
									6564a04efa
								
							
						
					
					
						commit
						e0d2ec418b
					
				
					 1 changed files with 65 additions and 7 deletions
				
			
		| 
						 | 
					@ -27424,19 +27424,77 @@ optional integration with other popular Emacs packages like Company, Flycheck,
 | 
				
			||||||
and Projectile.")
 | 
					and Projectile.")
 | 
				
			||||||
      (license license:gpl3+))))
 | 
					      (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
 | 
					(define-public emacs-lsp-treemacs
 | 
				
			||||||
  (package
 | 
					  (package
 | 
				
			||||||
    (name "emacs-lsp-treemacs")
 | 
					    (name "emacs-lsp-treemacs")
 | 
				
			||||||
    (version "0.4")
 | 
					    (version "0.4")
 | 
				
			||||||
    (source
 | 
					    (source
 | 
				
			||||||
     (origin
 | 
					     (origin
 | 
				
			||||||
       (method git-fetch)
 | 
					       (method (@@ (guix packages) computed-origin-method))
 | 
				
			||||||
       (uri (git-reference
 | 
					       (file-name (string-append name "-" version ".tar.gz"))
 | 
				
			||||||
             (url "https://github.com/emacs-lsp/lsp-treemacs")
 | 
					       (sha256 #f)
 | 
				
			||||||
             (commit version)))
 | 
					       (uri
 | 
				
			||||||
       (file-name (git-file-name name version))
 | 
					        (delay
 | 
				
			||||||
       (sha256
 | 
					          (with-imported-modules '((guix build emacs-utils)
 | 
				
			||||||
        (base32 "05ivqa5900139jzjhwc3nggwznhm8564dz4ydcxym2ddd63571k0"))))
 | 
					                                   (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)
 | 
					    (build-system emacs-build-system)
 | 
				
			||||||
    (propagated-inputs
 | 
					    (propagated-inputs
 | 
				
			||||||
     (list emacs-lsp-mode emacs-treemacs))
 | 
					     (list emacs-lsp-mode emacs-treemacs))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue