gnu: python-pandas: Fix build on 32-bit.
[jackhill/guix/guix.git] / gnu / packages / busybox.scm
CommitLineData
95faa107 1;;; GNU Guix --- Functional package management for GNU
2e5505e5
EF
2;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3;;; Copyright © 2016 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)
27 #:use-module (gnu packages perl)
28 #:use-module (gnu packages zip))
29
30(define-public busybox
31 (package
32 (name "busybox")
7604106f 33 (version "1.26.0")
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
7604106f 41 "0k0g3hk58m99c2sfq97ngnixb2rv2wzyhv3z00lxaw78bqvjglis"))))
95faa107
JD
42 (build-system gnu-build-system)
43 (arguments
a124bbd2 44 `(#:phases
84d08af6
EF
45 (modify-phases %standard-phases
46 (replace 'configure
47 (lambda _ (zero? (system* "make" "defconfig"))))
48 (replace 'check
49 (lambda _
95faa107 50 (substitute* '("testsuite/du/du-s-works"
84d08af6
EF
51 "testsuite/du/du-works")
52 (("/bin") "/etc")) ; there is no /bin but there is a /etc
95faa107
JD
53
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?)
58 (string-split (%store-directory) #\/)))))
95faa107
JD
59
60 (substitute* "testsuite/date/date-works-1"
84d08af6 61 (("/bin/date") (which "date")))
95faa107
JD
62
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)"))
95faa107 67
95faa107
JD
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")
73
a124bbd2 74 (zero? (system* "make"
95faa107
JD
75 ;; "V=1"
76 "SKIP_KNOWN_BUGS=1"
77 "SKIP_INTERNET_TESTS=1"
84d08af6
EF
78 "check"))))
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)))