aboutsummaryrefslogtreecommitdiff
path: root/tests/cpio.scm
blob: 516de0655b3cec47b19e270734c99a2e50959a04 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 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))
  #:use-module ((guix utils) #:select (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"))


(test-begin "cpio")

(test-assert "file->cpio-header + write-cpio-header + read-cpio-header"
  (let* ((file   (search-path %load-path "guix.scm"))
         (header (file->cpio-header 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")
project-jami): Update commit. (ffmpeg-jami) [version, source, outputs]: : Delete fields. [arguments]: Delete disable-problematic-tests phase. * gnu/packages/patches/jami-libjami-headers-search.patch: Rebase patch. Maxim Cournoyer 2023-03-28gnu: ffmpeg-5: Rename variable to ffmpeg....* gnu/packages/video.scm (ffmpeg-5): Rename to... (ffmpeg): ... this, replacing the old 'ffmpeg' alias. (ffmpeg-4): Adjust accordingly. * gnu/packages/jami.scm (ffmpeg-jami): Likewise. Maxim Cournoyer 2023-03-23Merge remote-tracking branch 'origin/master' into staging....With resolved conflicts in: gnu/packages/ibus.scm gnu/packages/image.scm gnu/packages/lisp.scm gnu/packages/virtualization.scm Maxim Cournoyer 2023-02-20gnu: pjproject-jami: Update to 2.12-2.20e00fc....This resolves a crash because of pjproject leaving too many sockets opened ("Creating pipes for GWakeup: Too many open files"). * gnu/packages/jami.scm (pjproject-jami): Update to 2.12-2.20e00fc. Maxim Cournoyer 2023-02-16gnu: Remove unneeded module imports....* gnu/packages/abiword.scm, * gnu/packages/ada.scm, * gnu/packages/agda.scm, * gnu/packages/backup.scm, * gnu/packages/barrier.scm, * gnu/packages/bioinformatics.scm, * gnu/packages/bootstrap.scm, * gnu/packages/bqn.scm, * gnu/packages/c.scm, * gnu/packages/chemistry.scm, * gnu/packages/coq.scm, * gnu/packages/cross-base.scm, * gnu/packages/databases.scm, * gnu/packages/emacs-xyz.scm, * gnu/packages/enlightenment.scm, * gnu/packages/games.scm, * gnu/packages/geo.scm, * gnu/packages/ghostscript.scm, * gnu/packages/gl.scm, * gnu/packages/golang.scm, * gnu/packages/jami.scm, * gnu/packages/java-maths.scm, * gnu/packages/kde-frameworks.scm, * gnu/packages/kde-plasma.scm, * gnu/packages/language.scm, * gnu/packages/libreoffice.scm, * gnu/packages/linphone.scm, * gnu/packages/lisp.scm, * gnu/packages/llvm.scm, * gnu/packages/machine-learning.scm, * gnu/packages/minetest.scm, * gnu/packages/monitoring.scm, * gnu/packages/nfs.scm, * gnu/packages/ocr.scm, * gnu/packages/opencl.scm, * gnu/packages/pdf.scm, * gnu/packages/python-xyz.scm, * gnu/packages/racket.scm, * gnu/packages/rust.scm, * gnu/packages/syncthing.scm, * gnu/packages/syndication.scm, * gnu/packages/telegram.scm, * gnu/packages/vulkan.scm, * gnu/packages/web-browsers.scm, * gnu/packages/web.scm, * gnu/packages/webkit.scm: Remove some unecessary module imports. Efraim Flashner 2023-02-08Merge branch 'master' into staging....With conflicts resolved in: gnu/packages/version-control.scm Maxim Cournoyer 2023-02-08gnu: jami: Remove unused native inputs....* gnu/packages/jami.scm (jami) [native-inputs]: Remove doxygen, graphviz and gsettings-desktop-schemas. Maxim Cournoyer 2023-02-08gnu: libjami: Move jamid daemon to a "bin" output....* gnu/packages/jami.scm (libjami) [outputs]: Add a "bin" output. [arguments]: Add a move-jamid phase. * gnu/services/telephony.scm (jami-configuration->command-line-arguments): Refer to the "bin" output of libjami. (jami-shepherd-services): Likewise. Maxim Cournoyer 2023-02-08gnu: ffmpeg-jami: Add a debug output....* gnu/packages/jami.scm (ffmpeg-jami) [outputs]: New field. [configure-flags]: Add "--disable-stripping". Maxim Cournoyer 2023-02-08gnu: ffmpeg-jami: Really honor custom configuration flags....Because the substitute-keyword-arguments pattern was (#:configure-flags '()) rather than (#:configure-flags _ '()), the replacement was not triggered. * gnu/packages/jami.scm (%ffmpeg-default-configure-flags): Comment that the fnnvcodec-related options are left out. (%ffmpeg-linux-x86-configure-flags): Delete variable. (ffmpeg-compose-configure-flags): Streamline and use gexps. (ffmpeg-jami) [arguments]: Fix configure-flags pattern, and adjust to use gexps. Add the "--disable-static" and "--enable-shared" flags to produce shared objects with the correct RUNPATH. Maxim Cournoyer 2023-02-07gnu: jami: Update to 20230206.0....* gnu/packages/jami.scm (jami): Update to 20230206.0. (%jami-version): Update version. (%jami-sources): Adjust URI. Streamline snippet. (jami-apply-custom-patches): Use a wildcard to match the top-level directory, which now includes the version. (%ffmpeg-default-configure-flags): Adjust URL in top comment. * gnu/packages/patches/jami-libjami-headers-search.patch: Adjust file names for new tarball layout. Maxim Cournoyer 2023-01-08Merge branch 'master' into stagingMarius Bakke 2023-01-03gnu: jami-qt: Remove deprecated alias....* gnu/packages/jami.scm (jami-qt): Delete variable. Maxim Cournoyer 2023-01-03gnu: jami-gnome: Remove deprecated alias....* gnu/packages/jami.scm (jami-gnome): Delete variable. Maxim Cournoyer 2023-01-03gnu: libring: Remove deprecated alias....* gnu/packages/jami.scm (libring): Delete variable. Maxim Cournoyer 2022-12-28Merge branch 'master' into stagingMarius Bakke 2022-12-27gnu: jami: Update to 20221220.0956.79e1207....* gnu/packages/jami.scm (%jami-version): Update to 20221220.0956.79e1207. (%jami-sources): Remove all but the 'jami-disable-integration-tests.patch' and 'jami-libjami-headers-search.patch' patches. * gnu/packages/patches/jami-fix-qml-imports.patch: Delete file. * gnu/packages/patches/jami-fix-unit-tests-build.patch: Likewise. * gnu/packages/patches/jami-no-webengine.patch: Likewise. * gnu/packages/patches/jami-sip-contacts.patch: Likewise. * gnu/packages/patches/jami-sip-unregister.patch: Likewise. * gnu/packages/patches/jami-sipaccount-segfault.patch: Likewise. * gnu/packages/patches/jami-xcb-link.patch: Likewise. * gnu/local.mk (dist_patch_DATA): De-register them. Maxim Cournoyer 2022-12-12Merge remote-tracking branch 'origin/master' into stagingMaxim Cournoyer 2022-12-04gnu: jami: Apply a patch to fix a crash when using SIP....* gnu/packages/patches/jami-sipaccount-segfault.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/jami.scm (%jami-sources): Apply it. Maxim Cournoyer 2022-12-02Merge branch 'master' into stagingMarius Bakke 2022-11-29gnu: jami: Apply a patch to fix receiving of text messages over SIP....* gnu/packages/patches/jami-sip-contacts.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/jami.scm (%jami-sources): Apply it. Maxim Cournoyer 2022-11-20gnu: libvpx: Update to 1.12.0....* gnu/packages/video.scm (libvpx): Update to 1.12.0. (libvpx-next): Remove variable. * gnu/packages/jami.scm (ffmpeg-jami)[inputs]: Remove. Marius Bakke 2022-11-20gnu: libx264: Update to 164-0.b093bbe....* gnu/packages/video.scm (libx264): Update to 164-0.b093bbe. (libx264-next): Remove variable. * gnu/packages/jami.scm (ffmpeg-jami)[inputs]: Don't use LIBX264-NEXT. Marius Bakke