gnu: freeimage: Remove input labels.

* gnu/packages/image.scm (freeimage): Reindent.
[arguments]: Use G-expression and SEARCH-INPUT-DIRECTORY.
[inputs]: Remove labels.
This commit is contained in:
Marius Bakke 2022-08-09 23:13:45 +02:00
parent f2e9f04dd9
commit 02de6a5981
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -19,7 +19,7 @@
;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com> ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com> ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com> ;;; Copyright © 2018-2020, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr> ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com> ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com> ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
@ -98,6 +98,7 @@ (define-module (gnu packages image)
#:use-module (gnu packages fonts) #:use-module (gnu packages fonts)
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix utils) #:use-module (guix utils)
@ -1071,89 +1072,89 @@ (define-public giblib
(define-public freeimage (define-public freeimage
(package (package
(name "freeimage") (name "freeimage")
(version "3.18.0") (version "3.18.0")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
"mirror://sourceforge/freeimage/Source%20Distribution/" "mirror://sourceforge/freeimage/Source%20Distribution/"
version "/FreeImage" version "/FreeImage"
(string-concatenate (string-split version #\.)) (string-concatenate (string-split version #\.))
".zip")) ".zip"))
(sha256 (sha256
(base32 (base32
"1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl")) "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin '(begin
(for-each (for-each
(lambda (dir) (lambda (dir)
(delete-file-recursively (string-append "Source/" dir))) (delete-file-recursively (string-append "Source/" dir)))
'("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite" '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
"LibJXR" "LibWebP" "OpenEXR" "ZLib")))) "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
(patches (patches
(append (append
(search-patches "freeimage-unbundle.patch") (search-patches "freeimage-unbundle.patch")
;; Take one patch from Arch Linux that adds LibRaw 0.20 compatibility. ;; Take one patch from Arch Linux that adds LibRaw 0.20 compatibility.
(list (origin (list (origin
(method url-fetch) (method url-fetch)
(uri "https://raw.githubusercontent.com/archlinux\ (uri "https://raw.githubusercontent.com/archlinux\
/svntogit-community/ca3e6a52f5a46dec87cbf85e9d84fe370e282c8c/trunk\ /svntogit-community/ca3e6a52f5a46dec87cbf85e9d84fe370e282c8c/trunk\
/freeimage-libraw-0.20.patch") /freeimage-libraw-0.20.patch")
(file-name "freeimage-libraw-compat.patch") (file-name "freeimage-libraw-compat.patch")
(sha256 (sha256
(base32 (base32
"0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki")))))))) "0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:phases
;; According to Fedora these files depend on private headers, but their #~(modify-phases %standard-phases
;; presence is required for building, so we replace them with empty files. ;; According to Fedora these files depend on private headers, but their
(add-after 'unpack 'delete-unbuildable-files ;; presence is required for building, so we replace them with empty files.
(lambda _ (add-after 'unpack 'delete-unbuildable-files
(for-each (lambda (file) (lambda _
(delete-file file) (for-each (lambda (file)
(close (open file O_CREAT))) (delete-file file)
'("Source/FreeImage/PluginG3.cpp" (close (open file O_CREAT)))
"Source/FreeImageToolkit/JPEGTransform.cpp")) '("Source/FreeImage/PluginG3.cpp"
#t)) "Source/FreeImageToolkit/JPEGTransform.cpp"))))
;; These scripts generate the Makefiles. ;; These scripts generate the Makefiles.
(replace 'configure (replace 'configure
(lambda _ (lambda _
(invoke "sh" "gensrclist.sh") (invoke "sh" "gensrclist.sh")
(invoke "sh" "genfipsrclist.sh"))) (invoke "sh" "genfipsrclist.sh")))
(add-before 'build 'patch-makefile (add-before 'build 'patch-makefile
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(substitute* "Makefile.gnu" (substitute* "Makefile.gnu"
(("/usr") (assoc-ref outputs "out")) (("/usr") (assoc-ref outputs "out"))
(("-o root -g root") "")) (("-o root -g root") "")))))
#t)))
#:make-flags #:make-flags
(list ,(string-append "CC=" (cc-for-target)) #~(let ((jxrlib (search-input-directory %build-inputs "include/jxrlib")))
;; We need '-fpermissive' for Source/FreeImage.h. (list (string-append "CC=" #$(cc-for-target))
;; libjxr doesn't have a pkg-config file. ;; We need '-fpermissive' for Source/FreeImage.h.
(string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive " ;; libjxr doesn't have a pkg-config file.
"-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib")) (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden "
#:tests? #f)) ; no check target "-fpermissive -I" jxrlib)))
(native-inputs #:tests? #f)) ; no check target
(list pkg-config unzip)) (native-inputs
(inputs (list pkg-config unzip))
`(("libjpeg" ,libjpeg-turbo) (inputs
("libjxr" ,libjxr) (list libjpeg-turbo
("libpng" ,libpng) libjxr
("libraw" ,libraw) libpng
("libtiff" ,libtiff) libraw
("libwebp" ,libwebp) libtiff
("openexr" ,openexr-2) libwebp
("openjpeg" ,openjpeg) openexr-2
("zlib" ,zlib))) openjpeg
(synopsis "Library for handling popular graphics image formats") zlib))
(description (synopsis "Library for handling popular graphics image formats")
"FreeImage is a library for developers who would like to support popular (description
"FreeImage is a library for developers who would like to support popular
graphics image formats like PNG, BMP, JPEG, TIFF and others.") graphics image formats like PNG, BMP, JPEG, TIFF and others.")
(license license:gpl2+) (license license:gpl2+)
(home-page "https://freeimage.sourceforge.io/"))) (home-page "https://freeimage.sourceforge.io/")))
(define-public vigra (define-public vigra
(let ((commit "9b514fa00a136f5fd81bb57ee9f6293c333ffc1f") (let ((commit "9b514fa00a136f5fd81bb57ee9f6293c333ffc1f")