From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Langlois Subject: Re: building from local (or private) git repository Date: Mon, 08 Jul 2019 17:13:38 +0100 Message-ID: <87ftngec7h.fsf@gmx.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44709) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkWH2-000354-Nc for guix-devel@gnu.org; Mon, 08 Jul 2019 12:13:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkWH0-0002jK-VN for guix-devel@gnu.org; Mon, 08 Jul 2019 12:13:52 -0400 Received: from mout.gmx.net ([212.227.17.22]:34947) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkWGz-0002Wc-5k for guix-devel@gnu.org; Mon, 08 Jul 2019 12:13:50 -0400 In-reply-to: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Hi Robert, Robert Vollmert writes: > Hi all, > > I realize this isn=E2=80=99t generally an aim for guix proper, but I=E2= =80=99d 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=E2=80=99s while > working out the packaging of a project I intend to publish but > haven=E2=80=99t 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)) > =E2=80=A6 > > That=E2=80=99s a bit annoying because it includes stale files that happen > to be in the directory, it doesn=E2=80=99t check the hash, etc. Using a > git origin with a local path doesn=E2=80=99t work for reasons I don=E2=80= =99t > completely understand =E2=80=94 I think it=E2=80=99s because the guix-dae= mon builds > in a namespace without access to the local filesystem. Perhaps there=E2= =80=99s > 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 ""))) (sha256 (base32 ""))) ``` 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