gnu: skopeo: Update to 1.15.0.
The package is also converted to gnu-build-system in order to take advantage
of already existing Makefile instead of reinventing (parts) of it in Guile.
* gnu/packages/virtualization.scm (skopeo)[version]: Update to 1.15.0.
[build-system]: Use gnu-build-system.
[native-inputs]: Add go-1.21, sort.
[inputs]: Add bash-minimal.
[arguments]<#:import-path, #:install-source?>: Delete.
<#:make-flags, #:test-target, #:imported-modules>: New arguments.
<#:phases>{'configure}: Delete.
{'set-env, 'cc-to-gcc, 'wrap-skopeo, 'remove-go-references}: New phases.
Change-Id: I1010e1f4fbdc093646c2879bdf30125ab2e88bdd
Signed-off-by: Christopher Baines <mail@cbaines.net>
			
			
This commit is contained in:
		
							parent
							
								
									869fa14b78
								
							
						
					
					
						commit
						142e1c2cf0
					
				
					 1 changed files with 55 additions and 26 deletions
				
			
		| 
						 | 
					@ -151,6 +151,7 @@
 | 
				
			||||||
  #:use-module (guix gexp)
 | 
					  #:use-module (guix gexp)
 | 
				
			||||||
  #:use-module (guix git-download)
 | 
					  #:use-module (guix git-download)
 | 
				
			||||||
  #:use-module (guix packages)
 | 
					  #:use-module (guix packages)
 | 
				
			||||||
 | 
					  #:use-module (guix modules)
 | 
				
			||||||
  #:use-module (guix utils)
 | 
					  #:use-module (guix utils)
 | 
				
			||||||
  #:use-module (srfi srfi-1)
 | 
					  #:use-module (srfi srfi-1)
 | 
				
			||||||
  #:use-module (srfi srfi-26)
 | 
					  #:use-module (srfi srfi-26)
 | 
				
			||||||
| 
						 | 
					@ -2257,7 +2258,7 @@ Open Container Initiative (OCI) image layout and its tagged images.")
 | 
				
			||||||
