diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm index d053935a86..fcc6642280 100644 --- a/gnu/packages/cmake.scm +++ b/gnu/packages/cmake.scm @@ -152,7 +152,7 @@ (apply invoke "./configure" configure-flags)))))) (native-inputs `(("bzip2" ,bzip2) - ("curl" ,curl-minimal) + ("curl" ,curl) ("expat" ,expat) ("file" ,file) ("libarchive" ,libarchive) @@ -235,6 +235,18 @@ and workspaces that can be used in the compiler environment of your choice.") (search-paths (package-native-search-paths cmake-minimal)))) +;; The purpose of this package is to solve a circular dependency between +;; packages that use cmake-build-system and CMakes own dependencies. +(define-public cmake-minimal-bootstrap + (package + (inherit cmake-minimal) + (name "cmake-minimal-bootstrap") + (native-inputs + `(;; cURL depends on ghostscript (via groff and OpenLDAP), which depends on + ;; 'cmake-build-system' through libtiff and ultimately libjpeg-turbo. + ("curl" ,curl-minimal) + ,@(alist-delete "curl" (package-native-inputs cmake-minimal)))))) + (define-public emacs-cmake-mode (package (inherit cmake) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 38efe61780..1b86f700e4 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -46,6 +46,7 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages boost) #:use-module (gnu packages check) + #:use-module (gnu packages cmake) #:use-module (gnu packages curl) #:use-module (gnu packages compression) #:use-module (gnu packages documentation) @@ -1505,8 +1506,13 @@ is hereby granted.")))) (native-inputs `(("nasm" ,nasm))) (arguments - '(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib" - "-DENABLE_STATIC=0"))) + `(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib" + "-DENABLE_STATIC=0") + ,@(if (%current-target-system) + '() + ;; Use a special "bootstrap" CMake for the native build to work + ;; around a circular dependency between CMake and this package. + `(#:cmake ,cmake-minimal-bootstrap)))) (home-page "https://libjpeg-turbo.org/") (synopsis "SIMD-accelerated JPEG image handling library") (description "libjpeg-turbo is a JPEG image codec that accelerates baseline