From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:58016) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4ptz-00012I-V7 for guix-patches@gnu.org; Mon, 02 Sep 2019 13:14:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4pty-0007Qo-Bk for guix-patches@gnu.org; Mon, 02 Sep 2019 13:14:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4ptx-0007QO-Rh for guix-patches@gnu.org; Mon, 02 Sep 2019 13:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4ptx-00037q-KE for guix-patches@gnu.org; Mon, 02 Sep 2019 13:14:01 -0400 Subject: [bug#36599] [PATCH] gnu: Add node-semver. Resent-Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_87c643b7c025b2ace98ec5b3d8a40404" Date: Mon, 02 Sep 2019 17:13:09 +0000 From: goodoldpaul@autistici.org In-Reply-To: <74DCA7FB-6960-4E6A-8DB5-326E065B5DEB@lepiller.eu> References: <20190711121221.16123-1-goodoldpaul@autistici.org> <87a7bmamnv.fsf@gnu.org> <74DCA7FB-6960-4E6A-8DB5-326E065B5DEB@lepiller.eu> Message-ID: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36599@debbugs.gnu.org --=_87c643b7c025b2ace98ec5b3d8a40404 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed Hello everybody, I also forgot about this patch: I was actually conviced that another patch providing node-semver was merged with the new node-build-system. Here's the updated package (greatly simplified, as foreseen by Julien, thanks to the new node-build-system). I added it in a new npm.scm file to maintain consistency with i.e. Haskell, Python or Rust. If you think this should be put in node.scm, don't hesitate to tell! Bye, Giacomo On 2019-09-02 14:50, Julien Lepiller wrote: > Le 2 septembre 2019 14:49:08 GMT+02:00, "Ludovic Courtès" > a écrit : >> Hi Giacomo, >> >> This patch seems to have been forgotten… >> >> Giacomo Leidi skribis: >> >>> * gnu/packages/node.scm (node-semver): New variable. >> >> [...] >> >>> +(define-public node-semver >>> + (package >>> + (name "node-semver") >>> + (version "6.2.0") >>> + (source (origin >>> + (method git-fetch) >>> + (uri (git-reference >>> + (url "https://github.com/npm/node-semver.git") >>> + (commit (string-append "v" version)))) >>> + (file-name (git-file-name name version)) >>> + (sha256 >>> + (base32 >>> + >> "0lqb0v7frrdr7yvxy8b2yg6rp1jilninzk76qnx5qnswxnr4gj5m")))) >> >> The nice thing is that the source doesn’t contain any binaries (or >> “minified” code),. >> >>> + (build-system trivial-build-system) >>> + (propagated-inputs >>> + `(("node" ,node))) >>> + (arguments >>> + '(#:modules ((guix build utils)) >>> + #:builder >>> + (begin >>> + (use-modules (guix build utils)) >>> + (let* ((source (assoc-ref %build-inputs "source")) >>> + (out (assoc-ref %outputs "out")) >>> + (semver-js "semver.js") >>> + (entry-point (string-append "bin/" semver-js))) >>> + (mkdir-p (string-append out "/bin")) >>> + (setenv "PATH" (string-append (assoc-ref %build-inputs >>> + "node") >>> + "/bin:" (getenv "PATH"))) >>> + (map (lambda (file) >>> + (install-file (string-append source "/" file) >> out)) >>> + (list semver-js "LICENSE" "package.json" >> "package-lock.json" "range.bnf")) >>> + (install-file (string-append source "/" entry-point) >>> + (string-append out "/bin")) >>> + (patch-shebang (string-append out "/" entry-point)) >>> + #t)))) >> >> This installs files in non-standard locations: >> >> --8<---------------cut here---------------start------------->8--- >> $ find $(./pre-inst-env guix build node-semver) >> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0 >> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/package-lock.json >> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/bin >> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/bin/semver.js >> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/package.json >> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/semver.js >> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/range.bnf >> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/LICENSE >> --8<---------------cut here---------------end--------------->8--- >> >> bin/ is fine, though should the binary be called ‘semver’ instead of >> ‘semver.js’? >> >> Could you arrange so that ‘LICENSE’ goes to ‘share/doc/node-semver’? >> >> As for the other files, I don’t know. Are they needed? Should they >> go >> to share/node-semver? >> >> Thanks in advance, and apologies for the loooong delay! >> >> Ludo’. > > Actually we have a node-build-system now which woull work much better > than the trivial-build-system. --=_87c643b7c025b2ace98ec5b3d8a40404 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-gnu-Add-node-semver.patch Content-Disposition: attachment; filename=0001-gnu-Add-node-semver.patch; size=3216 RnJvbSA4ODk5MWFiMjBjODFiODZhZTgyZWQ5YzcxMDJkM2NkMTYzZWUzZjk4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBHaWFjb21vIExlaWRpIDxnb29kb2xkcGF1bEBhdXRpc3RpY2ku b3JnPgpEYXRlOiBNb24sIDIgU2VwIDIwMTkgMTk6MDM6MTcgKzAyMDAKU3ViamVjdDogW1BBVENI XSBnbnU6IEFkZCBub2RlLXNlbXZlci4KCiogZ251L3BhY2thZ2VzL25wbS5zY206IE5ldyBmaWxl LgoqIGdudS9sb2NhbC5tazogQWRkIGl0LgoqIGdudS9wYWNrYWdlcy9ucG0uc2NtIChub2RlLXNl bXZlcik6IE5ldyB2YXJpYW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5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiAg U2VlIHRoZQorOzs7IEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlIGRldGFpbHMu Cis7OzsKKzs7OyBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2Vu ZXJhbCBQdWJsaWMgTGljZW5zZQorOzs7IGFsb25nIHdpdGggR05VIEd1aXguICBJZiBub3QsIHNl ZSA8aHR0cDovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uCisKKyhkZWZpbmUtbW9kdWxlIChnbnUg cGFja2FnZXMgbnBtKQorICAjOnVzZS1tb2R1bGUgKGd1aXggYnVpbGQtc3lzdGVtIG5vZGUpCisg ICM6dXNlLW1vZHVsZSAoZ3VpeCBnaXQtZG93bmxvYWQpCisgICM6dXNlLW1vZHVsZSAoKGd1aXgg bGljZW5zZXMpICM6c2VsZWN0IChpc2MpKQorICAjOnVzZS1tb2R1bGUgKGd1aXggcGFja2FnZXMp KQorCisoZGVmaW5lLXB1YmxpYyBub2RlLXNlbXZlcgorICAocGFja2FnZQorICAgIChuYW1lICJu b2RlLXNlbXZlciIpCisgICAgKHZlcnNpb24gIjYuMy4wIikKKyAgICAoc291cmNlIChvcmlnaW4K KyAgICAgICAgICAgICAgKG1ldGhvZCBnaXQtZmV0Y2gpCisgICAgICAgICAgICAgICh1cmkgKGdp dC1yZWZlcmVuY2UKKyAgICAgICAgICAgICAgICAgICAgKHVybCAiaHR0cHM6Ly9naXRodWIuY29t L25wbS9ub2RlLXNlbXZlci5naXQiKQorICAgICAgICAgICAgICAgICAgICAoY29tbWl0IChzdHJp bmctYXBwZW5kICJ2IiB2ZXJzaW9uKSkpKQorICAgICAgICAgICAgICAoZmlsZS1uYW1lIChnaXQt ZmlsZS1uYW1lIG5hbWUgdmVyc2lvbikpCisgICAgICAgICAgICAgIChzaGEyNTYKKyAgICAgICAg ICAgICAgIChiYXNlMzIKKyAgICAgICAgICAgICAgICAiMTV4cW1qNWgxZ3oycDN2M2djempsMDdy bTc1bWlhdnFyNzB4dzJmeGd6M244ODBzNGl5biIpKSkpCisgICAgKGJ1aWxkLXN5c3RlbSBub2Rl LWJ1aWxkLXN5c3RlbSkKKyAgICAoYXJndW1lbnRzCisgICAgIGAoOzsgRklYTUU6IFRlc3RzIGRl cGVuZCBvbiBub2RlLXRhcAorICAgICAgICM6dGVzdHM/ICNmKSkKKyAgICAoaG9tZS1wYWdlICJo dHRwczovL2dpdGh1Yi5jb20vbnBtL25vZGUtc2VtdmVyIikKKyAgICAoc3lub3BzaXMgIlBhcnNl cyBzZW1hbnRpYyB2ZXJzaW9ucyBzdHJpbmdzIikKKyAgICAoZGVzY3JpcHRpb24KKyAgICAgIm5v ZGUtc2VtdmVyIGlzIGEgSmF2YVNjcmlwdCBpbXBsZW1lbnRhdGlvbiBvZiB0aGUKK0B1cmVme2h0 dHBzOi8vc2VtdmVyLm9yZy8sIFNlbVZlci5vcmd9IHNwZWNpZmljYXRpb24uIikKKyAgICAobGlj ZW5zZSBpc2MpKSkKLS0gCjIuMjMuMAoK --=_87c643b7c025b2ace98ec5b3d8a40404--