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>
parent
6564a04efa
commit
e0d2ec418b
|
@ -27424,19 +27424,77 @@ optional integration with other popular Emacs packages like Company, Flycheck,
|
|||
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))
|
||||
|
|
Reference in New Issue