aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 John Darrington <jmd@gnu.org>
;;; Copyright © 2016-2020, 2023 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2022 LuHui <luhux76@gmail.com>
;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
;;;
;;; 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 gexp)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix utils)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages algebra)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages crypto)
  #:use-module (gnu packages perl))

(define-public busybox
  (package
    (name "busybox")
    (version "1.37.0")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://www.busybox.net/downloads/" name "-"
                    version ".tar.bz2"))
              (sha256
               (base32
                "1923f21rnlbv1qjvk2qhgqnki5mkgr6z0p8dvzs9jr3l5vrxy49k"))
              (patches
               (search-patches "busybox-add-missing-sha-NI-guard.patch"))))
    (build-system gnu-build-system)
    (arguments
     (list #:phases
           #~(modify-phases %standard-phases
               (add-before 'configure 'disable-timestamps
                 (lambda _
                   (setenv "KCONFIG_NOTIMESTAMP" "1")))
               (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"))))
               (replace 'configure
                 (lambda* (#:key make-flags #:allow-other-keys)
                   (apply invoke "make" "defconfig" make-flags)))
               (add-after 'configure 'dont-install-to-usr
                 (lambda _
                   (substitute* ".config"
                     (("# CONFIG_INSTALL_NO_USR is not set")
                      "CONFIG_INSTALL_NO_USR=y"))))
               (replace 'check
                 (lambda* (#:key tests? make-flags #:allow-other-keys)
                   (substitute* '("testsuite/du/du-s-works"
                                  "testsuite/du/du-works")
                     (("/bin") "/etc")) ; there is no /bin but there is a /etc

                   ;; There is no /usr/bin or /bin - replace it with
                   ;; /gnu/store.
                   (substitute* "testsuite/cpio.tests"
                     (("/usr/bin") (%store-directory))
                     (("usr") (car (filter (negate string-null?)
                                           (string-split (%store-directory) #\/)))))

                   (substitute* "testsuite/date/date-works-1"
                     (("/bin/date") (which "date")))

                   (substitute* "testsuite/start-stop-daemon.tests"
                     (("/bin/false") (which "false")))

                   ;; The pidof tests assume that pid 1 is called "init" but
                   ;; that is not true in guix build environment
                   (substitute* "testsuite/pidof.tests"
                     (("-s init") "-s $(cat /proc/1/comm)"))

                   ;; 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")

                   (when tests?
                     (apply invoke "make"
                            ;; "V=1"
                            "SKIP_KNOWN_BUGS=1"
                            "SKIP_INTERNET_TESTS=1"
                            "check" make-flags))))
               (replace 'install
                 (lambda* (#:key outputs make-flags #:allow-other-keys)
                   (let ((out (assoc-ref outputs "out")))
                     (apply invoke "make"
                            (string-append "CONFIG_PREFIX=" out)
                            "install" make-flags)))))
           #:make-flags
           #~(let ((target #$(%current-target-system)))
               (if target
                   (list (string-append "CROSS_COMPILE=" target "-"))
                   '()))))
    (native-inputs (list perl     ; needed to generate the man pages (pod2man)
                         ;; The following are needed by the tests.
                         inetutils
                         (@ (gnu packages base) which)
                         zip))
    (synopsis "Many common UNIX utilities in a single executable")
    (description "BusyBox 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://www.busybox.net")
    ;; Some files are gplv2+
    (license gpl2)))

(define-public toybox
  (package
    (name "toybox")
    (version "0.8.11")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://landley.net/toybox/downloads/toybox-"
                    version ".tar.gz"))
              (sha256
               (base32
                "1p37zqxhj48klwwxl8jc2hw1x7pr2w39bfb1nx6qghaf5y1kzahm"))))
    (build-system gnu-build-system)
    (arguments
     (list #:make-flags
           #~(list (string-append "CC=" #$(cc-for-target))
                   (string-append "HOSTCC=gcc")
                   (string-append "PREFIX=" #$output))
           #:phases
           #~(modify-phases %standard-phases
               (replace 'configure
                 (lambda* (#:key make-flags #:allow-other-keys)
                   (apply invoke "make" "defconfig" make-flags)))
               (add-before 'check 'fix-or-skip-broken-tests
                 (lambda _
                   ;; Some tests expect $USER to magically be the current user.
                   (setenv "USER" (passwd:name (getpwnam (geteuid))))
                   ;; This uses /bin/sh.
                   (substitute* "tests/timeout.test"
                     (("/bin/sh") (which "bash")))
                   ;; This expects directories to be exactly 4K.  They aren't!
                   (delete-file "tests/du.test")
                   ;; Delete tests that expect a root or 0 user to exist.
                   (substitute* "tests/id.test"
                     (("^testing .*[ \\(]root.*") ""))
                   (delete-file "tests/tar.test")))
               (add-after 'install 'remove-usr-directory
                 (lambda* (#:key outputs #:allow-other-keys)
                   (delete-file-recursively (string-append #$output "/usr")))))
           #:test-target "tests"))
    (native-inputs (list bc))
    (inputs (list libxcrypt))
    (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)))
ikewise. * gnu/packages/linux.scm (e2fsprogs, extundelete, lsscsi, net-tools) (kbd, sysfsutils, cpuid, libpfm4)[home-page]: Likewise. * gnu/packages/lisp-check.scm (sbcl-ptester, sbcl-xlunit)[home-page]: Likewise. * gnu/packages/lisp-xyz.scm (sbcl-html-encode, sbcl-py-configparser) (sbcl-cl-utilities, sbcl-series, sbcl-uffi, sbcl-clsql, sbcl-sycamore) (sbcl-osicat, sbcl-hu.dwim.common, sbcl-caveman, sbcl-trivial-shell) (sbcl-trivial-benchmark, sbcl-screamer, sbcl-smug)[home-page]: Likewise. * gnu/packages/lisp.scm (lush2)[home-page]: Likewise. * gnu/packages/logging.scm (log4cpp)[home-page]: Likewise. * gnu/packages/lua.scm (lua-ldoc)[home-page]: Likewise. * gnu/packages/machine-learning.scm (mcl, openfst, rxcpp)[home-page]: Likewise. * gnu/packages/mail.scm (muchsync, procmail, sendmail) (opensmtpd-filter-dkimsign, crm114)[home-page]: Likewise. * gnu/packages/man.scm (libpipeline, man-db)[home-page]: Likewise. * gnu/packages/maths.scm (lapack, scalapack, hdf-eos5, itpp, gmsh) (metamath, p4est, armadillo, suitesparse, atlas, lpsolve, wcalc, why3) (frama-c)[home-page]: Likewise. * gnu/packages/mcrypt.scm (mcrypt, libmcrypt, libmhash)[home-page]: Likewise. * gnu/packages/minetest.scm (minetest-advtrains)[home-page]: Likewise. * gnu/packages/monitoring.scm (python-whisper, python-carbon) (hostscope)[home-page]: Likewise. * gnu/packages/mp3.scm (id3lib, libmp3splt, mp3splt, mpg321) (lame)[home-page]: Likewise. * gnu/packages/multiprecision.scm (mpc)[home-page]: Likewise. * gnu/packages/music.scm (aria-maestosa, lingot, setbfree, bristol) (portmidi, python-pyportmidi, zynaddsubfx, yoshimi, aj-snapshot) (schismtracker, midicsv, midicsv, qmidiarp, qmidiroute, dssi, tap-lv2) (shiru-lv2)[home-page]: Likewise. * gnu/packages/ncurses.scm (stfl)[home-page]: Likewise. * gnu/packages/networking.scm (lksctp-tools, mbuffer, ifstatus, bird) (tunctl, traceroute)[home-page]: Likewise. * gnu/packages/node-xyz.scm (node-mersenne)[home-page]: Likewise. * gnu/packages/ntp.scm (openntpd)[home-page]: Likewise. * gnu/packages/ocaml.scm (opam, hevea, ocaml-menhir, ocaml-piqilib) (ocaml-graph, cubicle)[home-page]: Likewise. * gnu/packages/opencl.scm (python-pyopencl)[home-page]: Likewise. * gnu/packages/package-management.scm (xstow, modules)[home-page]: Likewise. * gnu/packages/parallel.scm (xjobs)[home-page]: Likewise. * gnu/packages/pdf.scm (podofo, qpdf, xournal, impressive)[home-page]: Likewise. * gnu/packages/perl.scm (perl-math-vecstat, perltidy)[home-page]: Likewise. * gnu/packages/photo.scm (libpano13, enblend-enfuse, hugin)[home-page]: Likewise. * gnu/packages/plan9.scm (drawterm)[home-page]: Likewise. * gnu/packages/plotutils.scm (guile-charting, ploticus)[home-page]: Likewise. * gnu/packages/popt.scm (argtable, popt)[home-page]: Likewise. * gnu/packages/profiling.scm (otf2)[home-page]: Likewise. * gnu/packages/pulseaudio.scm (pulseaudio)[home-page]: Likewise. * gnu/packages/python-check.scm (python-mypy)[home-page]: Likewise. * gnu/packages/python-web.scm (python-cssutils) (python-translationstring)[home-page]: Likewise. * gnu/packages/python-xyz.scm (python-diskcache, python-doxyqml) (python-docutils, python-pexpect, python-importlib-resources) (python-simplegeneric, python-urwid, python-xlrd, python-xlwt) (python-pyasn1, python-pythondialog, python-tftpy, python-random2) (python-arcp, python-pyopengl, python-sortedcollections) (python-sortedcontainers, python-yapsy, python-pydispatcher) (python-posix-ipc)[home-page]: Likewise. * gnu/packages/qt.scm (qwt, libqglviewer, signond)[home-page]: Likewise. * gnu/packages/radio.scm (unixcw, gnuais)[home-page]: Likewise. * gnu/packages/raspberry-pi.scm (bcm2835)[home-page]: Likewise. * gnu/packages/rdf.scm (clucene, rasqal, redland)[home-page]: Likewise. * gnu/packages/regex.scm (tre)[home-page]: Likewise. * gnu/packages/rsync.scm (librsync)[home-page]: Likewise. * gnu/packages/ruby.scm (ruby-packnga, ruby-nokogiri, ruby-oj, ruby-ox) (ruby-sinatra, ruby-citrus, ruby-cbor, ruby-roda)[home-page]: Likewise. * gnu/packages/scheme.scm (scheme48, tinyscheme)[home-page]: Likewise. * gnu/packages/screen.scm (dtach)[home-page]: Likewise. * gnu/packages/scsi.scm (sg3-utils)[home-page]: Likewise. * gnu/packages/sdl.scm (libmikmod, sdl-pango)[home-page]: Likewise. * gnu/packages/shellutils.scm (hstr, rig)[home-page]: Likewise. * gnu/packages/simulation.scm (python-dolfin-adjoint)[home-page]: Likewise. * gnu/packages/smalltalk.scm (smalltalk)[home-page]: Likewise. * gnu/packages/speech.scm (espeak)[home-page]: Likewise. * gnu/packages/stalonetray.scm (stalonetray)[home-page]: Likewise. * gnu/packages/statistics.scm (jags, r-mass, r-class, r-lattice) (r-matrix, r-nnet, r-spatial, r-bit, r-bit64, r-digest, r-xtable) (python-statsmodels, r-ade4, r-latticeextra, r-rcurl, r-xml, r-mvtnorm) (r-robustbase, r-minqa, r-fdrtool, java-jdistlib, xlispstat)[home-page]: Likewise. * gnu/packages/swig.scm (swig)[home-page]: Likewise. * gnu/packages/task-management.scm (wtime)[home-page]: Likewise. * gnu/packages/tcl.scm (itcl, tclxml, tclx)[home-page]: Likewise. * gnu/packages/terminals.scm (libtermkey, mlterm, libvterm) (libvterm)[home-page]: Likewise. * gnu/packages/tex.scm (texlive-lm, texlive-lm-math, texlive-cs) (texlive-csplain, biber, texmaker)[home-page]: Likewise. * gnu/packages/text-editors.scm (joe)[home-page]: Likewise. * gnu/packages/textutils.scm (drm-tools, docx2txt)[home-page]: Likewise. * gnu/packages/tv.scm (tvtime)[home-page]: Likewise. * gnu/packages/unicode.scm (libunibreak)[home-page]: Likewise. * gnu/packages/upnp.scm (libupnp)[home-page]: Likewise. * gnu/packages/version-control.scm (cvs)[home-page]: Likewise. * gnu/packages/video.scm (transcode, libquicktime, mjpegtools, aalib) (liba52, libmpeg2, x265, libdv, dvdauthor, aegisub, pitivi, gavl) (dvdbackup, guvcview, video-contact-sheet)[home-page]: Likewise. * gnu/packages/virtualization.scm (bochs)[home-page]: Likewise. * gnu/packages/w3m.scm (w3m)[home-page]: Likewise. * gnu/packages/web.scm (qjson, libquvi-scripts, libquvi, quvi) (tidy-html, htmlcxx)[home-page]: Likewise. * gnu/packages/wm.scm (evilwm, menumaker)[home-page]: Likewise. * gnu/packages/wv.scm (wv)[home-page]: Likewise. * gnu/packages/wxwidgets.scm (wxsvg)[home-page]: Likewise. * gnu/packages/xdisorg.scm (mtdev, xsel)[home-page]: Likewise. * gnu/packages/xfig.scm (xfig, transfig)[home-page]: Likewise. * gnu/packages/xml.scm (openjade, python-pyxb, xmlstarlet, xmlrpc-c) (opensp)[home-page]: Likewise. * gnu/packages/xorg.scm (xf86-video-qxl)[home-page]: Likewise. Tobias Geerinckx-Rice 2022-12-02gnu: wxWidgets: Update to 3.2.1....* gnu/packages/wxwidgets.scm (wxwidgets): Update to 3.2.1. [source](modules, snippet): New fields. [inputs]: Remove SDL. Add CATCH-FRAMEWORK, EXPAT, GSTREAMER, GST-PLUGINS-BASE, LIBNOTIFY, LIBPNG, LIBSECRET, PCRE, SDL2, WEBKITGTK-WITH-LIBSOUP2, and ZLIB [arguments]: Add "--enable-mediactrl" and "--enable-gui" to #:configure-flags. Remove aarch64 workaround. Install catch header in refer-to-inputs phase. Add phase to adjust WebKitGTK version. (wxwidgets-3.1, wxwidgets-gtk2-3.1): Remove variables. (wxwidgets-3.0, (wxwidgets-gtk2-3.0): New variables. (wxsvg)[inputs]: Change from WXWIDGETS-3.1 to WXWIDGETS. * gnu/packages/audio.scm (audacity)[inputs]: Likewise. * gnu/packages/cdrom.scm (dvdstyler)[inputs]: Likewise. * gnu/packages/astronomy.scm (imppg)[inputs]: Change from WXWIDGETS to WXWIDGETS-3.0. * gnu/packages/ftp.scm (filezilla)[inputs]: Likewise. * gnu/packages/games.scm (megaglest)[inputs]: Likewise. * gnu/packages/geo.scm (opencpn)[inputs]: Likewise. * gnu/packages/music.scm (sooperlooper)[inputs]: Likewise. * gnu/packages/engineering.scm (kicad)[arguments]: Enable EGL support. Marius Bakke 2022-10-23gnu: xorriso: Update to 1.5.4....* gnu/packages/cdrom.scm (xorriso): Update to 1.5.4. Tobias Geerinckx-Rice 2022-08-07gnu: dvdisaster: Use G-expressions....* gnu/packages/cdrom.scm (dvdisaster)[arguments]: Rewrite as G-expressions. Tobias Geerinckx-Rice 2022-08-07gnu: dvdisaster: Update to 0.79.10....* gnu/packages/cdrom.scm (dvdisaster): Update to 0.79.10. Tobias Geerinckx-Rice 2022-08-07gnu: dvdisaster: Remove input labels....* gnu/packages/cdrom.scm (dvdisaster)[native-inputs]: Remove input labels. Tobias Geerinckx-Rice