From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:46663) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4lmW-0002tu-0b for guix-patches@gnu.org; Mon, 02 Sep 2019 08:50:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4lmU-00067F-Lk for guix-patches@gnu.org; Mon, 02 Sep 2019 08:50:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4lmU-00066D-Hv for guix-patches@gnu.org; Mon, 02 Sep 2019 08:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4lmU-00023M-Br for guix-patches@gnu.org; Mon, 02 Sep 2019 08:50:02 -0400 Subject: [bug#36599] [PATCH] gnu: Add node-semver. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190711121221.16123-1-goodoldpaul@autistici.org> Date: Mon, 02 Sep 2019 14:49:08 +0200 In-Reply-To: <20190711121221.16123-1-goodoldpaul@autistici.org> (Giacomo Leidi's message of "Thu, 11 Jul 2019 14:12:21 +0200") Message-ID: <87a7bmamnv.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Giacomo Leidi Cc: 36599@debbugs.gnu.org Hi Giacomo, This patch seems to have been forgotten=E2=80=A6 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=E2=80=99t contain any binaries (or =E2=80=9Cminified=E2=80=9D 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.j= son" "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 =E2=80=98semver=E2=80=99 i= nstead of =E2=80=98semver.js=E2=80=99? Could you arrange so that =E2=80=98LICENSE=E2=80=99 goes to =E2=80=98share/= doc/node-semver=E2=80=99? As for the other files, I don=E2=80=99t know. Are they needed? Should th= ey go to share/node-semver? Thanks in advance, and apologies for the loooong delay! Ludo=E2=80=99.