projects/guix·blob ruby-team · refs

485 lines · 18.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 John Darringon <[email protected]>
3;;; Copyright © 2016, 2020, 2021 Efraim Flashner <[email protected]>
4;;; Copyright © 2017 Hartmut Goebel <[email protected]>
5;;; Copyright © 2018, 2019, 2022 Tobias Geerinckx-Rice <[email protected]>
6;;; Copyright © 2019 Guillaume Le Vaillant <[email protected]>
7;;; Copyright © 2020 Vinicius Monego <[email protected]>
8;;; Copyright © 2020 Leo Famulari <[email protected]>
9;;; Copyright © 2023 Ricardo Wurmus <[email protected]>
10;;; Copyright © 2024 Nicolas Graves <[email protected]>
11;;; Copyright © 2024, 2025 Janneke Nieuwenhuizen <[email protected]>
12;;; Copyright © 2025 Maxim Cournoyer <[email protected]>
13;;; Copyright © 2026 Orahcio Felício de Sousa <[email protected]>
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages aidc)
31 #:use-module (gnu packages)
32 #:use-module (guix gexp)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix utils)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages check)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages elf)
42 #:use-module (gnu packages imagemagick)
43 #:use-module (gnu packages gettext)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gtk)
46 #:use-module (gnu packages image)
47 #:use-module (gnu packages perl)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages python)
50 #:use-module (gnu packages python-xyz)
51 #:use-module (gnu packages python-build)
52 #:use-module (gnu packages pretty-print)
53 #:use-module (gnu packages qt)
54 #:use-module (gnu packages video)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system pyproject)
57 #:use-module (guix build-system qt)
58 #:use-module (guix build-system gnu)
59 #:use-module (guix build-system go)
60 #:use-module (guix build-system glib-or-gtk))
61
62(define-public python-pyzbar
63 (package
64 (name "python-pyzbar")
65 (version "0.1.9")
66 (source
67 (origin
68 (method git-fetch)
69 (uri (git-reference
70 (url "https://github.com/NaturalHistoryMuseum/pyzbar")
71 (commit (string-append "v" version))))
72 (file-name (git-file-name name version))
73 (sha256
74 (base32 "1df1dvr8i2wyr2vw5pq8rlz2wm4xqda0wbgja19bvql1m9im11ph"))))
75 (build-system pyproject-build-system)
76 (arguments
77 (list
78 #:test-flags
79 ;; This tests if find_library was called once, but we remove the call in
80 ;; the stage below to make the library find libzbar.
81 #~(list #$@(map (lambda (test) (string-append "--deselect="
82 "pyzbar/tests/"
83 "test_zbar_library.py::"
84 "TestLoad::"
85 test))
86 (list "test_found_non_windows"
87 "test_not_found_non_windows")))
88 #:phases
89 #~(modify-phases %standard-phases
90 (add-before 'build 'set-library-file-name
91 (lambda* (#:key inputs #:allow-other-keys)
92 (substitute* "pyzbar/zbar_library.py"
93 (("find_library\\('zbar'\\)")
94 (format #f "~s"
95 (search-input-file inputs "/lib/libzbar.so.0")))))))))
96 (native-inputs
97 (list pkg-config
98 python-numpy
99 python-pillow
100 python-pytest
101 python-setuptools))
102 (inputs
103 (list zbar))
104 (home-page "https://github.com/NaturalHistoryMuseum/pyzbar/")
105 (synopsis "Read one-dimensional barcodes and QR codes")
106 (description
107 "Read one-dimensional barcodes and QR codes using the zbar library.
108
109Features:
110
111@itemize
112@item Pure python
113@item Works with PIL / Pillow images, OpenCV / numpy ndarrays, and raw bytes
114@item Decodes locations of barcodes
115@item No dependencies, other than the zbar library itself
116@end itemize")
117 (license license:expat)))
118
119(define-public python-zbarlight
120 (package
121 (name "python-zbarlight")
122 (version "4.0")
123 (source
124 (origin
125 (method git-fetch)
126 (uri (git-reference
127 (url "https://github.com/Polyconseil/zbarlight")
128 (commit version)))
129 (file-name (git-file-name name version))
130 (sha256
131 (base32 "1q1nfc7g7bl9y63fwvnq1fcgqk79inc2hhw3ilvyw0nk0g74v8cm"))))
132 (build-system pyproject-build-system)
133 (propagated-inputs (list python-pillow))
134 (inputs (list zbar))
135 (native-inputs (list python-pytest python-setuptools))
136 (home-page "https://github.com/Polyconseil/zbarlight")
137 (synopsis "Simple Python wrapper for the zbar barcode library")
138 (description "Zbarlight is a simple wrapper for the zbar library. It can
139read all zbar supported codes.")
140 (license license:bsd-3)))
141
142(define-public zint
143 (package
144 (name "zint")
145 (version "2.16.0")
146 (source (origin
147 (method git-fetch)
148 (uri (git-reference
149 (url "https://github.com/zint/zint")
150 (commit version)))
151 (file-name (git-file-name name version))
152 (sha256
153 (base32
154 "1zpv9ar1kfjl3bb27jc8hd8601zcda9yv4dz1jhxfhdsg6v4cdg7"))))
155 (build-system cmake-build-system)
156 (arguments
157 (list #:disallowed-references (list qtbase)
158 #:parallel-tests? #f ;test suite fails otherwise
159 #:configure-flags #~(list "-DZINT_TEST=ON"
160 "-DZINT_UNINSTALL=OFF")))
161 (native-inputs (list pkg-config))
162 (inputs (list libpng))
163 (synopsis "Barcode encoding library")
164 (description "Zint is a suite of programs to allow easy encoding of data in
165any of the wide range of public domain barcode standards and to allow
166integration of this capability into your own programs.")
167 (home-page "https://www.zint.org.uk/")
168 (license (list license:bsd-3 license:gpl3+))))
169
170(define-public zint-with-qt
171 (package/inherit zint
172 (name "zint-with-qt")
173 (build-system qt-build-system)
174 (arguments (substitute-keyword-arguments arguments
175 ((#:disallowed-references references)
176 (delete qtbase references))
177 ((#:qtbase _ #f)
178 qtbase)
179 ((#:configure-flags flags ''())
180 #~(cons "-DZINT_QT6=ON" #$flags))))
181 (inputs (modify-inputs inputs
182 ;; The UI library of qttools is linked to; hence it must be used
183 ;; as an input rather than a native input.
184 (append qtsvg qttools)))
185 (synopsis "Barcode encoding library (with graphical user interface)")))
186
187(define-public zxing-cpp
188 (package
189 (name "zxing-cpp")
190 (version "2.3.0")
191 (source (origin
192 (method git-fetch)
193 (uri (git-reference
194 (url "https://github.com/zxing-cpp/zxing-cpp")
195 (commit (string-append "v" version))))
196 (file-name (git-file-name name version))
197 (sha256
198 (base32
199 "1hdr73fllnsp3zpmrhw6cjla39lihwg1khgvddsf4v57a0lmiy3f"))))
200 (build-system cmake-build-system)
201 (arguments
202 (list
203 #:configure-flags
204 #~(list "-DZXING_READERS=ON"
205 "-DZXING_WRITERS=BOTH"
206 "-DZXING_DEPENDENCIES=LOCAL"
207 "-DZXING_EXAMPLES=OFF" ;requires stb.pc
208 "-DZXING_USE_BUNDLED_ZINT=OFF"
209 "-DZXING_UNIT_TESTS=ON")
210 #:phases
211 #~(modify-phases %standard-phases
212 (add-after 'install 'install-headers
213 (lambda* (#:key source #:allow-other-keys)
214 (invoke "sh" "-c"
215 (string-append "cp " source "/core/src/*.h "
216 #$output "/include/ZXing/")))))))
217 (native-inputs (list googletest pkg-config))
218 (inputs (list libpng zint zlib))
219 (synopsis "C++ port of ZXing")
220 (description "ZXing-CPP is a barcode scanning library.")
221 (home-page "https://github.com/zxing-cpp/zxing-cpp")
222 (license license:asl2.0)))
223
224(define-public barcode
225 (package
226 (name "barcode")
227 (version "0.99")
228 (source (origin
229 (method url-fetch)
230 (uri (string-append "mirror://gnu/barcode/barcode-"
231 version ".tar.xz"))
232 (sha256
233 (base32
234 "1indapql5fjz0bysyc88cmc54y8phqrbi7c76p71fgjp45jcyzp8"))))
235 (build-system gnu-build-system)
236 (arguments
237 ;; Fix build with GCC 10.
238 '(#:configure-flags '("CFLAGS=-fcommon")))
239 (synopsis "Convert text strings to printed bars in various standards")
240 (description "GNU Barcode is a flexible tool to produce printed barcodes
241from text strings. It supports a variety of encoding standards and sizing
242measurements. Barcodes can be output in PostScript or Encapsulated PostScript
243formats.")
244 (license license:gpl3+)
245 (home-page "https://www.gnu.org/software/barcode/")))
246
247(define-public qrencode
248 (package
249 (name "qrencode")
250 (version "4.1.1")
251 (source (origin
252 (method url-fetch)
253 (uri (string-append "https://fukuchi.org/works/qrencode/"
254 "qrencode-" version ".tar.bz2"))
255 (sha256
256 (base32
257 "08v9d8jn26bva2a8x4hghq3mgl8zcid393iqkidwyhc05xrxjmg4"))))
258 (build-system gnu-build-system)
259 (arguments
260 `(#:configure-flags '("--with-tests")
261 #:phases
262 (modify-phases %standard-phases
263 (replace 'check
264 (lambda* (#:key tests? #:allow-other-keys)
265 (when tests?
266 (with-directory-excursion "tests"
267 (invoke "./test_basic.sh")))
268 #t)))))
269 (inputs (list libpng))
270 (native-inputs (list pkg-config))
271 (synopsis "Encode data into a QR Code symbol")
272 (description "Libqrencode is a C library for encoding data in a QR Code
273symbol, a kind of 2D symbology that can be scanned by handy terminals such as
274a mobile phone with CCD. The capacity of QR Code is up to 7000 digits or 4000
275characters, and is highly robust.")
276 (license license:lgpl2.1+)
277 (home-page "https://fukuchi.org/works/qrencode")))
278
279(define-public go-github-com-mdp-qrterminal
280 (package
281 (name "go-github-com-mdp-qrterminal")
282 (version "1.0.1")
283 (source
284 (origin
285 (method git-fetch)
286 (uri (git-reference
287 (url "https://github.com/mdp/qrterminal")
288 (commit (string-append "v" version))))
289 (file-name (git-file-name name version))
290 (sha256
291 (base32 "1f2zrdv9sw2a6ni1712d27cayr3f8whqagx6f0yglc5gdd9f3i2n"))))
292 (build-system go-build-system)
293 (arguments
294 (list
295 #:import-path "github.com/mdp/qrterminal"))
296 (propagated-inputs (list go-rsc-io-qr))
297 (home-page "https://github.com/mdp/qrterminal")
298 (synopsis "QR codes in your terminal")
299 (description
300 "Golang library for generating QR codes in the terminal. Originally this
301was a port of the NodeJS version. Recently it's been updated to allow for
302smaller code generation using ASCII 'half blocks'.")
303 (license license:expat)))
304
305(define-public go-rsc-io-qr
306 (package
307 (name "go-rsc-io-qr")
308 ;; 0.2.0 (2018-06-05); the latest changes are from <2022-04-17>.
309 (properties '((commit . "b6857d426aa506d5bf7efb8f73928d72bcf4e73d")
310 (revision . "0")))
311 (version (git-version "0.2.0"
312 (assoc-ref properties 'revision)
313 (assoc-ref properties 'commit)))
314 (source
315 (origin
316 (method git-fetch)
317 (uri (git-reference
318 (url "https://github.com/rsc/qr")
319 (commit (assoc-ref properties 'commit))))
320 (file-name (git-file-name name version))
321 (sha256
322 (base32 "180njqm6q1yilfknagi862321gq6b9hi27wp8s6v7qxwb5hd5ps1"))))
323 (build-system go-build-system)
324 (arguments
325 (list
326 #:import-path "rsc.io/qr"
327 ;; See: <https://github.com/rsc/qr/issues/5>.
328 #:test-flags #~(list "-skip" "TestVersion")))
329 (propagated-inputs
330 (list qrencode))
331 (home-page "https://github.com/rsc/qr")
332 (synopsis "Basic QR encoder")
333 (description "Package @code{qr} encodes QR codes.")
334 (license license:bsd-3)))
335
336(define-public libdmtx
337 (package
338 (name "libdmtx")
339 (version "0.7.7")
340 (source
341 (origin
342 (method git-fetch)
343 (uri (git-reference
344 (url "https://github.com/dmtx/libdmtx")
345 (commit (string-append "v" version))))
346 (file-name (git-file-name name version))
347 (sha256
348 (base32 "0s95gplvb6x7gnl48yn7ywa9r15lfm8k2m60wm9i7w75ay4bq32i"))))
349 (build-system gnu-build-system)
350 (arguments
351 (list #:configure-flags
352 #~(list "--disable-static")))
353 (native-inputs
354 (list autoconf automake libtool pkg-config))
355 (home-page "https://github.com/dmtx")
356 (synopsis "Library for reading and writing Data Matrix 2D barcodes")
357 (description "libdmtx is software for reading and writing Data Matrix 2D
358barcodes of the modern ECC200 variety. libdmtx is a shared library, allowing
359C/C++ programs to use its capabilities without restrictions or overhead.")
360 (license license:bsd-3)))
361
362(define-public dmtx-utils
363 (package
364 (name "dmtx-utils")
365 (version "0.7.6")
366 (source
367 (origin
368 (method git-fetch)
369 (uri (git-reference
370 (url "https://github.com/dmtx/dmtx-utils/")
371 (commit (string-append "v" version))))
372 (file-name (git-file-name name version))
373 (sha256
374 "06m3qncqdlcnmw83n95yrx2alaq6bld320ax26z4ndnla41yk0p4")))
375 (build-system gnu-build-system)
376 (native-inputs (list autoconf automake libtool pkg-config))
377 (inputs (list libdmtx imagemagick libjpeg-turbo))
378 (home-page "https://github.com/dmtx/dmtx-utils/")
379 (synopsis "Utilities for working with Data Matrix barcodes")
380 (description
381 "libdmtx is a software library that enables programs to read and write Data
382Matrix barcodes of the modern ECC200 variety. This package, dmtx-utils,
383provides command line utilities that allow scripts and command line users to
384use libdmtx functionality.
385
386This package includes the following programs:
387@enumerate
388@item @code{dmtxquery}: Extract information from dmtxread output.
389@item @code{dmtxread}: Scan Data Matrix barcodes.
390@item @code{dmtxwrite}: Create Data Matrix barcodes.
391@end enumerate")
392 (license (list license:lgpl2.1 license:gpl2))))
393
394;; XXX: qt variant utils are broken: zbarcam-qt fails with segmentation fault.
395(define-public zbar
396 (package
397 (name "zbar")
398 (version "0.23.93")
399 (source
400 (origin
401 (method git-fetch)
402 (uri
403 (git-reference
404 (url "https://github.com/mchehab/zbar")
405 (commit version)))
406 (file-name (git-file-name name version))
407 (sha256
408 (base32 "0x71clkkm4w765c2d5h3svr29w08dj03r6785f9jwqx5r4ral0za"))))
409 (build-system glib-or-gtk-build-system)
410 (arguments
411 (list
412 #:configure-flags
413 #~(list "--disable-static"
414 "--without-dbus" ;See <https://github.com/mchehab/zbar/issues/104>
415 "--with-gtk=auto"
416 "--with-python=auto")))
417 (native-inputs
418 (list autoconf
419 automake
420 gettext-minimal
421 `(,glib "bin")
422 gobject-introspection
423 libtool
424 patchelf
425 pkg-config
426 python-wrapper))
427 (inputs
428 (list imagemagick
429 libjpeg-turbo
430 perl
431 python
432 v4l-utils))
433 (propagated-inputs
434 ;; These are in 'requires' field of .pc files.
435 (list glib gtk+))
436 (synopsis "Bar code reader")
437 (description
438 "ZBar can read barcodes from various sources, such as video streams,
439image files, and raw intensity sensors. It supports EAN-13/UPC-A, UPC-E,
440EAN-8, Code 128, Code 93, Code 39, Codabar, Interleaved 2 of 5, QR Code and SQ
441Code. Included with the library are basic applications for decoding captured
442bar code images and using a video device (e.g. webcam) as a bar code scanner.
443For application developers, language bindings are included for C, C++ and
444Python as well as GUI widgets for GTK and Qt.")
445 (home-page "https://github.com/mchehab/zbar")
446 (license license:lgpl2.1+)))
447
448(define-public zbar-minimal
449 (package/inherit zbar
450 (name "zbar-minimal")
451 (build-system gnu-build-system)
452 (arguments
453 (substitute-keyword-arguments arguments
454 ((#:configure-flags flags)
455 #~(cons* "--with-gtk=no" (delete "--with-gtk=auto" #$flags)))
456 ((#:disallowed-references _ '())
457 (list qtbase gtk+))))
458 (propagated-inputs
459 (modify-inputs propagated-inputs
460 (delete "gtk+")))))
461
462(define-public qrcodegen-cpp
463 (package
464 (name "qrcodegen-cpp")
465 (version "1.8.0")
466 (source (origin
467 (method git-fetch)
468 (uri (git-reference
469 (url "https://github.com/nayuki/QR-Code-generator")
470 (commit (string-append "v" version))))
471 (file-name (git-file-name name version))
472 (patches (search-patches "qrcodegen-cpp-cmake.patch"))
473 (sha256
474 (base32
475 "0dk9ci5gchxa8gh0hyhlj3d5jwxqlnfm85xyp791ldaia14bkj39"))))
476 (build-system cmake-build-system)
477 (arguments
478 (list #:configure-flags
479 #~'("-DBUILD_TESTS=ON"
480 "-DBUILD_SHARED_LIBS=ON")))
481 (synopsis "QR Code generator library")
482 (description "qrcodegen-cpp is a QR code generator library in C++. The
483project also offers Java, Javascript, Python, C, and Rust implementations.")
484 (home-page "https://www.nayuki.io/page/qr-code-generator-library")
485 (license license:expat)))