aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; 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 genimage)
  #:use-module (guix utils)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system gnu)
  #:use-module (guix build utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages bootloaders)
  #:use-module (gnu packages cdrom)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cpio)
  #:use-module (gnu packages disk)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages mtools)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages textutils)
  #:use-module (gnu packages virtualization))

(define-public genimage
  (let ((commit "00009af6e29cfd46909bc8b4180147dda9f82ba8")
        (revision "0"))
    (package
      (name "genimage")
      (version (git-version "18" revision commit))
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                 (url "https://github.com/pengutronix/genimage")
                 (commit commit)))
          (file-name (git-file-name name version))
          (sha256
           (base32
            "1mijyq79cb0yj4jm9ln9smpddq1f6r8cnsa568qca0krcv0p3zag"))))
      (build-system gnu-build-system)
      (arguments
       `(#:modules
         ((ice-9 match)
          ,@%gnu-build-system-modules)
         #:phases
         (modify-phases %standard-phases
           (add-after 'unpack 'guixify
             (lambda* (#:key inputs #:allow-other-keys)
               (map (match-lambda
                      ((input directory regexp)
                       (substitute* "config.c"
                         (((format #f "\\.def = \"(~a)\"" regexp) _ command)
                          (string-append ".def = \"" (assoc-ref inputs input)
                                         "/" directory "/" command "\"")))))
                    '(("cpio"           "bin"  "cpio")
                      ("coreutils"      "bin"  "dd")
                      ("e2fsprogs"      "sbin" "debugfs|e2fsck|mke2fs|tune2fs")
                      ("genext2fs"      "bin"  "genext2fs")
                      ("cdrkit-libre"   "bin"  "genisoimage")
                      ("mtools"         "bin"  "mcopy|mmd")
                      ;; mkcramfs is obsolete.
                      ("dosfstools"     "sbin" "mkdosfs")
                      ("mtd-utils"      "sbin" "mkfs.(jffs2|ubifs)|ubinize")
                      ("f2fs-tools"     "sbin" "(mkfs|sload).f2fs")
                      ("squashfs-tools" "bin"  "mksquashfs")
                      ("qemu"           "bin"  "qemu-img")
                      ;; rauc and fiptool are unsupported.
                      ("tar"            "bin"  "tar")
                      ("u-boot-tools"   "bin"  "mkimage")))
               (substitute* "util.c"
                 (("\"/bin/sh\"")
                  (string-append "\"" (assoc-ref inputs "bash") "/bin/sh\"")))))
           (add-before 'check 'disable-failing-tests
             (lambda _
               ;; We don't have /etc/passwd so uid 0 is not known as "root".
               ;; Thus patch it out.
               (substitute* '("test/flash.test")
                 (("test_expect_success \"flash\"")
                  "test_expect_fail \"flash\""))
               (substitute* '("test/hdimage.test")
                 (("test_expect_success fdisk,sfdisk \"hdimage\"")
                  "test_expect_fail fdisk,sfdisk \"hdimage\"")
                 (("test_expect_success hexdump \"hdimage no-partition\"")
                  "test_expect_fail hexdump \"hdimage no-partition\""))))
           (add-before 'check 'fix-failing-tests
             (lambda _
               ;; We don't have /etc/passwd so uid 0 is not known as "root".
               ;; Thus patch it out.
               (substitute* '("test/ext2test.2.dump"
                              "test/ext3test.2.dump"
                              "test/ext4test.2.dump"
                              "test/ext2test-percent.2.dump"
                              "test/mke2fs.2.dump")
                 (("root") "unknown"))))
           (add-before 'check 'setenv-check
             (lambda _
               ;; Our container doesn't provide access to /etc/mtab
               (setenv "EXT2FS_NO_MTAB_OK" "1")
               ;; Make test reproducible
               (setenv "GENIMAGE_MKFJFFS2" "mkfs.jffs2 -U")
               (setenv "GENIMAGE_MKE2FS" "mke2fs -E no_copy_xattrs")))
           (replace 'check
             (lambda _
               (invoke "make" "TEST_LOG_COMPILER=" "check"))))))
      (native-inputs
       (list autoconf
             automake
             ;;; Note: cramfs is obsolete.
             dtc ; for the tests
             pkg-config
             util-linux)) ; for the tests
      (inputs
       `(("bash" ,bash)
         ("cdrkit-libre" ,cdrkit-libre)
         ("cpio" ,cpio)
         ;; Note: invoked by final executable.
         ("coreutils" ,coreutils) ; chmod, dd
         ("dosfstools" ,dosfstools)
         ("e2fsprogs" ,e2fsprogs)
         ("f2fs-tools" ,f2fs-tools)
         ("genext2fs" ,genext2fs)
         ("libconfuse" ,libconfuse)
         ("mtd-utils" ,mtd-utils)
         ("mtools" ,mtools)
         ("qemu" ,qemu-minimal)
         ("squashfs-tools" ,squashfs-tools)
         ("tar" ,tar)
         ("u-boot-tools" ,u-boot-tools)))
      (synopsis "Create Flash images according to specification")
      (description "@command{genimage} creates Flash images according to a
specification file.")
      (home-page "https://github.com/pengutronix/genimage")
      (license license:gpl2))))