(define-public skopeo
 | 
					(define-public skopeo
 | 
				
			||||||
  (package
 | 
					  (package
 | 
				
			||||||
    (name "skopeo")
 | 
					    (name "skopeo")
 | 
				
			||||||
    (version "1.2.3")
 | 
					    (version "1.15.0")
 | 
				
			||||||
    (source (origin
 | 
					    (source (origin
 | 
				
			||||||
              (method git-fetch)
 | 
					              (method git-fetch)
 | 
				
			||||||
              (uri (git-reference
 | 
					              (uri (git-reference
 | 
				
			||||||
| 
						 | 
					@ -2266,12 +2267,15 @@ Open Container Initiative (OCI) image layout and its tagged images.")
 | 
				
			||||||
              (file-name (git-file-name name version))
 | 
					              (file-name (git-file-name name version))
 | 
				
			||||||
              (sha256
 | 
					              (sha256
 | 
				
			||||||
               (base32
 | 
					               (base32
 | 
				
			||||||
                "0n22sdif437ddg5ch0ipwim3fg0n6ihc9bfi52qkhy3r1grz04hs"))))
 | 
					                "1f9n3ysdmll7vq8dmgpv03m8aqq3w9cfvbmxxpwmnv1nlfc67ihq"))))
 | 
				
			||||||
    (build-system go-build-system)
 | 
					    (build-system gnu-build-system)
 | 
				
			||||||
    (native-inputs
 | 
					    (native-inputs
 | 
				
			||||||
     (list pkg-config go-github-com-go-md2man))
 | 
					     (list go-1.21
 | 
				
			||||||
 | 
					           go-github-com-go-md2man
 | 
				
			||||||
 | 
					           pkg-config))
 | 
				
			||||||
    (inputs
 | 
					    (inputs
 | 
				
			||||||
     (list btrfs-progs
 | 
					     (list bash-minimal
 | 
				
			||||||
 | 
					           btrfs-progs
 | 
				
			||||||
           eudev
 | 
					           eudev
 | 
				
			||||||
           libassuan
 | 
					           libassuan
 | 
				
			||||||
           libselinux
 | 
					           libselinux
 | 
				
			||||||
| 
						 | 
					@ -2280,27 +2284,52 @@ Open Container Initiative (OCI) image layout and its tagged images.")
 | 
				
			||||||
           glib
 | 
					           glib
 | 
				
			||||||
           gpgme))
 | 
					           gpgme))
 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     '(#:import-path "github.com/containers/skopeo"
 | 
					     (list
 | 
				
			||||||
       #:install-source? #f
 | 
					      #:make-flags
 | 
				
			||||||
 | 
					      #~(list (string-append "CC=" #$(cc-for-target))
 | 
				
			||||||
 | 
					              "PREFIX="
 | 
				
			||||||
 | 
					              (string-append "DESTDIR=" #$output)
 | 
				
			||||||
 | 
					              (string-append "GOMD2MAN="
 | 
				
			||||||
 | 
					                             #$go-github-com-go-md2man "/bin/go-md2man"))
 | 
				
			||||||
      #:tests? #f                       ; The tests require Docker
 | 
					      #:tests? #f                       ; The tests require Docker
 | 
				
			||||||
 | 
					      #:test-target "test-unit"
 | 
				
			||||||
 | 
					      #:imported-modules
 | 
				
			||||||
 | 
					      (source-module-closure `(,@%gnu-build-system-modules
 | 
				
			||||||
 | 
					                               (guix build go-build-system)))
 | 
				
			||||||
      #:phases
 | 
					      #:phases
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					      #~(modify-phases %standard-phases
 | 
				
			||||||
         (replace 'build
 | 
					          (delete 'configure)
 | 
				
			||||||
           (lambda* (#:key import-path #:allow-other-keys)
 | 
					          (add-after 'unpack 'set-env
 | 
				
			||||||
             (with-directory-excursion (string-append "src/" import-path)
 | 
					            (lambda _
 | 
				
			||||||
               (invoke "make" "bin/skopeo"))))
 | 
					              ;; When running go, things fail because HOME=/homeless-shelter.
 | 
				
			||||||
         (add-after 'build 'build-docs
 | 
					              (setenv "HOME" "/tmp")
 | 
				
			||||||
           (lambda* (#:key import-path #:allow-other-keys)
 | 
					              ;; Required for detecting btrfs in hack/btrfs* due to bug in GNU
 | 
				
			||||||
             (with-directory-excursion (string-append "src/" import-path)
 | 
					              ;; Make <4.4 causing CC not to be propagated into $(shell ...)
 | 
				
			||||||
               (invoke "make" "docs"))))
 | 
					              ;; calls.  Can be removed once we update to >4.3.
 | 
				
			||||||
         (replace 'install
 | 
					              ;;
 | 
				
			||||||
           (lambda* (#:key import-path outputs #:allow-other-keys)
 | 
					              ;; This techically does nothing *now*, but after upstream
 | 
				
			||||||
             (with-directory-excursion (string-append "src/" import-path)
 | 
					              ;; issue[1] is solved and 'cc-to-gcc phase is removed, it will
 | 
				
			||||||
               (let ((out (assoc-ref outputs "out")))
 | 
					              ;; start being required.
 | 
				
			||||||
                 (install-file "default-policy.json"
 | 
					              ;; 1: https://github.com/containers/skopeo/issues/2278
 | 
				
			||||||
                               (string-append out "/etc/containers"))
 | 
					              (setenv "CC" #$(cc-for-target))))
 | 
				
			||||||
                 (invoke "make" "install-binary" "install-completions" "install-docs"
 | 
					          (add-after 'unpack 'cc-to-gcc
 | 
				
			||||||
                         (string-append "PREFIX=" out)))))))))
 | 
					            (lambda _
 | 
				
			||||||
 | 
					              (for-each (lambda (file)
 | 
				
			||||||
 | 
					                          (substitute* file
 | 
				
			||||||
 | 
					                            (("^cc( -.*)" all rest)
 | 
				
			||||||
 | 
					                             (string-append "\"$CC\"" rest))))
 | 
				
			||||||
 | 
					                        '("hack/btrfs_tag.sh"
 | 
				
			||||||
 | 
					                          "hack/btrfs_installed_tag.sh"
 | 
				
			||||||
 | 
					                          "hack/libdm_tag.sh"
 | 
				
			||||||
 | 
					                          "hack/libsubid_tag.sh"))))
 | 
				
			||||||
 | 
					          (add-after 'install 'wrap-skopeo
 | 
				
			||||||
 | 
					            (lambda _
 | 
				
			||||||
 | 
					              (wrap-program (string-append #$output "/bin/skopeo")
 | 
				
			||||||
 | 
					                `("PATH" suffix
 | 
				
			||||||
 | 
					                  ;; We need at least newuidmap, newgidmap and mount.
 | 
				
			||||||
 | 
					                  ("/run/setuid-programs")))))
 | 
				
			||||||
 | 
					          (add-after 'install 'remove-go-references
 | 
				
			||||||
 | 
					            (@@ (guix build go-build-system) remove-go-references)))))
 | 
				
			||||||
    (home-page "https://github.com/containers/skopeo")
 | 
					    (home-page "https://github.com/containers/skopeo")
 | 
				
			||||||
    (synopsis "Interact with container images and container image registries")
 | 
					    (synopsis "Interact with container images and container image registries")
 | 
				
			||||||
    (description
 | 
					    (description
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue