Add aacircuit

Evgeny PisemskySun Feb 09 12:00:13+0300 2025

c895325

Add aacircuit

modules/cogd/packages/engineering.scm

77
(use-modules (guix packages)
88
             (guix download)
99
             (guix git-download)
10+
             (guix gexp)
1011
             (guix build-system python)
1112
             (guix build-system pyproject)
1213
             ((guix licenses) #:prefix license:)
1314
             ((gnu packages engineering) #:prefix guix:)
15+
             (gnu packages check)
16+
             (gnu packages glib)
17+
             (gnu packages gtk)
1418
             (gnu packages image-processing)
1519
             (gnu packages python)
1620
             (gnu packages python-build)
1721
             (gnu packages python-xyz)
22+
             (gnu packages xorg)
23+
             (gnu packages xdisorg)
1824
             (cogd packages python-xyz))
1925
2026
(define-public pcb2gcode

3440
          (base32
3541
           "19hyzd1601l51bwlv43j8l602nfacbjwqf54m5xsmj50718bcks2")))))))
3642
43+
(define-public aacircuit
44+
  (let ((commit "68634860b43d2be96cd23305568408937e1b93f2")
45+
        (revision "0"))
46+
    (package
47+
      (name "aacircuit")
48+
      (version (git-version "0" revision commit))
49+
      (source
50+
       (origin
51+
         (method git-fetch)
52+
         (uri (git-reference
53+
               (url "https://github.com/Blokkendoos/AACircuit")
54+
               (commit commit)))
55+
         (file-name (git-file-name name version))
56+
         (sha256
57+
          (base32 "0g81ninpkdr0qvd3x487gi76x6ln7751y1ca263rg0zs6vxk2k0x"))))
58+
      (build-system python-build-system)
59+
      (arguments
60+
       (list
61+
        ;; The setup.py is for mac only.
62+
        #:use-setuptools? #f
63+
        #:phases #~(modify-phases %standard-phases
64+
                     (delete 'build)
65+
                     (replace 'install
66+
                       (lambda* (#:key inputs outputs #:allow-other-keys)
67+
                         (let* ((sitedir (site-packages inputs outputs))
68+
                                (moddir (string-append sitedir "/application"))
69+
                                (bindir (string-append #$output "/bin"))
70+
                                (program (string-append bindir "/aacircuit")))
71+
                           (copy-recursively "application" moddir)
72+
                           (mkdir-p bindir)
73+
                           (copy-file "aacircuit.py" program)
74+
                           (chmod program #o555))))
75+
                     (replace 'check
76+
                       (lambda* (#:key tests? #:allow-other-keys)
77+
                         (when tests?
78+
                           (setenv "HOME" "/tmp")
79+
                           ;; Exclude tests intended for visual review.
80+
                           (setenv "NOSE_EXCLUDE"
81+
                                   (string-join '("test_export_pdf"
82+
                                                  "test_import_aacircuit_export_pdf")
83+
                                                ","))
84+
                           (invoke "xvfb-run" "./testrunner.sh")))))))
85+
      (native-inputs (list python-nose python-flake8 xvfb-run))
86+
      (propagated-inputs (list gtk+
87+
                               python-bresenham
88+
                               python-platformdirs
89+
                               python-pycairo
90+
                               python-pyclip
91+
                               python-pygobject
92+
                               python-pypubsub))
93+
      (home-page "https://github.com/Blokkendoos/AACircuit")
94+
      (synopsis "Draw electronic circuits with ASCII characters")
95+
      (description
96+
       "This is a pythonized, kind of reverse engineered version of original
97+
AACircuit written by Andreas Weber in Borland Delphi.  The idea and
98+
GUI layout are also taken from the original.")
99+
      (license license:gpl3+))))
100+
37101
(define-public bcnc
38102
  (package
39103
    (name "bcnc")