gnu: igt-gpu-tools: Don't use NAME in source URI.
[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>
e9ab4b40 3;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
f7705d4c 4;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
42140fd4 5;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
95faa107
JD
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages busybox)
23 #:use-module (guix licenses)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages admin)
42140fd4 29 #:use-module (gnu packages algebra)
148585c2
AI
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages perl))
95faa107
JD
32
33(define-public busybox
34 (package
35 (name "busybox")
56c18075 36 (version "1.29.3")
95faa107
JD
37 (source (origin
38 (method url-fetch)
39 (uri (string-append
2e5505e5 40 "https://www.busybox.net/downloads/" name "-"
95faa107
JD
41 version ".tar.bz2"))
42 (sha256
43 (base32
56c18075 44 "1dzg45vgy2w1xcd3p6h8d76ykhabbvk1h0lf8yb24ikrwlv8cr4p"))))
95faa107
JD
45 (build-system gnu-build-system)
46 (arguments
6d96af5e 47 '(#:phases
84d08af6 48 (modify-phases %standard-phases
e9ab4b40
EF
49 (add-before 'configure 'disable-taskset
50 ;; This feature fails its tests in the build environment,
51 ;; was default 'n' until after 1.26.2.
52 (lambda _
53 (substitute* "util-linux/taskset.c"
54 (("default y") "default n"))
55 #t))
84d08af6 56 (replace 'configure
f7705d4c 57 (lambda _ (invoke "make" "defconfig")))
84d08af6
EF
58 (replace 'check
59 (lambda _
6d96af5e
EF
60 (substitute* '("testsuite/du/du-s-works"
61 "testsuite/du/du-works")
84d08af6 62 (("/bin") "/etc")) ; there is no /bin but there is a /etc
95faa107 63
6d96af5e
EF
64 ;; There is no /usr/bin or /bin - replace it with /gnu/store
65 (substitute* "testsuite/cpio.tests"
84d08af6
EF
66 (("/usr/bin") (%store-directory))
67 (("usr") (car (filter (negate string-null?)
6d96af5e 68 (string-split (%store-directory) #\/)))))
95faa107 69
6d96af5e 70 (substitute* "testsuite/date/date-works-1"
84d08af6 71 (("/bin/date") (which "date")))
95faa107 72
6d96af5e
EF
73 ;; The pidof tests assume that pid 1 is called "init" but that is not
74 ;; true in guix build environment
75 (substitute* "testsuite/pidof.tests"
84d08af6 76 (("-s init") "-s $(cat /proc/1/comm)"))
6d96af5e
EF
77
78 ;; This test cannot possibly pass.
79 ;; It is trying to test that "which ls" returns "/bin/ls" when PATH is not set.
80 ;; However, this relies on /bin/ls existing. Which it does not in guix.
81 (delete-file "testsuite/which/which-uses-default-path")
82 (rmdir "testsuite/which")
95faa107 83
f7705d4c
TGR
84 (invoke "make"
85 ;; "V=1"
86 "SKIP_KNOWN_BUGS=1"
87 "SKIP_INTERNET_TESTS=1"
88 "check")))
84d08af6
EF
89 (replace 'install
90 (lambda* (#:key outputs #:allow-other-keys)
91 (let ((out (assoc-ref outputs "out")))
f7705d4c
TGR
92 (invoke "make"
93 (string-append "CONFIG_PREFIX=" out)
94 "install")))))))
95faa107
JD
95 (native-inputs `(("perl" ,perl) ; needed to generate the man pages (pod2man)
96 ;; The following are needed by the tests.
97 ("inetutils" ,inetutils)
2e5505e5 98 ("which" ,(@ (gnu packages base) which))
95faa107
JD
99 ("zip" ,zip)))
100 (synopsis "Many common UNIX utilities in a single executable")
101 (description "BusyBox combines tiny versions of many common UNIX utilities
24753e69
JD
102into a single small executable. It provides a fairly complete environment for
103any small or embedded system.")
2e5505e5 104 (home-page "https://www.busybox.net")
95faa107
JD
105 ;; Some files are gplv2+
106 (license gpl2)))
42140fd4
EF
107
108(define-public toybox
109 (package
110 (name "toybox")
111 (version "0.7.8")
112 (source (origin
113 (method url-fetch)
114 (uri (string-append
115 "https://landley.net/toybox/downloads/toybox-"
116 version ".tar.gz"))
117 (sha256
118 (base32
119 "1mlqv5hsvy8ii6m698hq6rc316klwv44jlr034knwg6bk1lf2qj9"))))
120 (build-system gnu-build-system)
121 (arguments
122 '(#:phases
123 (modify-phases %standard-phases
124 (add-before 'configure 'set-environment-variables
125 (lambda _
126 (setenv "CC" (which "gcc"))
127 (setenv "HOSTCC" (which "gcc"))
128 #t))
129 (replace 'configure
130 (lambda _ (invoke "make" "defconfig")))
131 (replace 'install
132 (lambda* (#:key outputs #:allow-other-keys)
133 (let ((out (assoc-ref outputs "out")))
134 (invoke "make"
135 (string-append "PREFIX=" out)
136 "install")))))
137 #:test-target "tests"))
138 (native-inputs `(("bc" ,bc)))
139 (synopsis "Many common UNIX utilities in a single executable")
140 (description "ToyBox combines tiny versions of many common UNIX utilities
141into a single small executable. It provides a fairly complete environment for
142any small or embedded system.")
143 (home-page "https://landley.net/toybox/")
144 (license bsd-2)))