1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages perl))
30 (define-public busybox
37 "https://www.busybox.net/downloads/" name "-"
41 "05mg6rh5smkzfwqfcazkpwy6h6555llsazikqnvwkaf17y8l8gns"))))
42 (build-system gnu-build-system)
45 (modify-phases %standard-phases
47 (lambda _ (zero? (system* "make" "defconfig"))))
50 (substitute* '("testsuite/du/du-s-works"
51 "testsuite/du/du-works")
52 (("/bin") "/etc")) ; there is no /bin but there is a /etc
54 ;; There is no /usr/bin or /bin - replace it with /gnu/store
55 (substitute* "testsuite/cpio.tests"
56 (("/usr/bin") (%store-directory))
57 (("usr") (car (filter (negate string-null?)
58 (string-split (%store-directory) #\/)))))
60 (substitute* "testsuite/date/date-works-1"
61 (("/bin/date") (which "date")))
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"
66 (("-s init") "-s $(cat /proc/1/comm)"))
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")
74 (zero? (system* "make"
77 "SKIP_INTERNET_TESTS=1"
80 (lambda* (#:key outputs #:allow-other-keys)
81 (let ((out (assoc-ref outputs "out")))
84 (string-append "CONFIG_PREFIX=" out)
86 (native-inputs `(("perl" ,perl) ; needed to generate the man pages (pod2man)
87 ;; The following are needed by the tests.
88 ("inetutils" ,inetutils)
89 ("which" ,(@ (gnu packages base) which))
91 (synopsis "Many common UNIX utilities in a single executable")
92 (description "BusyBox combines tiny versions of many common UNIX utilities
93 into a single small executable. It provides a fairly complete environment for
94 any small or embedded system.")
95 (home-page "https://www.busybox.net")
96 ;; Some files are gplv2+