gnu: catimg: Simplify.
* gnu/packages/image-viewers.scm (catimg)[arguments]: Rename custom "configure" phase to "patch-convert"; remove custom "build" phase; move "install-script" phase after "install"; simplify phases.
This commit is contained in:
		
							parent
							
								
									d39a54ff72
								
							
						
					
					
						commit
						e2f47efee6
					
				
					 1 changed files with 13 additions and 26 deletions
				
			
		| 
						 | 
					@ -301,37 +301,24 @@ your images.  Among its features are:
 | 
				
			||||||
     `(#:tests? #f                      ; no tests
 | 
					     `(#:tests? #f                      ; no tests
 | 
				
			||||||
       #:phases
 | 
					       #:phases
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					       (modify-phases %standard-phases
 | 
				
			||||||
         (replace 'configure
 | 
					         (add-after 'unpack 'patch-convert
 | 
				
			||||||
           (lambda* (#:key inputs #:allow-other-keys)
 | 
					 | 
				
			||||||
             (let* ((magic (assoc-ref %build-inputs "imagemagick"))
 | 
					 | 
				
			||||||
                    (convert (string-append magic "/bin/convert")))
 | 
					 | 
				
			||||||
               (substitute* "catimg"
 | 
					 | 
				
			||||||
                 ;; By replacing "convert", we also replace the "convert"
 | 
					 | 
				
			||||||
                 ;; in the message 'The version of convert is too old, don't
 | 
					 | 
				
			||||||
                 ;; expect good results :('.  This should not happen, but in
 | 
					 | 
				
			||||||
                 ;; practice this error message should not affect us.
 | 
					 | 
				
			||||||
                 (("convert") convert))
 | 
					 | 
				
			||||||
               #t)))
 | 
					 | 
				
			||||||
         (replace 'build
 | 
					 | 
				
			||||||
           (lambda _
 | 
					           (lambda _
 | 
				
			||||||
             (let* ((out (assoc-ref %outputs "out"))
 | 
					             (substitute* "catimg"
 | 
				
			||||||
                    (man (string-append out "/share/man/man1")))
 | 
					               ;; By replacing "convert", we also replace the "convert"
 | 
				
			||||||
               (zero? (system* "cmake"
 | 
					               ;; in the message 'The version of convert is too old, don't
 | 
				
			||||||
                               (string-append "-DCMAKE_INSTALL_PREFIX=" out)
 | 
					               ;; expect good results :('.  This should not happen, but in
 | 
				
			||||||
                               (string-append "-DMAN_OUTPUT_PATH=" man)
 | 
					               ;; practice this error message should not affect us.
 | 
				
			||||||
                               "."))
 | 
					               (("convert") (which "convert")))
 | 
				
			||||||
               (zero? (system* "make")))))
 | 
					             #t))
 | 
				
			||||||
         (add-before 'install 'install-script
 | 
					         (add-after 'install 'install-script
 | 
				
			||||||
           (lambda* (#:key outputs #:allow-other-keys)
 | 
					           (lambda* (#:key outputs #:allow-other-keys)
 | 
				
			||||||
             ;; The bash script lacks an file extension.  We have to rename
 | 
					             ;; The bash script lacks an file extension.  We have to rename
 | 
				
			||||||
             ;; it so that the C program and the bash script can be happy
 | 
					             ;; it so that the C program and the bash script can be happy
 | 
				
			||||||
             ;; side by side.
 | 
					             ;; side by side.
 | 
				
			||||||
             (let* ((out (assoc-ref outputs "out"))
 | 
					             (copy-file "../source/catimg"
 | 
				
			||||||
                    (bin (string-append out "/bin")))
 | 
					                        (string-append (assoc-ref outputs "out")
 | 
				
			||||||
               (install-file "catimg" bin)
 | 
					                                       "/bin/catimg.sh"))
 | 
				
			||||||
               (rename-file (string-append bin "/catimg")
 | 
					             #t)))))
 | 
				
			||||||
                            (string-append bin "/catimg.sh"))
 | 
					 | 
				
			||||||
               #t))))))
 | 
					 | 
				
			||||||
    (inputs
 | 
					    (inputs
 | 
				
			||||||
     `(("imagemagick" ,imagemagick))) ; for the bash script version
 | 
					     `(("imagemagick" ,imagemagick))) ; for the bash script version
 | 
				
			||||||
    (home-page "https://github.com/posva/catimg")
 | 
					    (home-page "https://github.com/posva/catimg")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue