gnu: Add guix-icons.
* gnu/packages/package-management.scm (guix-icons): New variable.
This commit is contained in:
parent
391fb7a60a
commit
43c15ee672
1 changed files with 61 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
|||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (gnu packages package-management)
|
||||
#:use-module (gnu artwork)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages acl)
|
||||
#:use-module (gnu packages attr)
|
||||
|
@ -66,6 +67,7 @@
|
|||
#:use-module (gnu packages guile)
|
||||
#:use-module (gnu packages guile-xyz)
|
||||
#:use-module (gnu packages hurd)
|
||||
#:use-module (gnu packages imagemagick)
|
||||
#:use-module (gnu packages less)
|
||||
#:use-module (gnu packages libedit)
|
||||
#:use-module (gnu packages linux)
|
||||
|
@ -99,6 +101,7 @@
|
|||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix build-system meson)
|
||||
#:use-module (guix build-system python)
|
||||
#:use-module (guix build-system trivial)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix git-download)
|
||||
|
@ -583,6 +586,64 @@ out) and returning a package that uses that as its 'source'."
|
|||
#:recursive? #t
|
||||
#:select? (force select?))))))))
|
||||
|
||||
(define-public guix-icons
|
||||
(package
|
||||
(inherit guix)
|
||||
(name "guix-icons")
|
||||
(version "0.1")
|
||||
(source %artwork-repository)
|
||||
(build-system trivial-build-system)
|
||||
(native-inputs
|
||||
`(("imagemagick" ,imagemagick)))
|
||||
(inputs
|
||||
'())
|
||||
(arguments
|
||||
`(#:modules ((guix build utils)
|
||||
(gnu build svg))
|
||||
#:builder
|
||||
,(with-extensions (list guile-rsvg guile-cairo)
|
||||
#~(begin
|
||||
(use-modules (guix build utils)
|
||||
(gnu build svg))
|
||||
(let* ((logo (string-append #$source "/logo/Guix.svg"))
|
||||
(logo-white
|
||||
(string-append #$source
|
||||
"/logo/Guix-horizontal-white.svg"))
|
||||
(theme "hicolor")
|
||||
(category "apps")
|
||||
(sizes '(16 24 32 48 64 72 96 128 256 512 1024))
|
||||
(icons
|
||||
(string-append #$output "/share/icons/" theme))
|
||||
(scalable-dir
|
||||
(string-append icons "/scalable/" category)))
|
||||
(setenv "XDG_CACHE_HOME" (getcwd))
|
||||
|
||||
;; Create the scalable icon files.
|
||||
(mkdir-p scalable-dir)
|
||||
(copy-file logo
|
||||
(string-append scalable-dir "/guix-icon.svg"))
|
||||
(copy-file logo-white
|
||||
(string-append scalable-dir
|
||||
"/guix-white-icon.svg"))
|
||||
|
||||
;; Create the fixed dimensions icon files.
|
||||
(for-each
|
||||
(lambda (size)
|
||||
(let* ((dimension
|
||||
(format #f "~ax~a" size size))
|
||||
(file
|
||||
(string-append icons "/" dimension "/" category
|
||||
"/guix-icon.png")))
|
||||
(mkdir-p (dirname file))
|
||||
(svg->png logo file
|
||||
#:width size
|
||||
#:height size)))
|
||||
sizes))))))
|
||||
(synopsis "GNU Guix icons")
|
||||
(description "This package contains GNU Guix icons organized according to
|
||||
the Icon Theme Specification. They can be used by applications querying the
|
||||
GTK icon cache for instance.")))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Other tools.
|
||||
|
|
Reference in a new issue