Hi Robert, Robert Vollmert writes:
> Hi all, > > I realize this isn’t generally an aim for guix proper, but I’d like > to be able to build a package from a local git repository (or > optionally from a local tar ball). In my specific case, it’s while > working out the packaging of a project I intend to publish but > haven’t published yet. > > What I have working so far uses local-file, as below: > > (define-public puzzledb-tools > (package > (name "puzzledb-tools") > (version "20190625-git") > (source > (local-file > "/home/rob/puzzledb/tools" > #:recursive? #t)) > … > > That’s a bit annoying because it includes stale files that happen > to be in the directory, it doesn’t check the hash, etc. Using a > git origin with a local path doesn’t work for reasons I don’t > completely understand — I think it’s because the guix-daemon builds > in a namespace without access to the local filesystem. Perhaps there’s > a way to link the git repository into that namespace? > > Any hints appreciated! If you're running the Guix system, you can setup a local git daemon that serves your user's repos. Here's what I have in my config: ``` (git-daemon-service #:config (git-daemon-configuration (export-all? #t) (user-path ""))) ;; To allow access to '~rob/puzzledb/tools' ``` And then I /think/ you should be able to do something like: ``` (origin (method git-fetch) (uri (git-reference (url "git://localhost/~rob/puzzledb/tools") (commit "<hash>"))) (sha256 (base32 "<hash>"))) ``` Note that's off the top of my head, I personally use this publish channels in my local network rather than package sources, but I can't think why this wouldn't work too! Pierre