From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Replacing Bower with "guix environment" Date: Fri, 01 May 2015 16:37:55 +0200 Message-ID: <87bni4cqik.fsf@gnu.org> References: <87tww2i6je.fsf@earlgrey.lan> <87d22m3stg.fsf@gnu.org> <87d22l5ye3.fsf@fsf.org> <87618cly1x.fsf@earlgrey.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoC4o-0008Ie-Dw for guix-devel@gnu.org; Fri, 01 May 2015 10:38:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoC4l-0008Qn-3M for guix-devel@gnu.org; Fri, 01 May 2015 10:38:02 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoC4l-0008Qi-0b for guix-devel@gnu.org; Fri, 01 May 2015 10:37:59 -0400 In-Reply-To: <87618cly1x.fsf@earlgrey.lan> (Christopher Allan Webber's message of "Thu, 30 Apr 2015 23:14:47 -0500") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Christopher Allan Webber Cc: guix-devel Christopher Allan Webber skribis: > David Thompson writes: > >> Ludovic Court=C3=A8s writes: >> >>> Christopher Allan Webber skribis: >>> >>>> - The "hip new way" of doing things is to use Bower. Bower is a >>>> package manager, but it's made specifically for static assets served >>>> to the user, such as css files, fonts, javascript like jquery, etc. >>>> Bower also puts these in an extlib/ or whatever, but it puts them in >>>> that place *for* you. >>> >>> Interesting. >>> >>> (Thinking out lout.) >>> >>> Just like =E2=80=98guix system vm=E2=80=99 returns a script that runs Q= EMU with the >>> right arguments, one could imagine generating a script that copies >>> dependencies in the right place maybe? >>> >>> (define (make-installer assets) >>> (gexp->script "copy-assets" >>> #~(begin >>> (for-each copy-file '#$@assets) >>> ...))) >>> >>> (This could/should be turned into a package object so that adding it as >>> an input would drop it in $PATH.) > > The idea has me really excited. But how do I make this happen, so that > copy-assets appears in $PATH? I am trying to do something with > "guix environment" that does this, but I'm pretty confused as to how it > could be done. You would use a =E2=80=98web-assets=E2=80=99 procedure as Dave suggests, wh= ich would return a package object that does the above and has the script in its bin/ directory. > How would you turn a gexp into a package object? Would it just be a lot > of package object stuff stubbed out? Currently this is not automatic: one basically has to write a package, typically using =E2=80=98trivial-build-system=E2=80=99 which is a thin wrap= per around gexps. We should add a =E2=80=98gexp->package=E2=80=99 procedure. >>> The developer would have to explicitly run that script to have the files >>> copied under extlib/. >> >> That is a really neat use of gexps, and I guess running the script >> manually would be akin to running 'bower install', so that should work. >> >> I envision the package recipe below, is this approximately what you were >> describing? >> >> (package >> (name "mediagoblin") >> (version "0.8.0") >> ... >> (inputs >> `(("python" ,python) >> ("assets" ,(web-assets jquery >> videojs >> bootstrap)))) >> ...) > > Does web-assets generate that package object I assume? Yes. > I tried looking for examples of other package definitions that include > derivations from gexps, and couldn't find anything clear... Look for =E2=80=98trivial-build-system=E2=80=99. > It also isn't clear to me: is it okay for (inputs) to include things > that aren't packages? Inputs can include packages, origins, derivations, and file names. HTH! Ludo=E2=80=99.