guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: package definition question: referring to source files of another pa


From: Attila Lendvai
Subject: Re: package definition question: referring to source files of another package?
Date: Sun, 03 Sep 2023 12:12:26 +0000

> In some scenarios package A may refer to source files in package B.

depending on where and what you need, you can do something like this in a GEXP 
context:

(define (upstream-file relative-path)
  (let ((git-origin
         (let ((commit "v0.13.2"))
           (origin
             (method git-fetch)
             (uri (git-reference
                   (url ...)
                   (commit commit)))
             (file-name (git-file-name "foo-bar" commit))
             (sha256
              (base32 ...))))))
    (file-append git-origin relative-path)))

#~(let ((x #$(upstream-file "/some-path"))) ...)


this way the versioning of the two packages are not tied together, which may or 
may not be what you want from a semantics perspective.

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“There are some ideas so wrong that only a very intelligent person could 
believe in them.”
        — George Orwell (1903–1950)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]