summaryrefslogtreecommitdiff
path: root/guix.scm
blob: d6f2f0e8e99d88b9e03778ad38250b07cca82781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
(use-modules
  ((guix licenses) #:prefix license:)
  (guix build-system copy)
  (guix gexp)
  (guix git-download)
  (guix packages)
  (guix build utils)
  (gnu packages gnome)
  (gnu packages guile)
  (elenq graphics))

(define %source-dir (dirname (current-filename)))

(define-public elenq-logos
  (package
    (name "elenq-logos")
    (version "0.0.1")
    (source (local-file %source-dir #:recursive? #t))
    (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)))

elenq-logos