# guix.scm -rw-r--r-- 2.8 KiB View raw
                                                                                
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
(use-modules
  (guix build-system gnu)
  (guix gexp)
  (guix git-download)
  ((guix licenses) #:prefix license:)
  (guix packages)
  (gnu packages guile)
  (gnu packages man)
  (gnu packages package-management))

(define guix-deps/devel
  (package
    (name "guix-deps-devel")
    (version "HEAD")
    (source (local-file (dirname (current-filename))
                        #:recursive? #t))
    (build-system gnu-build-system)
    (arguments
      (list #:modules '((ice-9 popen)
                        (ice-9 textual-ports)
                        (srfi srfi-26))
            #:phases
            #~(modify-phases %standard-phases
                (delete 'configure 'build 'check)
                (replace 'install
                  (lambda* (#:key outputs inputs #:allow-other-keys)
                    (let* ((out (assoc-ref outputs "out"))
                           (moddir (string-append out "/share/guile/site/3.0"))
                           (objdir (string-append out "/lib/guile/3.0/site-ccache"))
                           (guix (assoc-ref inputs "guix")))
                      (for-each (lambda (module)
                                  (install-file (string-append module ".scm")
                                                (string-append moddir "/" module ".scm"))
                                  (invoke "guild" "compile"
                                          "-L" (string-append guix "/share/guile/site/3.0")
                                          (string-append module ".scm")
                                          "-o" (string-append objdir "/" module ".go")))
                                (list "guix/extensions/deps" "guix/scripts/deps")))))
                (add-after 'install 'install-manpage
                  (lambda* (#:key outputs #:allow-other-keys)
                    (let ((out (assoc-ref outputs "out"))
                          (pipe (open-input-output-pipe "scdoc")))
                      (display (get-string-all "guix-deps.1.scd") pipe)
                      (call-with-output-file
                        (string-append out "/share/man/man1/guix-deps.1")
                        (cute display (get-string-all pipe) <>))
                      (close-pipe pipe)))))))
    (native-inputs (list guile-3.0-latest guix scdoc))
    (home-page "https://sr.ht/~unmatched-paren/guix-deps")
    (synopsis "Recursive listing and filtering of Guix package dependencies")
    (description
     "This package provides a simple @command{guix deps} command for recursive
filtering and listing of Guix package dependencies. It lists packages in an
order such that a package never appears before a package it depends on. It was
written to ease upstreaming of packages from third-party channels, though it
most likely has other uses.")
    (license (list license:gpl3+ license:cc-by-sa4.0))))

guix-deps/devel