aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2022, 2024 Ludovic Courtès <ludo@gnu.org>
;;;
;;; 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 (test-cpio)
  #:use-module (guix cpio)
  #:use-module (guix tests)
  #:use-module ((guix build utils)
                #:select (which call-with-temporary-output-file))
  #:use-module (ice-9 match)
  #:use-module (ice-9 popen)
  #:use-module (rnrs io ports)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-26)
  #:use-module (srfi srfi-64))

(define %cpio-program
  (which "cpio"))

(define %test-file
  (search-path %load-path "guix.scm"))


(test-begin "cpio")

;; The cpio format expects 'ino' to fit in 32 bits.  If we have a bigger inode
;; number, skip this test.
(test-skip
 (if (>= (stat:ino (lstat %test-file)) (expt 2 32)) 1 0))
(test-assert "file->cpio-header + write-cpio-header + read-cpio-header"
  (let* ((header (file->cpio-header %test-file)))
    (call-with-values
        (lambda ()
          (open-bytevector-output-port))
      (lambda (port get-bv)
        (write-cpio-header header port)
        (let ((port (open-bytevector-input-port (get-bv))))
          (equal? header (read-cpio-header port)))))))

(unless %cpio-program (test-skip 1))
(test-assert "bit-identical to GNU cpio's output"
  (call-with-temporary-output-file
   (lambda (link _)
     (delete-file link)
     (symlink "chbouib" link)

     (let ((files (cons* "/"
                         (canonicalize-path
                          (dirname (search-path %load-path "guix.scm")))
                         link
                         (map (compose canonicalize-path
                                       (cut search-path %load-path <>))
                              '("guix.scm" "guix/build/syscalls.scm"
                                "guix/packages.scm")))))
       (call-with-temporary-output-file
        (lambda (ref-file _)
          (let ((pipe (open-pipe* OPEN_WRITE %cpio-program "-o" "-O" ref-file
                                  "-H" "newc" "--null")))
            (for-each (lambda (file)
                        (format pipe "~a\0" file))
                      files)
            (and (zero? (close-pipe pipe))
                 (call-with-temporary-output-file
                  (lambda (file port)
                    (write-cpio-archive files port)
                    (close-port port)
                    (or (file=? ref-file file)
                        (throw 'cpio-archives-differ files
                               ref-file file
                               (stat:size (stat ref-file))
                               (stat:size (stat file))))))))))))))

