From 006382573d26ca745fdd7421142d4215efeb5886 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Mon, 31 Jul 2023 19:48:44 +0200 Subject: nongnu: make-google-chrome: Install icons. * nongnu/packages/chrome.scm (make-google-chrome)[phases]: New phase 'install-icons. Signed-off-by: John Kehayias --- nongnu/packages/chrome.scm | 19 +++++++++++++++++-- 1 file 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")) -- cgit v1.2.3