gnu: fish: Update to 2.7.1.
[jackhill/guix/guix.git] / gnu / packages / busybox.scm
CommitLineData
95faa107 1;;; GNU Guix --- Functional package management for GNU
2e5505e5 2;;; Copyright © 2014 John Darrington <jmd@gnu.org>
5897428f 3;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
95faa107
JD
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages busybox)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages admin)
148585c2
AI
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages perl))
95faa107
JD
29
30(define-public busybox
31 (package
32 (name "busybox")
5897428f 33 (version "1.26.2")
95faa107
JD
34 (source (origin
35 (method url-fetch)
36 (uri (string-append
2e5505e5 37 "https://www.busybox.net/downloads/" name "-"
95faa107
JD
38 version ".tar.bz2"))
39 (sha256
40 (base32
5897428f 41 "05mg6rh5smkzfwqfcazkpwy6h6555llsazikqnvwkaf17y8l8gns"))))
95faa107
JD
42 (build-system gnu-build-system)
43 (arguments
6d96af5e 44 '(#:phases
84d08af6
EF
45 (modify-phases %standard-phases
46 (replace 'configure
47 (lambda _ (zero? (system* "make" "defconfig"))))
48 (replace 'check
49 (lambda _
6d96af5e
EF
50 (substitute* '("testsuite/du/du-s-works"
51 "testsuite/du/du-works")
84d08af6 52 (("/bin") "/etc")) ; there is no /bin but there is a /etc
95faa107 53
6d96af5e
EF
54 ;; There is no /usr/bin or /bin - replace it with /gnu/store
55 (substitute* "testsuite/cpio.tests"
84d08af6
EF
56 (("/usr/bin") (%store-directory))
57 (("usr") (car (filter (negate string-null?)
6d96af5e 58 (string-split (%store-directory) #\/)))))
95faa107 59
6d96af5e 60 (substitute* "testsuite/date/date-works-1"
84d08af6 61 (("/bin/date") (which "date")))
95faa107 62
6d96af5e
EF
63 ;; The pidof tests assume that pid 1 is called "init" but that is not
64 ;; true in guix build environment
65 (substitute* "testsuite/pidof.tests"
84d08af6 66 (("-s init") "-s $(cat /proc/1/comm)"))
6d96af5e
EF
67
68 ;; This test cannot possibly pass.
69 ;; It is trying to test that "which ls" returns "/bin/ls" when PATH is not set.
70 ;; However, this relies on /bin/ls existing. Which it does not in guix.
71 (delete-file "testsuite/which/which-uses-default-path")
72 (rmdir "testsuite/which")
95faa107 73
6d96af5e
EF
74 (zero? (system* "make"
75 ;; "V=1"
76 "SKIP_KNOWN_BUGS=1"
77 "SKIP_INTERNET_TESTS=1"
78 "check"))))
84d08af6
EF
79 (replace 'install
80 (lambda* (#:key outputs #:allow-other-keys)
81 (let ((out (assoc-ref outputs "out")))
82 (zero?
83 (system* "make"
84 (string-append "CONFIG_PREFIX=" out)
85 "install"))))))))
95faa107
JD
86 (native-inputs `(("perl" ,perl) ; needed to generate the man pages (pod2man)
87 ;; The following are needed by the tests.
88 ("inetutils" ,inetutils)
2e5505e5 89 ("which" ,(@ (gnu packages base) which))
95faa107
JD
90 ("zip" ,zip)))
91 (synopsis "Many common UNIX utilities in a single executable")
92 (description "BusyBox combines tiny versions of many common UNIX utilities
24753e69
JD
93into a single small executable. It provides a fairly complete environment for
94any small or embedded system.")
2e5505e5 95 (home-page "https://www.busybox.net")
95faa107
JD
96 ;; Some files are gplv2+
97 (license gpl2)))