summaryrefslogtreecommitdiff
path: root/elenq/graphics.scm
blob: 172aa938484485a6f4b90a726606f0bddf7053e4 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
(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 (gnu packages guile)
  #:use-module (gnu packages gnome))

(define-public font-armata
  (package
    (name "font-armata")
    (version "0.9.7")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/ekaitz-zarraga/font-armata/")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1pdlydanpay93pgkbpawii11j62m643pqkv6i6crvia198i9fnrd"))))
    (build-system font-build-system)
    (home-page "https://fontlibrary.org/en/font/armata")
    (synopsis "Armata Font")
    (description
     "Armata is a new Sans Serif font by Jasper @ Cannot Into Space
Fonts. It is named after the new Russian T-14 Armata Main Battle Tank.")
    (license license:silofl1.1)))

(define-public font-b612-better
  (let ((revision "1")
        (commit "ab287a9876083f29d9bf83e4b71a60e79d8b657e"))
    (package
      (name "font-b612-better")
      (version (git-version "0.0.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/ekaitz-zarraga/font-b612-better/")
               (commit commit)))
         (sha256
          (base32 "11r2blm2v82rsrl0jypi8x9r8im14q1gx57jhzdby4dia6jslsjv"))))
      (build-system font-build-system)
      (home-page "https://github.com/ekaitz-zarraga/font-b612-better")
      (synopsis "B612 Font (improved)")
      (description
       "Fork of the B612 font developed by AIRBUS with a few
improvements:
@itemize
@item Proper Monospace support
@item Slashed Zero by default
@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))))