gnu: darktable: Improve package style.

* gnu/packages/photo.scm (darktable)[arguments]: Use G-expressions.
[native-inputs]: Remove labels.
This commit is contained in:
Nicolas Goaziou 2023-04-08 13:33:34 +02:00
parent 841a2e2d9c
commit c47694f116
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -472,17 +472,20 @@ (define-public darktable
(base32 "1b3vr6njwqfvnrx3qpbg5aqcbl1z8nxnxcgyyw0sd4a20z33jfk0")))) (base32 "1b3vr6njwqfvnrx3qpbg5aqcbl1z8nxnxcgyyw0sd4a20z33jfk0"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:configure-flags '("-DBINARY_PACKAGE_BUILD=On" (list
#:configure-flags
#~(list "-DBINARY_PACKAGE_BUILD=On"
"-DBUILD_TESTING=On") "-DBUILD_TESTING=On")
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'libOpenCL-path (add-after 'unpack 'libOpenCL-path
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
;; Statically link to libOpenCL. ;; Statically link to libOpenCL.
(substitute* "./src/common/dlopencl.c" (substitute* "./src/common/dlopencl.c"
(("\"libOpenCL\"") (("\"libOpenCL\"")
(string-append "\"" (assoc-ref inputs "opencl-icd-loader") (string-append "\""
"/lib/libOpenCL.so\""))))) (search-input-file inputs "/lib/libOpenCL.so")
"\"")))))
(add-after 'unpack 'fix-missing-include (add-after 'unpack 'fix-missing-include
(lambda _ (lambda _
;; Fix missing include needed to build tests. See upstream ;; Fix missing include needed to build tests. See upstream
@ -491,43 +494,41 @@ (define-public darktable
(("once") (("once")
"once\n#include \"common/image.h\"")))) "once\n#include \"common/image.h\""))))
(add-before 'configure 'prepare-build-environment (add-before 'configure 'prepare-build-environment
(lambda* (#:key inputs #:allow-other-keys) (lambda _
;; Rawspeed fails to build with GCC due to OpenMP error: ;; Rawspeed fails to build with GCC due to OpenMP error:
;; "undefined reference to `GOMP_loop_nonmonotonic_dynamic_next'" ;; "undefined reference to `GOMP_loop_nonmonotonic_dynamic_next'"
(setenv "CC" "clang") (setenv "CXX" "clang++") (setenv "CC" "clang")
(setenv "CXX" "clang++")
;; Darktable looks for opencl-c.h in the LLVM dir. Guix installs ;; Darktable looks for opencl-c.h in the LLVM dir. Guix installs
;; it to the Clang dir. We fix this by patching CMakeLists.txt. ;; it to the Clang dir. We fix this by patching CMakeLists.txt.
(substitute* "CMakeLists.txt" (substitute* "CMakeLists.txt"
(("\\$\\{LLVM_INSTALL_PREFIX\\}") (("\\$\\{LLVM_INSTALL_PREFIX\\}")
(assoc-ref %build-inputs "clang"))))) #$(this-package-native-input "clang")))))
(add-before 'configure 'set-LDFLAGS (add-before 'configure 'set-LDFLAGS
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(setenv "LDFLAGS" (setenv "LDFLAGS"
(string-append (string-append "-Wl,-rpath=" #$output "/lib/darktable"))))
"-Wl,-rpath="
(assoc-ref outputs "out") "/lib/darktable"))))
(add-after 'install 'wrap-program (add-after 'install 'wrap-program
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda _
(wrap-program (string-append (assoc-ref outputs "out") (wrap-program (string-append #$output "/bin/darktable")
"/bin/darktable")
;; For GtkFileChooserDialog. ;; For GtkFileChooserDialog.
`("GSETTINGS_SCHEMA_DIR" = `("GSETTINGS_SCHEMA_DIR" =
(,(string-append (assoc-ref inputs "gtk+") (,(string-append #$(this-package-input "gtk+")
"/share/glib-2.0/schemas"))))))))) "/share/glib-2.0/schemas")))))))))
(native-inputs (native-inputs
`(("clang" ,clang-11) (list clang-11
("cmocka" ,cmocka) cmocka
("desktop-file-utils" ,desktop-file-utils) desktop-file-utils
("glib:bin" ,glib "bin") `(,glib "bin")
("gobject-introspection" ,gobject-introspection) gobject-introspection
("intltool" ,intltool) intltool
("llvm" ,llvm-11) ;should match the Clang version llvm-11 ;should match the Clang version
("opencl-headers" ,opencl-headers) opencl-headers
("perl" ,perl) perl
("pkg-config" ,pkg-config) pkg-config
("po4a" ,po4a) po4a
("python-wrapper" ,python-wrapper) python-wrapper
("ruby" ,ruby))) ruby))
(inputs (inputs
(list bash-minimal (list bash-minimal
cairo cairo
@ -578,8 +579,8 @@ (define-public darktable
(supported-systems '("x86_64-linux" "aarch64-linux" "powerpc64le-linux")) (supported-systems '("x86_64-linux" "aarch64-linux" "powerpc64le-linux"))
(properties (properties
'((release-monitoring-url . "https://github.com/darktable-org/darktable/releases"))) '((release-monitoring-url . "https://github.com/darktable-org/darktable/releases")))
(license (list license:gpl3+ ;; Darktable itself. (license (list license:gpl3+ ;Darktable itself
license:lgpl2.1+)))) ;; Rawspeed library. license:lgpl2.1+)))) ;Rawspeed library
(define-public photoflare (define-public photoflare
(package (package