an title='2023-06-29 12:01:22 +0200'>2023-06-29gnu: python-distributed: Disable timeout test....* gnu/packages/python-science.scm (python-distributed)[arguments]: Disable test_nanny_timeout, because it times out. Ricardo Wurmus 2023-06-25gnu: python-trimesh: Update to 3.22.1....* gnu/packages/python-science.scm (python-trimesh): Update to 3.22.1. [arguments]<#:phases>: Update path in 'fix-build' phase. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Paul A. Patience 2023-06-25gnu: Add python-pytensor....* gnu/packages/python-science.scm (python-pytensor): New variable. Vinicius Monego 2023-06-25gnu: Add python-xarray-einstats....* gnu/packages/python-science.scm (python-xarray-einstats): New variable. Vinicius Monego 2023-06-25gnu: python-xarray: Update to 2023.6.0....* gnu/packages/python-science.scm (python-xarray): Update to 2023.6.0. [build-system]: Switch to pyproject-build-system. [arguments]: Do not override the check phase. Vinicius Monego 2023-06-25gnu: Add python-einops....* gnu/packages/python-science.scm (python-einops): New variable. Vinicius Monego 2023-06-20gnu: python-pyvista: Update to 0.39.1....* gnu/packages/python-science.scm (python-pyvista): Update to 0.39.1. [propagated-inputs]: Add python-pooch, remove python-appdirs. Signed-off-by: Christopher Baines <mail@cbaines.net> Paul A. Patience 2023-05-11gnu: python-distributed: Update to 2023.4.1....* gnu/packages/python-science.scm (python-distributed): Update to 2023.4.1. [source]: Remove snippet. [arguments]: Update build phase 'versioneer; restore 'sanity-check phase; simplify custom 'check phase; add 'fix-pytest-config phase; use #:test-flags. [build-system]: Use pyproject-build-system. [native-inputs]: Add python-importlib-metadata. Ricardo Wurmus 2023-05-10gnu: python-scikit-optimize: Fix build with newer numpy and sklearn....* gnu/packages/patches/python-scikit-optimize-1148.patch, gnu/packages/patches/python-scikit-optimize-1150.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/python-science.scm (python-scikit-optimize)[source]: Fetch with git and apply patches. Ricardo Wurmus 2023-05-08gnu: python-bottleneck: Honor #:tests? flag....* gnu/packages/python-science.scm (python-bottleneck)[arguments]: Adjust custom 'check phase to honor the #:tests? flag. Efraim Flashner 2023-05-08gnu: python-bottleneck: Update to 1.3.7....* gnu/packages/python-science.scm (python-bottleneck): Update to 1.3.7. Efraim Flashner 2023-04-26gnu: python-distributed: Fix build....* gnu/packages/python-science.scm (python-distributed)[build-system]: Use pyproject-build-system. [arguments]: Hide deprecation warnings from tornado, because they break almost all tests; disable three more tests. Ricardo Wurmus 2023-04-14Merge branch 'master' into core-updates....Conflicts: gnu/local.mk gnu/packages/build-tools.scm gnu/packages/certs.scm gnu/packages/check.scm gnu/packages/compression.scm gnu/packages/cups.scm gnu/packages/fontutils.scm gnu/packages/gnuzilla.scm gnu/packages/guile.scm gnu/packages/ibus.scm gnu/packages/image-processing.scm gnu/packages/linux.scm gnu/packages/music.scm gnu/packages/nss.scm gnu/packages/pdf.scm gnu/packages/python-xyz.scm gnu/packages/qt.scm gnu/packages/ruby.scm gnu/packages/shells.scm gnu/packages/tex.scm gnu/packages/video.scm gnu/packages/vulkan.scm gnu/packages/web.scm gnu/packages/webkit.scm gnu/packages/wm.scm Maxim Cournoyer 2023-04-11gnu: python-scipy: Update to 1.10.1....* gnu/packages/python-science.scm (python-scipy): Update to 1.10.1. [build-system]: Use pyproject-build-system. [arguments]: Add #:build-backend argument. Remove loosen-requirements, build and install phases. [native-inputs]: Remove python-pypa-build. Maxim Cournoyer 2023-03-24gnu: python-scikit-allel: Use pyproject-build-system....* gnu/packages/python-science.scm (python-scikit-allel): Move up to create alphabetic order. [build-system]: Use pyproject-build-system. [arguments]: Provide test flags instead of overriding 'check phase; split out build step into new 'build-ext phase. Disable roh_mhmm tests. Ricardo Wurmus 2023-03-24gnu: Add python-scikit-optimize....* gnu/packages/python-science.scm (python-scikit-optimize): New variable. Ricardo Wurmus 2023-03-21gnu: Add python-libneuroml....* gnu/packages/python-science.scm (python-libneuroml): New variable. Lars-Dominik Braun 2023-03-21gnu: Add python-pylems....* gnu/packages/python-science.scm (python-pylems): New variable. Lars-Dominik Braun 2023-01-08gnu: Add python-pydicom....* gnu/packages/python-science.scm (python-pydicom): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Antero Mejr 2022-12-05gnu: python-sgp4: Move to astronomy....* gnu/packages/astronomy.scm: (python-sgp4): Move here from python-science.scm. [description]: Expand description, annotate acronyms, add link to CelesTrak. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Sharlatan Hellseher 2022-12-05gnu: python-sgp4: Update to 2.21....The latest version passes build on aarch64-linux system. * gnu/packages/python-science.scm (python-sgp4): Update to 2.21. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Sharlatan Hellseher 2022-12-02gnu: python-msgpack-numpy: Update to 0.4.8....* gnu/packages/python-science.scm (python-msgpack-numpy): Update to 0.4.8. Navid Afkhami 2022-11-11gnu: Add python-tspex....* gnu/packages/python-science.scm (python-tspex): New variable. Co-authored-by: Ricardo Wurmus <rekado@elephly.net> Navid Afkhami 2022-11-04gnu: Add python-pyts....* gnu/packages/python-science.scm (python-pyts): New variable. Ricardo Wurmus 2022-10-18gnu: Add python-simple-pid....* gnu/packages/python-science.scm (python-simple-pid): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> jgart 2022-09-29Merge branch 'master' into stagingMarius Bakke 2022-09-28gnu: Add python-simplespectral....* gnu/packages/python-science.scm (python-simplespectral): New variable. Guillaume Le Vaillant