aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2018-03-14 20:25:50 +0200
committerEfraim Flashner <efraim@flashner.co.il>2018-03-14 21:16:46 +0200
commitf73020735cc9e7d02d1f77eeb3af1d2fae090b56 (patch)
tree90bd6a50af5a96db94ebfb088f53311f2ee2760f /gnu
parent88e11022db4af72a0b33a0af7c71230234ce5e17 (diff)
downloadguix-f73020735cc9e7d02d1f77eeb3af1d2fae090b56.tar.gz
guix-f73020735cc9e7d02d1f77eeb3af1d2fae090b56.zip
gnu: texlive-latex-graphics: Declare a source file-name.
* gnu/packages/tex.scm (texlive-latex-graphics)[source]: Declare a source file-name. [native-inputs]: Declare a source file-name for downloaded native-inputs.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/tex.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index f0f0955949..ae3c7b3abd 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -1152,6 +1152,7 @@ verbatim source).")
(source (origin
(method svn-fetch)
(uri (texlive-ref "latex" "graphics"))
+ (file-name (string-append name "-" version "-checkout"))
(sha256
(base32
"07azyn0b1s49vbdlr6dmygrminxp72ndl24j1091hiiccvrjq3xc"))))
@@ -1184,6 +1185,9 @@ verbatim source).")
(uri (git-reference
(url "https://github.com/latex3/graphics-cfg.git")
(commit "19d1238af17df376cd46333b229579b0f7f3a41f")))
+ (file-name (string-append "graphics-cfg-"
+ (number->string %texlive-revision)
+ "-checkout"))
(sha256
(base32
"12kbgbm52gmmgn8zajb74s8n5rvnxcfdvs3iyj8vcw5vrsw5i6mh"))))
@@ -1195,6 +1199,9 @@ verbatim source).")
%texlive-tag "/Master/texmf-dist/"
"/tex/latex/graphics-def"))
(revision %texlive-revision)))
+ (file-name (string-append "graphics-def-"
+ (number->string %texlive-revision)
+ "-checkout"))
(sha256
(base32
"0gi4qv6378nl84s8n1yx3hjqvv7r4lza7hpbymbl5rzwgw8qrnyb"))))))
(ice-9 match)) (define %top-srcdir (string-append (current-source-directory) "/..")) (define version-controlled? (git-predicate %top-srcdir)) (define (package-definition-location) "Return the source properties of the definition of the 'guix' package." (call-with-input-file (location-file (package-location guix)) (lambda (port) (let loop () (match (read port) ((? eof-object?) (error "definition of 'guix' package could not be found" (port-filename port))) (('define-public 'guix value) (source-properties value)) (_ (loop))))))) (define* (update-definition commit hash #:key version old-hash) "Return a one-argument procedure that takes a string, the definition of the 'guix' package, and returns a string, the update definition for VERSION, COMMIT." (define (linear-offset str line column) ;; Return the offset in characters to reach LINE and COLUMN (both ;; zero-indexed) in STR. (call-with-input-string str (lambda (port) (let loop ((offset 0)) (cond ((and (= (port-column port) column) (= (port-line port) line)) offset) ((eof-object? (read-char port)) (error "line and column not reached!" str)) (else (loop (+ 1 offset)))))))) (define (update-hash str) ;; Replace OLD-HASH with HASH in STR. (string-replace-substring str (bytevector->nix-base32-string old-hash) (bytevector->nix-base32-string hash))) (lambda (str) (match (call-with-input-string str read) (('let (('version old-version) ('commit old-commit) ('revision old-revision)) defn) (let* ((location (source-properties defn)) (line (assq-ref location 'line)) (column 0) (offset (linear-offset str line column))) (string-append (format #f "(let ((version \"~a\") (commit \"~a\") (revision ~a))\n" (or version old-version) commit (if (and version (not (string=? version old-version))) 0 (+ 1 old-revision))) (string-drop (update-hash str) offset)))) (exp (error "'guix' package definition is not as expected" exp))))) (define (main . args) (match args ((commit version) (with-store store (let* ((source (add-to-store store "guix-checkout" ;dummy name #t "sha256" %top-srcdir #:select? version-controlled?)) (hash (query-path-hash store source)) (location (package-definition-location)) (old-hash (origin-sha256 (package-source guix)))) (edit-expression location (update-definition commit hash #:old-hash old-hash #:version version)) ;; Re-add SOURCE to the store, but this time under the real name used ;; in the 'origin'. This allows us to build the package without ;; having to make a real checkout; thus, it also works when working ;; on a private branch. (reload-module (resolve-module '(gnu packages package-management))) (let* ((source (add-to-store store (origin-file-name (package-source guix)) #t "sha256" source)) (root (store-path-package-name source))) ;; Add an indirect GC root for SOURCE in the current directory. (false-if-exception (delete-file root)) (symlink source root) (add-indirect-root store root) (format #t "source code for commit ~a: ~a (GC root: ~a)~%" commit source root))))) ((commit) ;; Automatically deduce the version and revision numbers. (main commit #f)))) (apply main (cdr (command-line)))