2014-05-27 02:53:30 -04:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2016-06-30 12:04:08 -04:00
|
|
|
|
;;; Copyright © 2014 John Darrington <jmd@gnu.org>
|
2020-12-11 05:04:15 -05:00
|
|
|
|
;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
|
2021-01-14 13:59:14 -05:00
|
|
|
|
;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
|
2014-05-27 02:53:30 -04:00
|
|
|
|
;;;
|
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
|
;;; your option) any later version.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
|
;;;
|
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
(define-module (gnu packages busybox)
|
|
|
|
|
#:use-module (guix licenses)
|
|
|
|
|
#:use-module (guix packages)
|
|
|
|
|
#:use-module (guix download)
|
2020-12-11 05:17:51 -05:00
|
|
|
|
#:use-module (guix utils)
|
2014-05-27 02:53:30 -04:00
|
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
|
#:use-module (gnu packages)
|
|
|
|
|
#:use-module (gnu packages admin)
|
2018-12-11 07:39:40 -05:00
|
|
|
|
#:use-module (gnu packages algebra)
|
gnu: Move contents of zip module into compression module.
* gnu/packages/zip.scm (zip, unzip, zziplib, perl-zip): Move to...
* gnu/packages/compression.scm: ...here.
* gnu/packages/zip.scm: Delete file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Unregister deleted file.
* po/packages/POTFILES.in: Unregister deleted file.
* gnu/packages/{audio, avr, bioinformatics, busybox, cdrom, ci, compression,
docbook, documentation, fonts, fpga, game-development, games, gl, gnome,
gnuzilla, graphics, guile, haskell, image, java, kodi, ldc, libreoffice,
markup, maths, mc, monitoring, music, php, pretty-print, python, scheme,
smalltalk, statistics, synergy, tex, textutils, video, web-browsers, xml,
zip}.scm, guix/build-system/{ant, font}.scm, guix/{download, packages}.scm:
Adapt module import.
2017-06-12 14:40:01 -04:00
|
|
|
|
#:use-module (gnu packages compression)
|
|
|
|
|
#:use-module (gnu packages perl))
|
2014-05-27 02:53:30 -04:00
|
|
|
|
|
|
|
|
|
(define-public busybox
|
|
|
|
|
(package
|
|
|
|
|
(name "busybox")
|
2021-03-19 07:00:13 -04:00
|
|
|
|
(version "1.33.0")
|
2014-05-27 02:53:30 -04:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (string-append
|
2016-06-30 12:04:08 -04:00
|
|
|
|
"https://www.busybox.net/downloads/" name "-"
|
2014-05-27 02:53:30 -04:00
|
|
|
|
version ".tar.bz2"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2021-03-19 07:00:13 -04:00
|
|
|
|
"1gcg7ggg79apdlp5qnrh9pbjl10fx30yn33p21kxqpm8j4f6hs6m"))
|
2021-03-19 06:56:38 -04:00
|
|
|
|
(patches (search-patches "busybox-CVE-2021-28831.patch"))))
|
2014-05-27 02:53:30 -04:00
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
|
(arguments
|
2017-06-21 03:13:31 -04:00
|
|
|
|
'(#:phases
|
2016-06-30 12:09:40 -04:00
|
|
|
|
(modify-phases %standard-phases
|
2020-06-11 17:08:45 -04:00
|
|
|
|
(add-before 'configure 'disable-timestamps
|
|
|
|
|
(lambda _
|
|
|
|
|
(setenv "KCONFIG_NOTIMESTAMP" "1")
|
|
|
|
|
#t))
|
2018-07-19 14:27:46 -04:00
|
|
|
|
(add-before 'configure 'disable-taskset
|
|
|
|
|
;; This feature fails its tests in the build environment,
|
|
|
|
|
;; was default 'n' until after 1.26.2.
|
|
|
|
|
(lambda _
|
|
|
|
|
(substitute* "util-linux/taskset.c"
|
|
|
|
|
(("default y") "default n"))
|
|
|
|
|
#t))
|
2016-06-30 12:09:40 -04:00
|
|
|
|
(replace 'configure
|
2020-06-30 09:04:17 -04:00
|
|
|
|
(lambda* (#:key make-flags #:allow-other-keys)
|
|
|
|
|
(apply invoke "make" "defconfig" make-flags)))
|
2019-06-17 09:26:41 -04:00
|
|
|
|
(add-after 'configure 'dont-install-to-usr
|
|
|
|
|
(lambda _
|
|
|
|
|
(substitute* ".config"
|
|
|
|
|
(("# CONFIG_INSTALL_NO_USR is not set")
|
|
|
|
|
"CONFIG_INSTALL_NO_USR=y"))
|
|
|
|
|
#t))
|
2016-06-30 12:09:40 -04:00
|
|
|
|
(replace 'check
|
2020-06-30 09:04:17 -04:00
|
|
|
|
(lambda* (#:key make-flags #:allow-other-keys)
|
2017-06-21 03:13:31 -04:00
|
|
|
|
(substitute* '("testsuite/du/du-s-works"
|
|
|
|
|
"testsuite/du/du-works")
|
2016-06-30 12:09:40 -04:00
|
|
|
|
(("/bin") "/etc")) ; there is no /bin but there is a /etc
|
2014-05-27 02:53:30 -04:00
|
|
|
|
|
2017-06-21 03:13:31 -04:00
|
|
|
|
;; There is no /usr/bin or /bin - replace it with /gnu/store
|
|
|
|
|
(substitute* "testsuite/cpio.tests"
|
2016-06-30 12:09:40 -04:00
|
|
|
|
(("/usr/bin") (%store-directory))
|
|
|
|
|
(("usr") (car (filter (negate string-null?)
|
2017-06-21 03:13:31 -04:00
|
|
|
|
(string-split (%store-directory) #\/)))))
|
2014-05-27 02:53:30 -04:00
|
|
|
|
|
2017-06-21 03:13:31 -04:00
|
|
|
|
(substitute* "testsuite/date/date-works-1"
|
2016-06-30 12:09:40 -04:00
|
|
|
|
(("/bin/date") (which "date")))
|
2014-05-27 02:53:30 -04:00
|
|
|
|
|
2020-06-14 07:03:05 -04:00
|
|
|
|
(substitute* "testsuite/start-stop-daemon.tests"
|
|
|
|
|
(("/bin/false") (which "false")))
|
|
|
|
|
|
2017-06-21 03:13:31 -04:00
|
|
|
|
;; The pidof tests assume that pid 1 is called "init" but that is not
|
|
|
|
|
;; true in guix build environment
|
|
|
|
|
(substitute* "testsuite/pidof.tests"
|
2016-06-30 12:09:40 -04:00
|
|
|
|
(("-s init") "-s $(cat /proc/1/comm)"))
|
2020-12-11 05:04:15 -05:00
|
|
|
|
|
2017-06-21 03:13:31 -04:00
|
|
|
|
;; This test cannot possibly pass.
|
|
|
|
|
;; It is trying to test that "which ls" returns "/bin/ls" when PATH is not set.
|
|
|
|
|
;; However, this relies on /bin/ls existing. Which it does not in guix.
|
|
|
|
|
(delete-file "testsuite/which/which-uses-default-path")
|
|
|
|
|
(rmdir "testsuite/which")
|
2014-05-27 02:53:30 -04:00
|
|
|
|
|
2020-06-30 09:04:17 -04:00
|
|
|
|
(apply invoke "make"
|
2018-06-22 11:17:29 -04:00
|
|
|
|
;; "V=1"
|
|
|
|
|
"SKIP_KNOWN_BUGS=1"
|
|
|
|
|
"SKIP_INTERNET_TESTS=1"
|
2020-06-30 09:04:17 -04:00
|
|
|
|
"check" make-flags)))
|
2016-06-30 12:09:40 -04:00
|
|
|
|
(replace 'install
|
2020-06-30 09:04:17 -04:00
|
|
|
|
(lambda* (#:key outputs make-flags #:allow-other-keys)
|
2016-06-30 12:09:40 -04:00
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
2020-06-30 09:04:17 -04:00
|
|
|
|
(apply invoke "make"
|
2018-06-22 11:17:29 -04:00
|
|
|
|
(string-append "CONFIG_PREFIX=" out)
|
2020-06-30 09:04:17 -04:00
|
|
|
|
"install" make-flags)))))))
|
2014-05-27 02:53:30 -04:00
|
|
|
|
(native-inputs `(("perl" ,perl) ; needed to generate the man pages (pod2man)
|
|
|
|
|
;; The following are needed by the tests.
|
|
|
|
|
("inetutils" ,inetutils)
|
2016-06-30 12:04:08 -04:00
|
|
|
|
("which" ,(@ (gnu packages base) which))
|
2014-05-27 02:53:30 -04:00
|
|
|
|
("zip" ,zip)))
|
|
|
|
|
(synopsis "Many common UNIX utilities in a single executable")
|
|
|
|
|
(description "BusyBox combines tiny versions of many common UNIX utilities
|
2014-11-18 12:22:06 -05:00
|
|
|
|
into a single small executable. It provides a fairly complete environment for
|
|
|
|
|
any small or embedded system.")
|
2016-06-30 12:04:08 -04:00
|
|
|
|
(home-page "https://www.busybox.net")
|
2014-05-27 02:53:30 -04:00
|
|
|
|
;; Some files are gplv2+
|
|
|
|
|
(license gpl2)))
|
2018-12-11 07:39:40 -05:00
|
|
|
|
|
|
|
|
|
(define-public toybox
|
|
|
|
|
(package
|
|
|
|
|
(name "toybox")
|
2020-05-20 00:05:18 -04:00
|
|
|
|
(version "0.8.3")
|
2018-12-11 07:39:40 -05:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (string-append
|
|
|
|
|
"https://landley.net/toybox/downloads/toybox-"
|
|
|
|
|
version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2020-05-20 00:05:18 -04:00
|
|
|
|
"00aw9d809wj1bqlb2fsssdgz7rj0363ya14py0gfdm0rkp98zcpa"))))
|
2018-12-11 07:39:40 -05:00
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
|
(arguments
|
2020-12-11 05:17:51 -05:00
|
|
|
|
`(#:phases
|
2018-12-11 07:39:40 -05:00
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
|
(add-before 'configure 'set-environment-variables
|
|
|
|
|
(lambda _
|
2020-12-11 05:17:51 -05:00
|
|
|
|
(setenv "CC" ,(cc-for-target))
|
2018-12-11 07:39:40 -05:00
|
|
|
|
(setenv "HOSTCC" (which "gcc"))
|
|
|
|
|
#t))
|
|
|
|
|
(replace 'configure
|
|
|
|
|
(lambda _ (invoke "make" "defconfig")))
|
|
|
|
|
(replace 'install
|
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
|
(invoke "make"
|
|
|
|
|
(string-append "PREFIX=" out)
|
2019-06-16 13:34:13 -04:00
|
|
|
|
"install"))))
|
|
|
|
|
(add-after 'install 'remove-usr-directory
|
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
|
(delete-file-recursively (string-append out "/usr"))
|
|
|
|
|
#t))))
|
2018-12-11 07:39:40 -05:00
|
|
|
|
#:test-target "tests"))
|
|
|
|
|
(native-inputs `(("bc" ,bc)))
|
|
|
|
|
(synopsis "Many common UNIX utilities in a single executable")
|
|
|
|
|
(description "ToyBox combines tiny versions of many common UNIX utilities
|
|
|
|
|
into a single small executable. It provides a fairly complete environment for
|
|
|
|
|
any small or embedded system.")
|
|
|
|
|
(home-page "https://landley.net/toybox/")
|
|
|
|
|
(license bsd-2)))
|