From 3b615d061f5d0470096f362d86814a8046e7865b Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Fri, 10 Jan 2025 22:38:48 +0100 Subject: elenq: add logos --- elenq/graphics.scm | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/elenq/graphics.scm b/elenq/graphics.scm index 0a44a78..172aa93 100644 --- a/elenq/graphics.scm +++ b/elenq/graphics.scm @@ -1,9 +1,12 @@ (define-module (elenq graphics) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system font) + #:use-module (guix build-system copy) #:use-module (guix gexp) #:use-module (guix git-download) - #:use-module (guix packages)) + #:use-module (guix packages) + #:use-module (gnu packages guile) + #:use-module (gnu packages gnome)) (define-public font-armata (package @@ -52,3 +55,55 @@ improvements: @item Cleaned source blob files that required proprietary software. @end itemize") (license license:silofl1.1)))) + +(define-public elenq-logos + (let ((revision "1") + (commit "3612f4a88e6a06a9c0fa7cfdb81cbbf6f081a1a9")) + (package + (name "elenq-logos") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "git://git.elenq.tech/elenq-logos/") + (commit commit))) + (sha256 + (base32 "0q0a5p84vxwcj3516snnwq09i3g36idfmvpp46vsl9hcq9z53ha3")))) + (native-inputs (list librsvg font-armata guile-3.0-latest)) + (arguments + (list + #:install-plan ''(("out/" "share/elenq")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'build + (lambda _ + (define out "out") + + (define (redirected-to-file filename . command) + (with-output-to-file filename + (lambda () (apply invoke command)))) + + (define (make-all-logo-formats subname) + (let ((base (string-append out "/elenq-" subname ".svg"))) + (redirected-to-file base "guile" "logo/elenq.scm" subname) + (invoke + "rsvg-convert" base "--format=svg" "--output" + (string-append out "/elenq-" subname ".optimized.svg")) + (for-each + (lambda (size) + (invoke + "rsvg-convert" base "--format=png" "--output" + (string-append out "/elenq-" subname "-" size ".png") + "-w" size "--keep-aspect-ratio")) + (map (lambda (x) (number->string (integer-expt 2 x))) + (iota 6 5 1))))) + + (mkdir "out") + (for-each make-all-logo-formats + (list "technology" "publishing"))))))) + (build-system copy-build-system) + (home-page "https://elenq.tech") + (synopsis "ElenQ logos") + (description "ElenQ Technology logos in different sizes and formats.") + (license license:cc-by-sa4.0)))) -- cgit v1.2.3