From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: gnu: Add Go build system. Date: Thu, 15 Dec 2016 21:05:26 -0500 Message-ID: <20161216020526.GA8672@jasmine> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHhtw-0005vC-2j for guix-devel@gnu.org; Thu, 15 Dec 2016 21:05:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHhtr-0004h6-4E for guix-devel@gnu.org; Thu, 15 Dec 2016 21:05:36 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:52008) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cHhtq-0004fU-H1 for guix-devel@gnu.org; Thu, 15 Dec 2016 21:05:31 -0500 Content-Disposition: inline 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: Petter Cc: guix-devel@gnu.org On Sun, Dec 11, 2016 at 01:17:48AM +0100, Petter wrote: > I've made an attempt at making a build system for Go. It seems to > work, but it's not pretty. My Guix/Guile skills are bad, so keep your > expectations to a minimum. Consider it something where there was > nothing. Thank you for working on this! > I started with a copy of the GNU build system, removed code I felt > wasn't necessary, then adapted to Go's needs. Note, comments and those > first text string after a (define) have not been updated. Unnecessary > #:use-modules have not been removed. In short, it's bad and there's a > lot to do make it ok-ish. That's where you come in :) I haven't contributed or carefully studied the other build systems yet, so my feedback will be rather superficial. I hope somebody with some more knowledge will jump in :) > Subject: [PATCH] gnu: Add Go build system. > > * guix/build-system/go.scm: New file > * guix/build/go-build-system.scm: New file. > diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm > +(define* (build #:key import-path #:allow-other-keys) > + (system* "go" "install" import-path)) > + > +(define* (install #:key inputs outputs #:allow-other-keys) > + (copy-recursively "bin" (string-append (assoc-ref outputs "out") "/bin")) > + (copy-recursively "pkg" (string-append (assoc-ref outputs "out") "/pkg")) > + (copy-recursively "src" (string-append (assoc-ref outputs "out") "/src"))) It looks like `go install` knows "where" to install the files, but installs them in the wrong place, and then we copy them into place in the install phase. I think it's inefficient to move the files twice. Can the build phase use something like `go build`, followed by the install phase using `go install` to move the files directly to the package's output directory in /gnu/store?