summaryrefslogtreecommitdiff
path: root/gnu/packages/golang-graphics.scm
blob: 725ffad1b77b4b3c435c4471a9b963583f5e0829 (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2026 Sughosha <sughosha@disroot.org>
;;; Copyright © 2026 orahcio <orahcio@gmail.com>
;;; Copyright © 2026 moksh <mysticmoksh@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages golang-graphics)
  #:use-module (guix build-system go)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages golang-build)
  #:use-module (gnu packages golang-check)
  #:use-module (gnu packages golang-xyz)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages xorg))

;;; Commentary:
;;;
;;; Please: Try to add new module packages in alphabetic order.
;;;
;;; Code:

;;;
;;; Libraries:
;;;

(define-public go-code-superseriousbusiness-org-exif-terminator
  (package
    (name "go-code-superseriousbusiness-org-exif-terminator")
    (version "0.11.4")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
              (url "https://codeberg.org/superseriousbusiness/exif-terminator")
              (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1hq27gchyalz9j39z15xw9yianxwzdrwphv5cvcnr55n0fcgqbb6"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "code.superseriousbusiness.org/exif-terminator"))
    (native-inputs
     (list go-github-com-stretchr-testify))
    (propagated-inputs
     (list go-code-superseriousbusiness-org-go-jpeg-image-structure-v2
           go-code-superseriousbusiness-org-go-png-image-structure-v2
           go-github-com-dsoprea-go-exif-v3
           go-github-com-dsoprea-go-logging
           go-golang-org-x-image))
    (home-page "https://code.superseriousbusiness.org/exif-terminator")
    (synopsis "Terminate EXIF data from images")
    (description
     "@code{exif-terminator} removes exif data from images (JPEG and PNG
currently supported) in a streaming manner.")
    (license license:agpl3)))

(define-public go-code-superseriousbusiness-org-go-jpeg-image-structure-v2
  (package
    (name "go-code-superseriousbusiness-org-go-jpeg-image-structure-v2")
    (version "2.3.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
              (url
               "https://codeberg.org/superseriousbusiness/go-jpeg-image-structure")
              (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "03g9qbd7z6vrm8y1159xmz8h3fwr79k33j7ipwqpvxhm7sfbfrin"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "code.superseriousbusiness.org/go-jpeg-image-structure/v2"
      #:test-flags
      ;; XMP data is not correct.
      #~(list "-skip" "TestSegmentList_FindXmp|TestSegment_FormattedXmp")))
    (propagated-inputs
     (list go-github-com-dsoprea-go-exif-v3
           go-github-com-dsoprea-go-iptc
           go-github-com-dsoprea-go-logging
           go-github-com-dsoprea-go-photoshop-info-format
           go-github-com-dsoprea-go-utility-v2
           go-github-com-go-xmlfmt-xmlfmt))
    (home-page "https://code.superseriousbusiness.org/go-jpeg-image-structure")
    (synopsis "Parse JPEG data into segments for Go")
    (description
     "This packages provides functions to parse raw JPEG data into individual
segments of data.")
    (license license:expat)))

(define-public go-code-superseriousbusiness-org-go-png-image-structure-v2
  (package
    (name "go-code-superseriousbusiness-org-go-png-image-structure-v2")
    (version "2.3.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
              (url
               "https://codeberg.org/superseriousbusiness/go-png-image-structure")
              (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1ibqhaqlflp7vj24f4q3g46y00lr8y9xp358ddfgsdg2sic95h2w"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "code.superseriousbusiness.org/go-png-image-structure/v2"))
    (propagated-inputs
     (list go-github-com-dsoprea-go-exif-v3
           go-github-com-dsoprea-go-utility-v2))
    (home-page "https://code.superseriousbusiness.org/go-png-image-structure")
    (synopsis "Read/write PNGs as well as the EXIF in PNGs from Go")
    (description
     "This package implements reader and writer for PNG files and EXIF
metadata in Go.")
    (license license:expat)))

(define-public go-github-com-diamondburned-gotk4
  (package
    (name "go-github-com-diamondburned-gotk4")
    ;; 0.3.1 (2024-08-03); the latest commit includes fixes for tests, revert
    ;; back to git tag when released.
    (properties '((commit . "d44ab4b5b24e200c90c6a9ffb6632ada7e166a79")
                  (revision . "0")))
    (version (git-version "0.3.1"
                          (assoc-ref properties 'revision)
                          (assoc-ref properties 'commit)))
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/diamondburned/gotk4")
              (commit (assoc-ref properties 'commit))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0xwsl5n3hksrbyap11zhm4jp2hx1v8zqk796bh87qplw7468pn51"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/diamondburned/gotk4"
      #:test-flags #~(list "-vet=off")
      ;; XXX: Code is generated with "go generate", but the atemp to
      ;; re-generate it before build/test fails, see:
      ;; <https://github.com/diamondburned/gotk4/issues/174>.
      ;; #:phases
      #;
      #~(modify-phases %standard-phases
        (add-before 'build 'go-generate
          (lambda* (#:key import-path #:allow-other-keys)
            (with-directory-excursion (string-append "src/" import-path)
              (invoke "go" "generate" "-v" "-n")))))))
    (native-inputs
     (list at-spi2-core
           cairo
           gdk-pixbuf
           glib
           go-github-com-alecthomas-assert-v2
           gobject-introspection
           graphene
           gtk
           gtk+
           pango
           pkg-config))
    (propagated-inputs
     (list go-github-com-davecgh-go-spew
           go-github-com-fatih-color
           go-github-com-karpeleslab-weak               ;for gotk4/pkg/go.mod
           go-go4-org-unsafe-assume-no-moving-gc        ;for gotk4/pkg/go.mod
           go-golang-org-x-sync))
    (home-page "https://github.com/diamondburned/gotk4")
    (synopsis "GTK4 bindings generator for Go")
    (description
     "gotk4 is a GTK4 bindings generator for Go.  It also provides generated
bindings for ATK, Cairo, GdkPixbuf, GLib, Graphene, GTK4, GTK+3 and Pango.")
    (license (list license:agpl3+    ;used by gotk4/gir
                   license:mpl2.0    ;used by gotk4/pkg
                   license:expat)))) ;used by gotk4/pkg/cairo

(define-public go-github-com-diamondburned-gotk4-layer-shell
  ;; There are no tags or releases upstream.
  (let ((commit "6efa9f6dc438e10869f9ef0b8f7b5197e585bac1")
        (revision "0"))
    (package
      (name "go-github-com-diamondburned-gotk4-layer-shell")
      (version (git-version "0.0.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
                (url "https://github.com/diamondburned/gotk4-layer-shell")
                (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "03kch2g9fzgbd7q2lnp7xhdbi9rsh1fd997nw1phdvw80xshsvlr"))))
      (build-system go-build-system)
      (arguments
       (list
        #:import-path "github.com/diamondburned/gotk4-layer-shell"
        #:embed-files #~(list "capitalized.txt" "replaced.txt")
        #:phases
        #~(modify-phases %standard-phases
            (add-before 'build 'go-generate
              (lambda* (#:key import-path #:allow-other-keys)
                (with-directory-excursion (string-append "src/" import-path)
                  (invoke "go" "generate" "-v" "-n")))))))
      (native-inputs
       (list at-spi2-core
             cairo
             gdk-pixbuf
             glib
             go-github-com-davecgh-go-spew
             gobject-introspection
             graphene
             gtk
             gtk+
             gtk-layer-shell
             gtk4-layer-shell
             pango
             pkg-config))
      (propagated-inputs
       (list go-github-com-diamondburned-gotk4
             go-github-com-fatih-color
             go-github-com-mattn-go-colorable
             go-github-com-mattn-go-isatty
             go-github-com-pkg-errors
             go-golang-org-x-sync
             go-golang-org-x-sys))
      (home-page "https://github.com/diamondburned/gotk4-layer-shell")
      (synopsis "Layer Shell bindings generator for Go and gotk4")
      (description
       "gotk4-layer-shell is a GTK Layer Shell and GTK4 Layer Shell bindings
 generator for Go and gotk4.  It also provides generated bindings.")
      (license (list license:agpl3       ;used by the generator
                     license:mpl2.0))))) ;used by the generated code

(define-public go-github-com-dlasky-gotk3-layershell
  ;; There are no tags or releases upstream.
  (let ((commit "5c5115f0d77479c452ef686e3d7f327f2a341b3c")
        (revision "0"))
    (package
      (name "go-github-com-dlasky-gotk3-layershell")
      (version (git-version "0.0.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
                (url "https://github.com/dlasky/gotk3-layershell")
                (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0k7flgwmkwfq3lki4fjwx0868nxv2wa2igbqxjgqfm6150mnhmp8"))))
      (build-system go-build-system)
      (arguments
       (list
        #:import-path "github.com/dlasky/gotk3-layershell"))
      (native-inputs
       (list cairo
             gdk-pixbuf
             glib
             gtk+
             gtk-layer-shell
             pango
             pkg-config))
      (propagated-inputs
       (list go-github-com-gotk3-gotk3))
      (home-page "https://github.com/dlasky/gotk3-layershell")
      (synopsis "gotk3 addon module for GTK Layer Shell compatibility")
      (description
       "gotk3-layershell is a simple golang library to provide bindings for
GTK Layer Shell library which can also be consumed in the gotk3 library.")
      (license license:expat))))

(define-public go-github-com-gotk3-gotk3
  (package
    (name "go-github-com-gotk3-gotk3")
    (version "0.6.4.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
              (url "https://github.com/gotk3/gotk3")
              (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1hbqy4skn56xi69wqbys9rc1g46cx9sazj5n8ckq9638wphnp202"))))
    (build-system go-build-system)
    (arguments
     (list
      #:skip-build? #t
      #:import-path "github.com/gotk3/gotk3"
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'check 'start-xorg-server
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The test suite requires opening a display server.
              (system "Xvfb :1 &")
              (setenv "DISPLAY" ":1"))))))
    (native-inputs
     (list cairo
           gdk-pixbuf
           glib
           gtk+
           pango
           pkg-config
           xorg-server))
    (home-page "https://github.com/gotk3/gotk3")
    (synopsis "Go bindings for GTK+3")
    (description
     "gotk3 provides Go bindings for GTK+3 and dependent projects.

Partial binding support for the following libraries is currently implemented:

@itemize
@item GTK 3 (3.12 and later)
@item GDK 3 (3.12 and later)
@item GLib 2 (2.36 and later)
@item Cairo (1.10 and later)
@end itemize

Functions use the same names as the native C function calls, but use
CamelCase.  In cases where native GTK uses pointers to values to simulate
multiple return values, Go's native multiple return values are used instead.
Whenever a native GTK call could return an unexpected NULL pointer, an
additional error is returned in the Go binding.")
    (license license:isc)))

(define-public go-github-com-jackmordaunt-icns-v3
  (package
    (name "go-github-com-jackmordaunt-icns-v3")
    (version "3.0.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
              (url "https://github.com/JackMordaunt/icns")
              (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "04wnxv79b1xbca16kgz98zc929q60lwcgcc6q784lkz2a1clh2z2"))
       (modules '((guix build utils)))
       (snippet
        #~(begin
            ;; Submodules with their own go.mod files and packaged separately:
            (delete-file-recursively "cmd")))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/jackmordaunt/icns/v3"
      #:test-flags #~(list "-vet=off")))
    (propagated-inputs
     (list go-github-com-nfnt-resize))
    (home-page "https://github.com/jackmordaunt/icns")
    (synopsis "Easily create .icns files")
    (description
     "This package provides Go library to easily convert @code{.jpg} and
@code{.png} to @code{.icns}, or to convert from any @code{image.Image} to
@code{.icns}.")
    (license license:expat)))

(define-public go-github-com-joshdk-quantize
  (package
    (name "go-github-com-joshdk-quantize")
    (version "0.0.0-20171110221748-65999d3a4c76")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
              (url "https://github.com/joshdk/quantize")
              (commit (go-version->git-ref version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0bddsdflmxdprmpsmvfznal9z41kafs32i3mlf3crbl7i4wja3as"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/joshdk/quantize"))
    (home-page "https://github.com/joshdk/quantize")
    (synopsis "Color palette quantization library")
    (description
     "This package provides a color palette quantization library using
@url{https://modern-colorthief.readthedocs.io/en/stable/mmcq.html, MMCQ}
algorithm.")
    (license license:expat)))

(define-public go-github-com-makeworld-the-better-one-dither-v2
  (package
    (name "go-github-com-makeworld-the-better-one-dither-v2")
    (version "2.4.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
              (url "https://github.com/makew0rld/dither")
              (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0y1q1lnzsyfzksiwyc2xjbmaj9r3rmfqhgq681rz33inyssvn0nf"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/makeworld-the-better-one/dither/v2"
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'remove-examples
            (lambda* (#:key import-path #:allow-other-keys)
              (delete-file-recursively
               (string-append "src/" import-path "/examples")))))))
    (native-inputs
     (list go-github-com-stretchr-testify))
    (home-page "https://github.com/makew0rld/dither")
    (synopsis "Dithering library for Go")
    (description
     "Dither is a library for dithering images in Go.  It has many dithering
algorithms built-in, and allows you to specify your own.  Correctness is a top
priority, as well as performance.  It is designed to work well on its own, but
also implements interfaces from the standard library, so that it can be
integrated easily in a wide variety of situtations.")
    (license license:mpl2.0)))

(define-public go-github-com-sergeymakinen-go-bmp
  (package
    (name "go-github-com-sergeymakinen-go-bmp")
    (version "1.0.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/sergeymakinen/go-bmp")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0bglvxqmjvgclcfjpkznxyifj5r0bh837c2iw6x1vylc7lqcq07h"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/sergeymakinen/go-bmp"))
    (home-page "https://github.com/sergeymakinen/go-bmp")
    (synopsis "BMP image decoder and encoder")
    (description "Package bmp implements a BMP image decoder and encoder.")
    (license license:bsd-3)))

(define-public go-github-com-sergeymakinen-go-ico
  (package
    (name "go-github-com-sergeymakinen-go-ico")
    (version "1.0.0-beta.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
              (url "https://github.com/sergeymakinen/go-ico")
              (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "115fgnhn1j91zvkigl1x03jkc2dn6vx7qvfmm6l59d24qkfv6cwn"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/sergeymakinen/go-ico"))
    (propagated-inputs
     (list go-github-com-sergeymakinen-go-bmp))
    (home-page "https://github.com/sergeymakinen/go-ico")
    (synopsis "ICO and CUR file decoders and encoders")
    (description "Package ico implements an ICO file decoder and encoder.")
    (license license:bsd-3)))

;;;
;;; Avoid adding new packages to the end of this file. To reduce the chances
;;; of a merge conflict, place them above in alphabetic order:
;;; guix import --insert=gnu/packages/golang-graphics.scm pypi <package-name>.
;;;