Message ID | 20210110200231.24214-1-maxim.cournoyer@gmail.com |
---|---|
Headers | show |
Hello, Maxim Cournoyer <maxim.cournoyer@gmail.com> writes: > While attempting to reproduce the now closed issue > <http://issues.guix.gnu.org/30116>, I stumbled upon another annoyance, which > is that the patch-and-repack procedure used as part of an origin derivation > didn't support single files, so the following failed, for example: > > <#part type="text/plain" filename="/home/maxim/src/guix-core-updates/repro.scm" disposition=inline description="Script exhibiting problem"> > <#/part> That didn't work out well :-). Here's the attachment that I meant to send along the cover letter. ;;; Run script with: ./pre-inst-env guile -e main -s repro.scm (use-modules (gnu packages base) (gnu packages bootstrap) (guix build utils) (guix derivations) (guix download) (guix packages) (guix store)) (define %test-file-uri "https://raw.githubusercontent.com/realgud/realgud/master/realgud/common/bp-image-data.el") (define (main _) (let ((source (origin (method url-fetch) (uri %test-file-uri) (modules '((guix build utils))) (patch-inputs `(("tar" ,%bootstrap-coreutils&co) ("xz" ,%bootstrap-coreutils&co) ("locales" ,glibc-utf8-locales))) (snippet '(begin (with-fluids ((%default-port-encoding "ISO-8859-1") (%default-port-conversion-strategy 'error)) (substitute* "bp-image-data.el" (("something") "something else"))))) (sha256 (base32 "1qpn2zhh2qw579bhgjyxvf670r4kibaxls589hkm2yhwfvsjvs68"))))) (with-store store (build-derivations store (list (run-with-store store (origin->derivation source))))))) Thanks, Maxim