| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 |
|
| 22 | (define-module (gnu packages lsof)
|
| 23 | #:use-module ((guix licenses) #:prefix license:)
|
| 24 | #:use-module (guix packages)
|
| 25 | #:use-module (guix git-download)
|
| 26 | #:use-module (guix build-system gnu)
|
| 27 | #:use-module (guix utils)
|
| 28 | #:use-module (gnu packages)
|
| 29 | #:use-module (gnu packages groff)
|
| 30 | #:use-module (gnu packages perl))
|
| 31 |
|
| 32 | (define-public lsof
|
| 33 | (package
|
| 34 | (name "lsof")
|
| 35 | (version "4.94.0")
|
| 36 | (source
|
| 37 | (origin
|
| 38 | (method git-fetch)
|
| 39 | (uri (git-reference
|
| 40 | (url "https://github.com/lsof-org/lsof")
|
| 41 | (commit version)))
|
| 42 | (file-name (git-file-name name version))
|
| 43 | (sha256
|
| 44 | (base32 "0yxv2jg6rnzys49lyrz9yjb4knamah4xvlqj596y6ix3vm4k3chp"))
|
| 45 | (patches (search-patches "lsof-fatal-test-failures.patch"))))
|
| 46 | (build-system gnu-build-system)
|
| 47 | (native-inputs
|
| 48 | `(("groff" ,groff) |
| 49 | ("perl" ,perl)))
|
| 50 | (arguments
|
| 51 | `(#:phases
|
| 52 | (modify-phases %standard-phases
|
| 53 | (replace 'configure
|
| 54 | (lambda _
|
| 55 | (setenv "LSOF_CC" ,(cc-for-target))
|
| 56 | (setenv "LSOF_MAKE" "make")
|
| 57 |
|
| 58 | |
| 59 | |
| 60 | (setenv "LSOF_SYSINFO"
|
| 61 | (string-append "GNU/" (utsname:sysname (uname))
|
| 62 | " (GNU Guix)"))
|
| 63 |
|
| 64 | (invoke "./Configure" "linux")
|
| 65 | #t))
|
| 66 | (add-after 'configure 'patch-timestamps
|
| 67 | (lambda _
|
| 68 | (substitute* "Makefile"
|
| 69 | (("`date`") "`date --date=@1`"))
|
| 70 | #t))
|
| 71 | (add-after 'build 'build-man-page
|
| 72 | (lambda _
|
| 73 | (with-output-to-file "lsof.8"
|
| 74 | (lambda _ (invoke "soelim" "Lsof.8")))
|
| 75 | #t))
|
| 76 | (add-before 'check 'disable-failing-tests
|
| 77 | (lambda _
|
| 78 | (substitute* "tests/Makefile"
|
| 79 | |
| 80 | (("(STDTST=.*) LTsock" _ prefix) prefix)
|
| 81 | |
| 82 | (("(OPTTST=.*) LTnfs" _ prefix) prefix))
|
| 83 | #t))
|
| 84 | (replace 'check
|
| 85 | (lambda* (#:key tests? #:allow-other-keys)
|
| 86 | (when tests?
|
| 87 | (with-directory-excursion "tests"
|
| 88 | |
| 89 | (make-file-writable "TestDB")
|
| 90 | (invoke "./Add2TestDB")
|
| 91 |
|
| 92 | |
| 93 | (invoke "make" "standard" "optional")))
|
| 94 | #t))
|
| 95 | (replace 'install
|
| 96 | (lambda* (#:key outputs #:allow-other-keys)
|
| 97 | (let ((out (assoc-ref outputs "out")))
|
| 98 | (install-file "lsof" (string-append out "/bin"))
|
| 99 | (install-file "lsof.8" (string-append out "/share/man/man8")))
|
| 100 | #t)))))
|
| 101 | (synopsis "Display information about open files")
|
| 102 | (description
|
| 103 | "Lsof stands for LiSt Open Files, and it does just that.
|
| 104 | It lists information about files that are open by the processes running
|
| 105 | on the system.")
|
| 106 | (license (license:fsf-free
|
| 107 | "file://00FAQ"
|
| 108 | "License inspired by zlib, see point 1.9 of 00FAQ in the distribution."))
|
| 109 | (home-page "https://people.freebsd.org/~abe/")))
|