gnu: librsvg: Enable cross compiling.
* gnu/packages/gnome.scm (librsvg)[arguments]: Use this-package-input to find gdk-pixbuf in 'patch-gdk-pixbuf-thumbnailer phase. Adjust 'prepare-for-build phase to set PKG_CONFIG and RUST_TARGET when needed. Adjust configure-flags when cross-compiling. [native-inputs]: Add gdk-pixbuf. [inputs]: Add gobject-introspection. Change-Id: I977c48957a6f50a777b52ea59c0d1f8bd6edcc1b
parent
fc5677a018
commit
a90043cfe8
|
@ -3583,11 +3583,19 @@ for dealing with different structured file formats.")
|
||||||
;; https://gitlab.gnome.org/GNOME/librsvg/-/issues/955).
|
;; https://gitlab.gnome.org/GNOME/librsvg/-/issues/955).
|
||||||
(substitute* "gdk-pixbuf-loader/librsvg.thumbnailer.in"
|
(substitute* "gdk-pixbuf-loader/librsvg.thumbnailer.in"
|
||||||
(("@bindir@/gdk-pixbuf-thumbnailer")
|
(("@bindir@/gdk-pixbuf-thumbnailer")
|
||||||
(search-input-file inputs "bin/gdk-pixbuf-thumbnailer")))))
|
(string-append #$(this-package-input "gdk-pixbuf")
|
||||||
|
"/bin/gdk-pixbuf-thumbnailer")))))
|
||||||
(add-after 'unpack 'prepare-for-build
|
(add-after 'unpack 'prepare-for-build
|
||||||
(lambda _
|
(lambda _
|
||||||
;; In lieu of #:make-flags
|
;; In lieu of #:make-flags
|
||||||
(setenv "CC" #$(cc-for-target))
|
(setenv "CC" #$(cc-for-target))
|
||||||
|
(setenv "PKG_CONFIG" #$(pkg-config-for-target))
|
||||||
|
(when #$(%current-target-system)
|
||||||
|
(setenv "RUST_TARGET"
|
||||||
|
(string-replace
|
||||||
|
#$(%current-target-system)
|
||||||
|
"-unknown-linux-gnu"
|
||||||
|
(string-index #$(%current-target-system) #\-))))
|
||||||
;; Something about the build environment resists building
|
;; Something about the build environment resists building
|
||||||
;; successfully with the '--locked' flag.
|
;; successfully with the '--locked' flag.
|
||||||
(substitute* '("Makefile.am" "Makefile.in")
|
(substitute* '("Makefile.am" "Makefile.in")
|
||||||
|
@ -3620,7 +3628,18 @@ for dealing with different structured file formats.")
|
||||||
(apply (assoc-ref gnu:%standard-phases 'configure)
|
(apply (assoc-ref gnu:%standard-phases 'configure)
|
||||||
#:configure-flags
|
#:configure-flags
|
||||||
(list "--disable-static"
|
(list "--disable-static"
|
||||||
"--enable-vala")
|
#$@(if (%current-target-system)
|
||||||
|
#~(;; g-ir-scanner can't import its modules
|
||||||
|
;; and vala currently can't be cross-compiled.
|
||||||
|
"--enable-introspection=no"
|
||||||
|
"--enable-vala=no"
|
||||||
|
;; These two are necessary for cross-compiling.
|
||||||
|
(string-append
|
||||||
|
"--build=" #$(nix-system->gnu-triplet
|
||||||
|
(%current-system)))
|
||||||
|
(string-append
|
||||||
|
"--host=" #$(%current-target-system)))
|
||||||
|
#~("--enable-vala")))
|
||||||
args)))
|
args)))
|
||||||
(add-after 'configure 'dont-vendor-self
|
(add-after 'configure 'dont-vendor-self
|
||||||
(lambda* (#:key vendor-dir #:allow-other-keys)
|
(lambda* (#:key vendor-dir #:allow-other-keys)
|
||||||
|
@ -3636,8 +3655,8 @@ for dealing with different structured file formats.")
|
||||||
#:test-target "check"))))
|
#:test-target "check"))))
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(assoc-ref gnu:%standard-phases 'install)))))
|
(assoc-ref gnu:%standard-phases 'install)))))
|
||||||
(native-inputs (list `(,glib "bin") gobject-introspection pkg-config vala))
|
(native-inputs (list gdk-pixbuf `(,glib "bin") gobject-introspection pkg-config vala))
|
||||||
(inputs (list freetype harfbuzz libxml2 pango))
|
(inputs (list freetype gobject-introspection harfbuzz libxml2 pango))
|
||||||
(propagated-inputs (list cairo gdk-pixbuf glib))
|
(propagated-inputs (list cairo gdk-pixbuf glib))
|
||||||
(synopsis "SVG rendering library")
|
(synopsis "SVG rendering library")
|
||||||
(description "Librsvg is a library to render SVG images to Cairo surfaces.
|
(description "Librsvg is a library to render SVG images to Cairo surfaces.
|
||||||
|
|
Reference in New Issue