summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Leidi <goodoldpaul@autistici.org>2023-07-31 19:48:44 +0200
committerJohn Kehayias <john.kehayias@protonmail.com>2023-10-06 22:11:33 -0400
commit006382573d26ca745fdd7421142d4215efeb5886 (patch)
tree2587752c479b161f1fc3fe14adae2b3f3137f095
parent701aca30cf3c54af2afe35d7913a5b2b6f1c1ce6 (diff)
nongnu: make-google-chrome: Install icons.
* nongnu/packages/chrome.scm (make-google-chrome)[phases]: New phase 'install-icons. Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
-rw-r--r--nongnu/packages/chrome.scm19
1 files changed, 17 insertions, 2 deletions
diff --git a/nongnu/packages/chrome.scm b/nongnu/packages/chrome.scm
index 089345e..e343fc5 100644
--- a/nongnu/packages/chrome.scm
+++ b/nongnu/packages/chrome.scm
@@ -92,8 +92,23 @@
((old-exe) exe))
(substitute* (string-append usr/share "/menu/google-" #$appname ".menu")
(("/opt") share)
- ((old-exe) exe))
- #t)))
+ ((old-exe) exe)))))
+ (add-after 'install 'install-icons
+ (lambda _
+ (define (format-icon-size name)
+ (car
+ (string-split
+ (string-drop-right (string-drop name 13) 4)
+ #\_)))
+ (let ((icons (string-append #$output "/share/icons/hicolor"))
+ (share (string-append #$output "/share/google/" #$appname)))
+ (for-each (lambda (icon)
+ (let* ((icon-name (basename icon))
+ (icon-size (format-icon-size icon-name))
+ (target (string-append icons "/" icon-size "x" icon-size "/apps/google-" #$appname ".png")))
+ (mkdir-p (dirname target))
+ (rename-file icon target)))
+ (find-files share "product_logo_.*\\.png")))))
(add-before 'install-wrapper 'install-exe
(lambda _
(let* ((bin (string-append #$output "/bin"))