(test-end "cpio")
g-tooltip'>This makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. (chez-scheme-for-racket-bootstrap-bootfiles): Inherit from 'chez-scheme-bootstrap-bootfiles'. [arguments]: Adapt accordingly. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Philip McGrath 2022-03-04gnu: Add chez-nanopass....* gnu/packages/chez.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-nanopass): New variable. (unpack-nanopass+stex): New variable using 'chez-nanopass-bootstrap'. (chez-scheme-for-racket-bootstrap-bootfiles) (chez-scheme)[native-inputs]: Add 'chez-nanopass-bootstrap'. [arguments]<#:phases>: Adapt 'unpack-nanopass+stex' phase to use the new variable. * gnu/packages/racket.scm (racket-vm-cs): Likewise. (make-unpack-nanopass+stex): Remove it. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Philip McGrath 2022-03-04gnu: Add stex....* gnu/packages/chez.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap' (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependencies of stex-bootstrap. [arguments]<#:phases>: Remove 'prepare-stex'. Adjust 'unpack-nanopass+stex' and 'install-doc'. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Philip McGrath 2022-03-04gnu: chez-scheme: Use new package style....* gnu/packages/chez.scm (chez-scheme)[inputs]: Remove labels. [native-inputs]: Likewise. [arguments]: Use G-expressions. <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. (nanopass): Make public as a temporary workaround for Racket. * gnu/packages/racket.scm (make-unpack-nanopass+stex): Update accordingly. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Philip McGrath 2022-03-04gnu: chez-scheme: Use shared zlib and lz4....This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at <https://github.com/cisco/ChezScheme/pull/443>. * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Philip McGrath 2022-03-04gnu: chez-scheme: Use "lib/chez-scheme" for search path....There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would be especially unpleasant when support is added for the Racket variant of Chez Scheme, which always has a different version number than upstream. * gnu/packages/chez.scm (chez-scheme)[native-search-paths]: Change to use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for "CHEZSCHEMELIBDIRS". (chez-make-flags): Update accordingly. (chez-sockets)[arguments]<#:phases>: Likewise. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Philip McGrath 2022-03-04gnu: chez-scheme: Use new style for Chez packages....* gnu/packages/chez.scm (chez-configure, chez-make-flags): Use G-expressions. (chez-srfi)[arguments]: Use G-expressions, 'chez-configure', and 'chez-make-flags'. (chez-web, chez-sockets)[native-inputs]: Remove labels. [arguments]: Use G-expressions. (chez-matchable, chez-irregex, chez-fmt, chez-mit) (chez-scmutils)[arguments]: Use G-expressions. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Philip McGrath 2022-03-04gnu: chez: Add utilities for Chez machine types....* gnu/packages/chez.scm (chez-machine->nonthreaded) (chez-machine->threaded, chez-machine->nix-system) (nix-system->chez-machine, chez-upstream-features-for-system) (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New variables. (chez-scheme)[supported-systems]: Compute based on 'nix-system->chez-machine' and 'chez-upstream-features-for-system'. (chez-scheme-for-racket-bootstrap-bootfiles)[supported-systems]: Compute based on 'nix-system->chez-machine'. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Philip McGrath 2022-03-04gnu: racket: Move Chez bootfiles to (gnu packages chez)....* gnu/packages/racket.scm (chez-scheme-for-racket-bootstrap-bootfiles): Move to ... * gnu/packages/chez.scm (chez-scheme-for-racket-bootstrap-bootfiles): ... this new variable. [source]: Avoid problematic cycle with "racket.scm". [arguments]<#:phases>: Likewise. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Philip McGrath 2022-01-09gnu: chez-scheme: Update to 9.5.6....* gnu/packages/chez.scm (chez-scheme): Update to 9.5.6. [source]: Remove patch. [arguments]: Don't explicitly return #t from phases. * gnu/packages/patches/chez-scheme-build-util-paths-backport.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. Tobias Geerinckx-Rice 2021-12-13gnu: Simplify package inputs....This commit was obtained by running: ./pre-inst-env guix style without any additional argument. Ludovic Courtès 2021-11-22gnu: chez-scheme: Add missing inputs....* gnu/packages/chez.scm (chez-scheme)[native-inputs]: Add texlive-dvips-l3backend and texlive-fonts-ec. [arguments]: Set HOME in 'configure' phase. Guillaume Le Vaillant 2021-09-06gnu: Use the non-deprecated TeX packages....This commit leaves 'dblatex' and 'texlive-hyperref' as users of deprecated packages, but these have many dependents. * gnu/packages/bioinformatics.scm (discrover)[native-inputs]: Use non-deprecated TeX Live packages. (velvet)[native-inputs]: Likewise. * gnu/packages/chez.scm (chez-scheme)[native-inputs]: Likewise. (chez-web)[native-inputs]: Likewise. * gnu/packages/engineering.scm (fastcap)[native-inputs]: Likewise. * gnu/packages/guile-xyz.scm (emacsy)[native-inputs]: Likewise. * gnu/packages/maths.scm (hypre)[native-inputs]: Likewise. * gnu/packages/music.scm (lilypond)[native-inputs]: Likewise. * gnu/packages/ocaml.scm (ocaml-bibtex2html)[native-inputs]: Likewise. * gnu/packages/plotutils.scm (asymptote)[native-inputs]: Likewise. * gnu/packages/python-xyz.scm (python-numpy-documentation)[native-inputs]: Likewise. (python-matplotlib-documentation)[native-inputs]: Likewise. (python-ipython-documentation)[native-inputs]: Likewise. (python-nbconvert)[native-inputs]: Likewise. (python-pypandoc)[native-inputs]: Likewise. * gnu/packages/statistics.scm (r-with-tests)[native-inputs]: Likewise. * gnu/packages/tex.scm (texlive-pstool)[propagated-inputs]: Likewise. (teximpatient)[native-inputs]: Likewise. (texlive-latex-pgf)[propagated-inputs]: Likewise. (texlive-beamer)[propagated-inputs]: Likewise. Ludovic Courtès 2021-04-18gnu: Fix merge mistakes....* gnu/packages/chez.scm (chez-scheme)[native-inputs]: Use correct texlive implementation. * gnu/packages/music.scm (python-abjad)[native-inputs], * gnu/packages/python-check.scm (python-pytest-helpers-namespace) [native-inputs]: Use correct variable for python-pytest. Efraim Flashner 2021-04-16Merge remote-tracking branch 'origin/master' into core-updates... Conflicts: gnu/local.mk gnu/packages/boost.scm gnu/packages/chez.scm gnu/packages/compression.scm gnu/packages/crates-io.scm gnu/packages/docbook.scm gnu/packages/engineering.scm gnu/packages/gcc.scm gnu/packages/gl.scm gnu/packages/gtk.scm gnu/packages/nettle.scm gnu/packages/python-check.scm gnu/packages/python-xyz.scm gnu/packages/radio.scm gnu/packages/rust.scm gnu/packages/sqlite.scm guix/build-system/node.scm Efraim Flashner 2021-04-05gnu: chez-scheme: simplify packaging...Take advantage of patches that have been accepted upstream. These changes lay a foundation for reusing more of Chez's build process for Racket. * gnu/packages/patches/chez-scheme-build-util-paths-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez.scm (chez-scheme)[source](patches): Use it. [source](snippet): Remove bundled libraries here, not in configure phase. [inputs]: Organize. Move "nanopass", "stex", and "xorg-rgb" to ... [native-inputs]: ... this field. [arguments]: Add (ice-9 ftw) to #:modules. Remove unneeded 'patch-processor-detection' phase. Add 'unpack-nanopass+stex' phase (refactored from 'configure'). Simplify 'configure' phase by removing patches that have been upstreamed. Add "--nogzip-man-pages" flag so we can remove 'make-manpages-writable' phase. Stop ignoring #:configure-flags, move "--threads" there, and remove unneeded workaround. Add 'prepare-stex' phase (refactored from 'install-doc'). Use it to streamline 'install-doc' phase, installing all of the right files into the right places. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Philip McGrath 2021-04-05gnu: chez-scheme: Update stex....Get a patch from upstream that will help us simplify the build process for the Chez Scheme documentation. * gnu/packages/chez.scm (chez-stex): Update to commit 5405149. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Philip McGrath 2021-04-05gnu: chez-scheme: Update nanopass to 1.9.2....* gnu/packages/chez.scm (nanopass): Update nanopass to 1.9.2. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Philip McGrath 2021-01-29gnu: Replace all uses of texlive-union by texlive-updmap.cfg....* doc/build.scm (pdf-manual) Replace texlive-union by texlive-updmap.cfg. * gnu/packages/algebra.scm (pari-gp): Likewise. * gnu/packages/bioinformatics.scm (discrover, velvet): Likewise. * gnu/packages/chez.scm (chez-scheme, chez-web, chez-sockets): Likewise. * gnu/packages/docbook.scm (dblatex): Likewise. * gnu/packages/emacs-xyz.scm (emacs-auctex): Likewise. * gnu/packages/engineering.scm (fastcap): Likewise. * gnu/packages/guile-xyz.scm (emacsy, guile-cv): Likewise. * gnu/packages/lisp.scm (sbcl): Likewise. * gnu/packages/maths.scm (octave, hypre): Likewise. * gnu/packages/music.scm (lilypond): Likewise. * gnu/packages/plotutils.scm (asymptote): Likewise. * gnu/packages/python-xyz.scm (python-numpy-documentation) (python-matplotlib-documentation, python-ipython-documentation) (python-pypandoc): Likewise. * gnu/packages/radio.scm (gnuradio, libosmo-dsp): Likewise. * gnu/packages/scheme.scm (mit-scheme): Likewise. * gnu/packages/statistics.scm (r-with-tests): Likewise. * gnu/packages/tex.scm (simple-texlive-package) (texlive-xmltex, texlive-tiny, texlive-jadetex, teximpatient, lyx): Likewise. Maxim Cournoyer 2021-01-13Merge branch 'staging' into 'core-updates'....Conflicts: gnu/local.mk gnu/packages/cmake.scm gnu/packages/curl.scm gnu/packages/gl.scm gnu/packages/glib.scm gnu/packages/guile.scm gnu/packages/node.scm gnu/packages/openldap.scm gnu/packages/package-management.scm gnu/packages/python-xyz.scm gnu/packages/python.scm gnu/packages/tls.scm gnu/packages/vpn.scm gnu/packages/xorg.scm Maxim Cournoyer 2020-12-23gnu: chez-web: Use new names of TeX Live packages....* gnu/packages/chez.scm (chez-web)[native-inputs]: Replace texlive-generic-pdftex, texlive-context-base, and texlive-fonts-cm with the new names texlive-pdftex, texlive-context, and texlive-cm, respectively. Ricardo Wurmus 2020-12-23gnu: chez-sockets: Use new name of texlive-pdftex....* gnu/packages/chez.scm (chez-sockets)[native-inputs]: Replace "texlive-generic-pdftex" with "texlive-pdftex". Ricardo Wurmus 2020-12-23gnu: chez-web: Remove obsolete build phase....* gnu/packages/chez.scm (chez-web)[arguments]: Remove build phase "set-HOME". Ricardo Wurmus 2020-12-18gnu: chez-scheme: Patch more hard-coded paths....* gnu/packages/chez.scm (chez-scheme): Patch out some /bin/rm and /bin/echo references. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Brendan Tildesley 2020-12-18gnu: chez-scheme: Update to 9.5.4....* gnu/packages/chez.scm (nanopass): Update to 1.9.1. (stex): Update to 1.2.2. (chez-scheme): Update to 9.5.4. [inputs]: Add newly required lz4 and lz4:static. [arguments]: - Remove unused zlib symbol. - Since we are using ZLIB=, it looks like the substitution of libz.a path in .c/Mf-... files is no longer needed. - add lz4-static symbol and use new LZ4= and ZLIB= configure options to point to their static binaries. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Brendan Tildesley