From unknown Sat Jun 14 05:17:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#38244] [PATCH] build librsvg-next with packaged crates Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 Nov 2019 13:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38244 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38244@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.157399567619800 (code B ref -1); Sun, 17 Nov 2019 13:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Nov 2019 13:01:16 +0000 Received: from localhost ([127.0.0.1]:40451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWKB1-00059I-Gr for submit@debbugs.gnu.org; Sun, 17 Nov 2019 08:01:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:41967) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWKAz-000599-KT for submit@debbugs.gnu.org; Sun, 17 Nov 2019 08:01:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46313) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWKAx-0005gU-8T for guix-patches@gnu.org; Sun, 17 Nov 2019 08:01:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWKAu-0001pk-B5 for guix-patches@gnu.org; Sun, 17 Nov 2019 08:01:10 -0500 Received: from flashner.co.il ([178.62.234.194]:58834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iWKAt-0001bV-To for guix-patches@gnu.org; Sun, 17 Nov 2019 08:01:08 -0500 Received: from localhost (unknown [141.226.13.108]) by flashner.co.il (Postfix) with ESMTPSA id CA7C7401A3 for ; Sun, 17 Nov 2019 13:00:59 +0000 (UTC) Date: Sun, 17 Nov 2019 15:00:28 +0200 From: Efraim Flashner Message-ID: <20191117130028.GE12423@E5400> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Zs/RYxT/hKAHzkfQ" Content-Disposition: inline X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 User-Agent: Mutt/1.12.2 (2019-09-21) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 178.62.234.194 X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --Zs/RYxT/hKAHzkfQ Content-Type: multipart/mixed; boundary="10jrOL3x2xqLmOsH" Content-Disposition: inline --10jrOL3x2xqLmOsH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I've built librsvg-next with a bunch of the packaged crates. It seems like a good start to de-vendoring the crates in librsvg. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --10jrOL3x2xqLmOsH Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="librsvg-crate-replacement.patch" Content-Transfer-Encoding: quoted-printable diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index f9126d18e1..afcda4cd1c 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -75,6 +75,7 @@ #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) + #:use-module (gnu packages crates-io) #:use-module (gnu packages cups) #:use-module (gnu packages curl) #:use-module (gnu packages cyrus-sasl) @@ -165,6 +166,7 @@ #:use-module (gnu packages xorg) #:use-module (gnu packages xorg) #:use-module (gnu artwork) + #:use-module (guix build-system cargo) #:use-module (guix build-system cmake) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system gnu) @@ -177,6 +179,8 @@ #:use-module (guix packages) #:use-module (guix utils) #:use-module (guix gexp) + #:use-module (guix monads) + #:use-module (guix store) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) =20 @@ -1403,37 +1407,239 @@ dealing with different structured file formats.") library.") (license license:lgpl2.0+))) =20 +(define* (computed-origin-method gexp-promise hash-algo hash + #:optional (name "source") + #:key (system (%current-system)) + (guile (default-guile))) + "Return a derivation that executes the G-expression that results +from forcing GEXP-PROMISE." + (mlet %store-monad ((guile (package->derivation guile system))) + (gexp->derivation (or name "computed-origin") + (force gexp-promise) + #:graft? #f ;nothing to graft + #:system system + #:guile-for-build guile))) + +(define librsvg-next-source + (let* ((version "2.46.3") + (upstream-source (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/lib= rsvg/" + (version-major+minor versio= n) "/" + "librsvg-" version ".tar.xz= ")) + (sha256 + (base32 + "1s3a96i7f4pynjwxxvhysp4b6r7kyi8nasdxfyi62hc7= gm34d3kn"))))) + (origin + (method computed-origin-method) + (file-name (string-append "librsvg-" version ".tar.xz")) + (sha256 #f) + (uri + (delay + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (set-path-environment-variable + "PATH" '("bin") + (list "/tmp" + #+(canonical-package xz) + #+(canonical-package gzip) + #+(canonical-package tar))) + (invoke "tar" "xvf" #+upstream-source) + (with-directory-excursion (string-append "librsvg-" #$versio= n) + (for-each + (lambda (crate) + (delete-file-recursively (string-append "vendor/" (car= crate))) + (invoke "tar" "xvf" (cdr crate) "-C" "vendor")) + '( +;; aho-corasick 0.7 +;; alga 0.9 +;; approx 0.3 +;; arrayvec 0.4 + ("atty" . #+(package-source rust-atty-0.2)) + ("autocfg" . #+(package-source rust-autocfg-0.1)) + ("bitflags" . #+(package-source rust-bitflags-1)) +;; block 0.1 +;; bstr 0.2 +;; byteorder 1.3 +;; cairo-rs 0.7 +;; cairo-sys-rs 0.9 +;; cast 0.2 + ("cfg-if" . #+(package-source rust-cfg-if-0.1)) + ("clap" . #+(package-source rust-clap-2)) + ;("cloudabi" . #+(package-source rust-cloudabi-0.0)) +;; criterion 0.2 +;; criterion-plot 0.3 +;; crossbeam-deque 0.7 +;; crossbeam-epoch 0.7 +;; crossbeam-queue 0.1 +;; crossbeam-utils 0.6 +;; cssparser 0.25 +;; cssparser-macros 0.3 +;; csv 1.1 +;; csv-core 0.1 +;; data-url 0.1 +;; downcast-rs 1.0 + ("dtoa" . #+(package-source rust-dtoa-0.4)) +;; dtoa-short 0.3 +;; either 1.5 +;; encoding 0.2 +;; encoding-index-japanese 1.20141219.5 +;; encoding-index-korean 1.20141219.5 +;; encoding-index-simpchinese 1.20141219.5 +;; encoding-index-singlebyte 1.20141219.5 +;; encoding-index-tradchinese 1.20141219.5 +;; encoding_index_tests 0.1 +;; float-cmp 0.5 +;; fragile 0.3 + ;("fuchsia-cprng" . #+(package-source rust-fuchsia-cpr= ng-0.1)) +;; futf 0.1 +;; gdk-pixbuf 0.7 +;; gdk-pixbuf-sys 0.9 +;; generic-array 0.12 +;; gio 0.7 +;; gio-sys 0.9 +;; glib 0.8 +;; glib-sys 0.9 +;; gobject-sys 0.9 +;; idna 0.2 +;; itertools 0.8 + ("itoa" . #+(package-source rust-itoa-0.4)) + ;("language-tags" . #+(package-source rust-language-ta= gs-0.2)) + ("lazy_static" . #+(package-source rust-lazy-static-1.= 3)) + ("libc" . #+(package-source rust-libc-0.2)) +;; libm 0.1 +;; locale_config 0.3 + ("log" . #+(package-source rust-log-0.4)) +;; mac 0.1 +;; malloc_buf 0.0 +;; markup5ever 0.9 + ;("matches" . #+(package-source rust-matches-0.1)) +;; matrixmultiply 0.2 +;; memchr 2.2 +;; memoffset 0.5 +;; nalgebra 0.18 +;; new_debug_unreachable 1.0 + ("nodrop" . #+(package-source rust-nodrop-0.1)) +;; num-complex 0.2 + ("num-integer" . #+(package-source rust-num-integer-0.= 1)) +;; num-rational 0.2 + ("num-traits" . #+(package-source rust-num-traits-0.2)) + ("num_cpus" . #+(package-source rust-num-cpus-1.10)) +;; objc 0.2 +;; objc-foundation 0.1 +;; objc_id 0.1 +;; pango 0.7 +;; pango-sys 0.9 +;; pangocairo 0.8 +;; pangocairo-sys 0.10 + ("percent-encoding" . #+(package-source rust-percent-e= ncoding-2.1)) +;; phf 0.7.24 +;; phf_codegen 0.7.24 +;; phf_generator 0.7.24 +;; phf_shared 0.7.24 + ;("pkg-config" . #+(package-source rust-pkg-config-0.3= )) +;; precomputed-hash 0.1 + ("proc-macro2" . #+(package-source rust-proc-macro2-1.= 0)) +;; procedural-masquerade 0.1 + ("quote" . #+(package-source rust-quote-1.0)) + ;("rand" . #+(package-source rust-rand-0.6)) + ("rand_chacha" . #+(package-source rust-rand-chacha-0.= 1)) + ("rand_core-0.3.1" . #+(package-source rust-rand-core-= 0.3)) + ("rand_core" . #+(package-source rust-rand-core-0.4)) + ("rand_hc" . #+(package-source rust-rand-hc-0.1)) + ("rand_isaac" . #+(package-source rust-rand-isaac-0.1)) + ("rand_jitter" . #+(package-source rust-rand-jitter-0.= 1)) + ("rand_os" . #+(package-source rust-rand-os-0.1)) + ("rand_pcg" . #+(package-source rust-rand-pcg-0.1)) + ("rand_xorshift" . #+(package-source rust-rand-xorshif= t-0.1)) +;; rand_xoshiro 0.1 + ;("rawpointer" . #+(package-source rust-rawpointer-0.1= )) +;; rayon 1.2 +;; rayon-core 1.6 +;; rctree 0.3 + ("rdrand" . #+(package-source rust-rdrand-0.4)) +;; regex 1.3 +;; regex-automata 0.1 + ;("regex-syntax" . #+(package-source rust-regex-syntax= -0.6)) +;; rustc_version 0.2 + ("ryu" . #+(package-source rust-ryu-1.0)) + ("same-file" . #+(package-source rust-same-file-1.0)) + ("scopeguard" . #+(package-source rust-scopeguard-1.0)) +;; semver 0.9 + ;("semver-parser" . #+(package-source rust-semver-pars= er-0.7)) + ("serde" . #+(package-source rust-serde-1.0)) + ("serde_derive" . #+(package-source rust-serde-derive-= 1.0)) + ("serde_json" . #+(package-source rust-serde-json-1.0)) +;; siphasher 0.2 +;; smallvec 0.6 +;; string_cache 0.7 +;; string_cache_codegen 0.4 +;; string_cache_shared 0.3 + ("syn" . #+(package-source rust-syn-1.0)) +;; tendril 0.4 + ("textwrap" . #+(package-source rust-textwrap-0.11)) + ;("thread_local" . #+(package-source rust-thread-local= -0.3)) +;; tinytemplate 1.0 + ;("typenum" . #+(package-source rust-typenum-1.10)) +;; unicode-bidi 0.3 +;; unicode-normalization 0.1 + ("unicode-width" . #+(package-source rust-unicode-widt= h-0.1)) + ("unicode-xid" . #+(package-source rust-unicode-xid-0.= 2)) +;; url 2.1 +;; utf-8 0.7 + ("walkdir" . #+(package-source rust-walkdir-2.2)) + ("winapi" . #+(package-source rust-winapi-0.3)) + ;("winapi-i686-pc-windows-gnu" . #+(package-source rus= t-winapi-i686-pc-windows-gnu-0.4)) + ("winapi-util" . #+(package-source rust-winapi-util-0.= 1)) + ;("winapi-x86_64-pc-windows-gnu" . #+(package-source r= ust-winapi-x86-64-pc-windows-gnu-0.4)) +;; xml-rs 0.8 + ))) + (format #t "Replacing vendored crates in the tarball and rep= acking ...~%") + (force-output) + (invoke "tar" "cfa" #$output + ;; Avoid non-determinism in the archive. We set the + ;; mtime of files in the archive to early 1980 becau= se + ;; the build process fails if the mtime of source + ;; files is pre-1980, due to the creation of zip + ;; archives. + "--mtime=3D@315619200" ; 1980-01-02 UTC + "--owner=3Droot:0" + "--group=3Droot:0" + "--sort=3Dname" + (string-append "librsvg-" #$version)) + #t))))))) + (define-public librsvg-next (package (name "librsvg") (version "2.46.3") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnome/sources/librsvg/" - (version-major+minor version) "/" - "librsvg-" version ".tar.xz")) - (sha256 - (base32 - "1s3a96i7f4pynjwxxvhysp4b6r7kyi8nasdxfyi62hc7gm34d3kn")))) + (source librsvg-next-source) (build-system gnu-build-system) (arguments `(#:configure-flags (list "--disable-static" "--enable-vala") ; needed for e.g. gnome-mines #:make-flags '("CC=3Dgcc") + #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksu= ms' #:phases (modify-phases %standard-phases - ;; Don't patch anything in vendor/ to avoid having to recompute - ;; checksums for the bundled Cargo "crates". TODO: Unbundle thos= e. - (delete 'patch-source-shebangs) - (delete 'patch-generated-file-shebangs) - (delete 'patch-usr-bin-file) - (add-before 'configure 'patch-all-the-things + (add-after 'configure 'patch-cargo-checksums (lambda _ - (for-each patch-shebang '("tap-driver.sh" "tap-test")) - (patch-/usr/bin/file "configure") - (patch-makefile-SHELL "po/Makefile.in.in") - #t)) + (use-modules (guix build cargo-utils)) + (substitute* "librsvg/Cargo.toml" + (("bitflags .*") "bitflags =3D \"1\"\n")) ; 1.2 is vendored + (for-each + (lambda (filename) + (delete-file filename) + (let ((dir (dirname filename))) + (display (string-append + "patch-cargo-checksums: generate-checksums f= or " + dir "\n")) + (generate-checksums dir))) + (find-files "vendor" "\\.cargo(-checksum|_vcs_info).json")) + (delete-file "Cargo.lock") + (invoke "cargo" "generate-lockfile"))) (add-before 'configure 'pre-configure (lambda* (#:key inputs #:allow-other-keys) (substitute* "gdk-pixbuf-loader/Makefile.in" --10jrOL3x2xqLmOsH-- --Zs/RYxT/hKAHzkfQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl3RRGwACgkQQarn3Mo9 g1HnVA//bKpMqEaAZYSQ6b9acqOSJxKgdyM8z72y8P0EcrKXdGrcH3i2cJUe+0Si 64xT3bsMzn8P2FnOFbzp67yjhZIUFNp775ujihFBqR8rXvB+TT9Scn6yYVO61moB BcDhmuAhPep5SngteRNXBVabIdvG9JNOlhCFqZZHXcy2XmmVn+yVNN8Tyj2QFJXC h4WdBpKMMJJuW2npjfjkua9R4NhwOFZZ1Mf0bUgy1NmPyLHm8ELodgjuz7TaIGSG EsKsFQm36HIFrZVu5+spPQ6kzJ8LK9UzVG1CRRRk7n24rrOuA31yFbBPnBktYRc0 jcw9lDJZT+zulCAQaKwJU68Y8tTymoj0CTmimNSGLCLC7IETE0S4JHZedCx47/3u sd7wPnacc7wxT3SjnTlAybkNKg+mGrtPFmaJcfKO6bYbTAslWSCa1KOxN9y2/pWJ 21m7zr+DRT2hKqL9tT9UcsNIYeKfRCLlAtlr3LHTuF8q8QEeOCV3iahU++Vz2bpp vKoo4fU19mFDGtGXUi+N9q8zZU6dBOZ2SeTFmOwdsFl5IjCh+ZGdEBPrA2iv0/Ih yFGVIiZDUUAciWM1xEonufvSAFeL2T5WsRwMBznjRk3R9uiV7L+m8z4AHNnZVmYB /0JflNGLhOcrKFOFkCEpj1PcWMcs/fiH+5jOzblm3D3eom8PQ/Q= =URcx -----END PGP SIGNATURE----- --Zs/RYxT/hKAHzkfQ-- From unknown Sat Jun 14 05:17:39 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Efraim Flashner Subject: bug#38244: closed (Re: [bug#38244] [PATCH] build librsvg-next with packaged crates) Message-ID: References: <20191204103503.GL15280@E5400> <20191117130028.GE12423@E5400> X-Gnu-PR-Message: they-closed 38244 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 38244@debbugs.gnu.org Date: Wed, 04 Dec 2019 10:36:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1575455762-12162-1" This is a multi-part message in MIME format... ------------=_1575455762-12162-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #38244: [PATCH] build librsvg-next with packaged crates which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 38244@debbugs.gnu.org. --=20 38244: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D38244 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1575455762-12162-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 38244-done) by debbugs.gnu.org; 4 Dec 2019 10:35:43 +0000 Received: from localhost ([127.0.0.1]:41473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icS0U-00039d-MT for submit@debbugs.gnu.org; Wed, 04 Dec 2019 05:35:42 -0500 Received: from flashner.co.il ([178.62.234.194]:46890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icS0T-00039O-1B for 38244-done@debbugs.gnu.org; Wed, 04 Dec 2019 05:35:41 -0500 Received: from localhost (unknown [141.226.13.108]) by flashner.co.il (Postfix) with ESMTPSA id CBE73402CA for <38244-done@debbugs.gnu.org>; Wed, 4 Dec 2019 10:35:34 +0000 (UTC) Date: Wed, 4 Dec 2019 12:35:03 +0200 From: Efraim Flashner To: 38244-done@debbugs.gnu.org Subject: Re: [bug#38244] [PATCH] build librsvg-next with packaged crates Message-ID: <20191204103503.GL15280@E5400> References: <20191117130028.GE12423@E5400> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7vAdt9JsdkkzRPKN" Content-Disposition: inline In-Reply-To: <20191117130028.GE12423@E5400> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Patch pushed -- Efraim Flashner אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: flashner.co.il] 0.5 PDS_BTC_ID FP reduced Bitcoin ID 1.0 PDS_BTC_MSGID Bitcoin ID with T_MSGID_NOFQDN2 X-Debbugs-Envelope-To: 38244-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) --7vAdt9JsdkkzRPKN Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Patch pushed --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --7vAdt9JsdkkzRPKN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl3ni9cACgkQQarn3Mo9 g1HQ1w//SVsnR0ox+07qHmVTQAtP+r72s+GbuFFDr0wNVpZfRhALmfaiLPyEcTdz 7Ag0dEcIUkuDO3M1h12mvCusPkw0D209Iyg/3e9TjAu2e5cbjsZsmtHAxFTVwXEx RYW6N3ooUWFNjYm57tCPooeKR3URNf32DKdizhtwjLkPN5rDrRVbPh9kwb0Kvk3p EUQ+SHpDP1NnWN4K9ZIm6dh3n2GuigmgQLLrbdOcHKaMYVINEug/RPIIkuA4+yAJ +GbvqU3/N2iuGQ+TtWYEYFiQjrP+0ZVEFb6qRm4b0VqfxDvtFCBruU4dLLrDD1Vo aPzRTqQH2LicZIK622OoOdF9Fpake9/4I0u5JNEKzx3Kb1lgHaH22VFi/5fMLGO3 eyKzUSS34XLbAQ6QNuo8qOXKgMpuCBqL+wzDoFcmps/3+CJBZOGpQSODwQw9V2Cg KyocIUFSvqaVMms5iCijfLiEcZt9a1205meblvnq3rYuqNPEXftjzgQgbBSgv2Zo iyESqkSXeYR8E6is8jDfuTNaR4r1TjFaZkqoRllx/Ov23t83bybYhkszlrDzNRL+ GFtEyeZ+ROfijJErAewOc/w+2+NyOiSX21by03uOVImVNaa1k7+OqJk5wjxuISIw 2jlfYYYiPnquabV4GidcTLGQbDT0PWe9Z/wUMArKMiL4sSFPLtk= =jFvd -----END PGP SIGNATURE----- --7vAdt9JsdkkzRPKN-- ------------=_1575455762-12162-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Nov 2019 13:01:16 +0000 Received: from localhost ([127.0.0.1]:40451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWKB1-00059I-Gr for submit@debbugs.gnu.org; Sun, 17 Nov 2019 08:01:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:41967) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWKAz-000599-KT for submit@debbugs.gnu.org; Sun, 17 Nov 2019 08:01:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46313) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWKAx-0005gU-8T for guix-patches@gnu.org; Sun, 17 Nov 2019 08:01:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWKAu-0001pk-B5 for guix-patches@gnu.org; Sun, 17 Nov 2019 08:01:10 -0500 Received: from flashner.co.il ([178.62.234.194]:58834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iWKAt-0001bV-To for guix-patches@gnu.org; Sun, 17 Nov 2019 08:01:08 -0500 Received: from localhost (unknown [141.226.13.108]) by flashner.co.il (Postfix) with ESMTPSA id CA7C7401A3 for ; Sun, 17 Nov 2019 13:00:59 +0000 (UTC) Date: Sun, 17 Nov 2019 15:00:28 +0200 From: Efraim Flashner To: guix-patches@gnu.org Subject: [PATCH] build librsvg-next with packaged crates Message-ID: <20191117130028.GE12423@E5400> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Zs/RYxT/hKAHzkfQ" Content-Disposition: inline X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 User-Agent: Mutt/1.12.2 (2019-09-21) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 178.62.234.194 X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --Zs/RYxT/hKAHzkfQ Content-Type: multipart/mixed; boundary="10jrOL3x2xqLmOsH" Content-Disposition: inline --10jrOL3x2xqLmOsH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I've built librsvg-next with a bunch of the packaged crates. It seems like a good start to de-vendoring the crates in librsvg. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --10jrOL3x2xqLmOsH Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="librsvg-crate-replacement.patch" Content-Transfer-Encoding: quoted-printable diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index f9126d18e1..afcda4cd1c 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -75,6 +75,7 @@ #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) + #:use-module (gnu packages crates-io) #:use-module (gnu packages cups) #:use-module (gnu packages curl) #:use-module (gnu packages cyrus-sasl) @@ -165,6 +166,7 @@ #:use-module (gnu packages xorg) #:use-module (gnu packages xorg) #:use-module (gnu artwork) + #:use-module (guix build-system cargo) #:use-module (guix build-system cmake) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system gnu) @@ -177,6 +179,8 @@ #:use-module (guix packages) #:use-module (guix utils) #:use-module (guix gexp) + #:use-module (guix monads) + #:use-module (guix store) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) =20 @@ -1403,37 +1407,239 @@ dealing with different structured file formats.") library.") (license license:lgpl2.0+))) =20 +(define* (computed-origin-method gexp-promise hash-algo hash + #:optional (name "source") + #:key (system (%current-system)) + (guile (default-guile))) + "Return a derivation that executes the G-expression that results +from forcing GEXP-PROMISE." + (mlet %store-monad ((guile (package->derivation guile system))) + (gexp->derivation (or name "computed-origin") + (force gexp-promise) + #:graft? #f ;nothing to graft + #:system system + #:guile-for-build guile))) + +(define librsvg-next-source + (let* ((version "2.46.3") + (upstream-source (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/lib= rsvg/" + (version-major+minor versio= n) "/" + "librsvg-" version ".tar.xz= ")) + (sha256 + (base32 + "1s3a96i7f4pynjwxxvhysp4b6r7kyi8nasdxfyi62hc7= gm34d3kn"))))) + (origin + (method computed-origin-method) + (file-name (string-append "librsvg-" version ".tar.xz")) + (sha256 #f) + (uri + (delay + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (set-path-environment-variable + "PATH" '("bin") + (list "/tmp" + #+(canonical-package xz) + #+(canonical-package gzip) + #+(canonical-package tar))) + (invoke "tar" "xvf" #+upstream-source) + (with-directory-excursion (string-append "librsvg-" #$versio= n) + (for-each + (lambda (crate) + (delete-file-recursively (string-append "vendor/" (car= crate))) + (invoke "tar" "xvf" (cdr crate) "-C" "vendor")) + '( +;; aho-corasick 0.7 +;; alga 0.9 +;; approx 0.3 +;; arrayvec 0.4 + ("atty" . #+(package-source rust-atty-0.2)) + ("autocfg" . #+(package-source rust-autocfg-0.1)) + ("bitflags" . #+(package-source rust-bitflags-1)) +;; block 0.1 +;; bstr 0.2 +;; byteorder 1.3 +;; cairo-rs 0.7 +;; cairo-sys-rs 0.9 +;; cast 0.2 + ("cfg-if" . #+(package-source rust-cfg-if-0.1)) + ("clap" . #+(package-source rust-clap-2)) + ;("cloudabi" . #+(package-source rust-cloudabi-0.0)) +;; criterion 0.2 +;; criterion-plot 0.3 +;; crossbeam-deque 0.7 +;; crossbeam-epoch 0.7 +;; crossbeam-queue 0.1 +;; crossbeam-utils 0.6 +;; cssparser 0.25 +;; cssparser-macros 0.3 +;; csv 1.1 +;; csv-core 0.1 +;; data-url 0.1 +;; downcast-rs 1.0 + ("dtoa" . #+(package-source rust-dtoa-0.4)) +;; dtoa-short 0.3 +;; either 1.5 +;; encoding 0.2 +;; encoding-index-japanese 1.20141219.5 +;; encoding-index-korean 1.20141219.5 +;; encoding-index-simpchinese 1.20141219.5 +;; encoding-index-singlebyte 1.20141219.5 +;; encoding-index-tradchinese 1.20141219.5 +;; encoding_index_tests 0.1 +;; float-cmp 0.5 +;; fragile 0.3 + ;("fuchsia-cprng" . #+(package-source rust-fuchsia-cpr= ng-0.1)) +;; futf 0.1 +;; gdk-pixbuf 0.7 +;; gdk-pixbuf-sys 0.9 +;; generic-array 0.12 +;; gio 0.7 +;; gio-sys 0.9 +;; glib 0.8 +;; glib-sys 0.9 +;; gobject-sys 0.9 +;; idna 0.2 +;; itertools 0.8 + ("itoa" . #+(package-source rust-itoa-0.4)) + ;("language-tags" . #+(package-source rust-language-ta= gs-0.2)) + ("lazy_static" . #+(package-source rust-lazy-static-1.= 3)) + ("libc" . #+(package-source rust-libc-0.2)) +;; libm 0.1 +;; locale_config 0.3 + ("log" . #+(package-source rust-log-0.4)) +;; mac 0.1 +;; malloc_buf 0.0 +;; markup5ever 0.9 + ;("matches" . #+(package-source rust-matches-0.1)) +;; matrixmultiply 0.2 +;; memchr 2.2 +;; memoffset 0.5 +;; nalgebra 0.18 +;; new_debug_unreachable 1.0 + ("nodrop" . #+(package-source rust-nodrop-0.1)) +;; num-complex 0.2 + ("num-integer" . #+(package-source rust-num-integer-0.= 1)) +;; num-rational 0.2 + ("num-traits" . #+(package-source rust-num-traits-0.2)) + ("num_cpus" . #+(package-source rust-num-cpus-1.10)) +;; objc 0.2 +;; objc-foundation 0.1 +;; objc_id 0.1 +;; pango 0.7 +;; pango-sys 0.9 +;; pangocairo 0.8 +;; pangocairo-sys 0.10 + ("percent-encoding" . #+(package-source rust-percent-e= ncoding-2.1)) +;; phf 0.7.24 +;; phf_codegen 0.7.24 +;; phf_generator 0.7.24 +;; phf_shared 0.7.24 + ;("pkg-config" . #+(package-source rust-pkg-config-0.3= )) +;; precomputed-hash 0.1 + ("proc-macro2" . #+(package-source rust-proc-macro2-1.= 0)) +;; procedural-masquerade 0.1 + ("quote" . #+(package-source rust-quote-1.0)) + ;("rand" . #+(package-source rust-rand-0.6)) + ("rand_chacha" . #+(package-source rust-rand-chacha-0.= 1)) + ("rand_core-0.3.1" . #+(package-source rust-rand-core-= 0.3)) + ("rand_core" . #+(package-source rust-rand-core-0.4)) + ("rand_hc" . #+(package-source rust-rand-hc-0.1)) + ("rand_isaac" . #+(package-source rust-rand-isaac-0.1)) + ("rand_jitter" . #+(package-source rust-rand-jitter-0.= 1)) + ("rand_os" . #+(package-source rust-rand-os-0.1)) + ("rand_pcg" . #+(package-source rust-rand-pcg-0.1)) + ("rand_xorshift" . #+(package-source rust-rand-xorshif= t-0.1)) +;; rand_xoshiro 0.1 + ;("rawpointer" . #+(package-source rust-rawpointer-0.1= )) +;; rayon 1.2 +;; rayon-core 1.6 +;; rctree 0.3 + ("rdrand" . #+(package-source rust-rdrand-0.4)) +;; regex 1.3 +;; regex-automata 0.1 + ;("regex-syntax" . #+(package-source rust-regex-syntax= -0.6)) +;; rustc_version 0.2 + ("ryu" . #+(package-source rust-ryu-1.0)) + ("same-file" . #+(package-source rust-same-file-1.0)) + ("scopeguard" . #+(package-source rust-scopeguard-1.0)) +;; semver 0.9 + ;("semver-parser" . #+(package-source rust-semver-pars= er-0.7)) + ("serde" . #+(package-source rust-serde-1.0)) + ("serde_derive" . #+(package-source rust-serde-derive-= 1.0)) + ("serde_json" . #+(package-source rust-serde-json-1.0)) +;; siphasher 0.2 +;; smallvec 0.6 +;; string_cache 0.7 +;; string_cache_codegen 0.4 +;; string_cache_shared 0.3 + ("syn" . #+(package-source rust-syn-1.0)) +;; tendril 0.4 + ("textwrap" . #+(package-source rust-textwrap-0.11)) + ;("thread_local" . #+(package-source rust-thread-local= -0.3)) +;; tinytemplate 1.0 + ;("typenum" . #+(package-source rust-typenum-1.10)) +;; unicode-bidi 0.3 +;; unicode-normalization 0.1 + ("unicode-width" . #+(package-source rust-unicode-widt= h-0.1)) + ("unicode-xid" . #+(package-source rust-unicode-xid-0.= 2)) +;; url 2.1 +;; utf-8 0.7 + ("walkdir" . #+(package-source rust-walkdir-2.2)) + ("winapi" . #+(package-source rust-winapi-0.3)) + ;("winapi-i686-pc-windows-gnu" . #+(package-source rus= t-winapi-i686-pc-windows-gnu-0.4)) + ("winapi-util" . #+(package-source rust-winapi-util-0.= 1)) + ;("winapi-x86_64-pc-windows-gnu" . #+(package-source r= ust-winapi-x86-64-pc-windows-gnu-0.4)) +;; xml-rs 0.8 + ))) + (format #t "Replacing vendored crates in the tarball and rep= acking ...~%") + (force-output) + (invoke "tar" "cfa" #$output + ;; Avoid non-determinism in the archive. We set the + ;; mtime of files in the archive to early 1980 becau= se + ;; the build process fails if the mtime of source + ;; files is pre-1980, due to the creation of zip + ;; archives. + "--mtime=3D@315619200" ; 1980-01-02 UTC + "--owner=3Droot:0" + "--group=3Droot:0" + "--sort=3Dname" + (string-append "librsvg-" #$version)) + #t))))))) + (define-public librsvg-next (package (name "librsvg") (version "2.46.3") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnome/sources/librsvg/" - (version-major+minor version) "/" - "librsvg-" version ".tar.xz")) - (sha256 - (base32 - "1s3a96i7f4pynjwxxvhysp4b6r7kyi8nasdxfyi62hc7gm34d3kn")))) + (source librsvg-next-source) (build-system gnu-build-system) (arguments `(#:configure-flags (list "--disable-static" "--enable-vala") ; needed for e.g. gnome-mines #:make-flags '("CC=3Dgcc") + #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksu= ms' #:phases (modify-phases %standard-phases - ;; Don't patch anything in vendor/ to avoid having to recompute - ;; checksums for the bundled Cargo "crates". TODO: Unbundle thos= e. - (delete 'patch-source-shebangs) - (delete 'patch-generated-file-shebangs) - (delete 'patch-usr-bin-file) - (add-before 'configure 'patch-all-the-things + (add-after 'configure 'patch-cargo-checksums (lambda _ - (for-each patch-shebang '("tap-driver.sh" "tap-test")) - (patch-/usr/bin/file "configure") - (patch-makefile-SHELL "po/Makefile.in.in") - #t)) + (use-modules (guix build cargo-utils)) + (substitute* "librsvg/Cargo.toml" + (("bitflags .*") "bitflags =3D \"1\"\n")) ; 1.2 is vendored + (for-each + (lambda (filename) + (delete-file filename) + (let ((dir (dirname filename))) + (display (string-append + "patch-cargo-checksums: generate-checksums f= or " + dir "\n")) + (generate-checksums dir))) + (find-files "vendor" "\\.cargo(-checksum|_vcs_info).json")) + (delete-file "Cargo.lock") + (invoke "cargo" "generate-lockfile"))) (add-before 'configure 'pre-configure (lambda* (#:key inputs #:allow-other-keys) (substitute* "gdk-pixbuf-loader/Makefile.in" --10jrOL3x2xqLmOsH-- --Zs/RYxT/hKAHzkfQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl3RRGwACgkQQarn3Mo9 g1HnVA//bKpMqEaAZYSQ6b9acqOSJxKgdyM8z72y8P0EcrKXdGrcH3i2cJUe+0Si 64xT3bsMzn8P2FnOFbzp67yjhZIUFNp775ujihFBqR8rXvB+TT9Scn6yYVO61moB BcDhmuAhPep5SngteRNXBVabIdvG9JNOlhCFqZZHXcy2XmmVn+yVNN8Tyj2QFJXC h4WdBpKMMJJuW2npjfjkua9R4NhwOFZZ1Mf0bUgy1NmPyLHm8ELodgjuz7TaIGSG EsKsFQm36HIFrZVu5+spPQ6kzJ8LK9UzVG1CRRRk7n24rrOuA31yFbBPnBktYRc0 jcw9lDJZT+zulCAQaKwJU68Y8tTymoj0CTmimNSGLCLC7IETE0S4JHZedCx47/3u sd7wPnacc7wxT3SjnTlAybkNKg+mGrtPFmaJcfKO6bYbTAslWSCa1KOxN9y2/pWJ 21m7zr+DRT2hKqL9tT9UcsNIYeKfRCLlAtlr3LHTuF8q8QEeOCV3iahU++Vz2bpp vKoo4fU19mFDGtGXUi+N9q8zZU6dBOZ2SeTFmOwdsFl5IjCh+ZGdEBPrA2iv0/Ih yFGVIiZDUUAciWM1xEonufvSAFeL2T5WsRwMBznjRk3R9uiV7L+m8z4AHNnZVmYB /0JflNGLhOcrKFOFkCEpj1PcWMcs/fiH+5jOzblm3D3eom8PQ/Q= =URcx -----END PGP SIGNATURE----- --Zs/RYxT/hKAHzkfQ-- ------------=_1575455762-12162-1--