From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:53156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMtZH-0006H2-Hc for guix-patches@gnu.org; Sat, 04 May 2019 08:15:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMtZG-0000r7-Ju for guix-patches@gnu.org; Sat, 04 May 2019 08:15:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36953) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMtZG-0000qx-GQ for guix-patches@gnu.org; Sat, 04 May 2019 08:15:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMtZG-0007oE-3S for guix-patches@gnu.org; Sat, 04 May 2019 08:15:02 -0400 Subject: [bug#35545] [PATCH 06/17] gnu: javacc: Install binaries. Resent-Message-ID: Date: Sat, 4 May 2019 14:14:05 +0200 From: Julien Lepiller Message-ID: <20190504141405.3f1ad2b0@sybil.lepiller.eu> In-Reply-To: <87y33mfndg.fsf@elephly.net> References: <20190503145820.606f37db@sybil.lepiller.eu> <20190503130134.24788-1-julien@lepiller.eu> <20190503130134.24788-6-julien@lepiller.eu> <87y33mfndg.fsf@elephly.net> 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: Ricardo Wurmus Cc: 35545@debbugs.gnu.org Le Sat, 04 May 2019 13:52:11 +0200, Ricardo Wurmus a =C3=A9crit : > Julien Lepiller writes: >=20 > > * gnu/packages/java.scm (javacc)[arguments]: Add install-bin > > phase. =20 > [=E2=80=A6] > > + (add-after 'install 'install-bin > > + (lambda* (#:key outputs inputs #:allow-other-keys) > > + (let* ((out (assoc-ref outputs "out")) > > + (dir (string-append out "/share/java")) > > + (bin (string-append out "/bin"))) > > + (mkdir-p bin) > > + (with-output-to-file (string-append bin "/javacc") > > + (lambda _ > > + (display > > + (string-append "#!/bin/sh\n" > > + (assoc-ref inputs "jdk") > > "/bin/java" > > + " -cp " dir "/javacc.jar" " > > `basename $0`" " $*")))) =20 >=20 > I think it=E2=80=99s better not to use basename here. We already know the > store location. basename gets the filename, not directory name of the command that was invoked. >=20 > > + (chmod (string-append bin "/javacc") #o755) > > + (symlink (string-append bin "/javacc") > > + (string-append bin "/jjdoc")) > > + (symlink (string-append bin "/javacc") > > + (string-append bin "/jjtree")))))))) =20 >=20 > Why symlink javacc with different names? the name of the binary is passed as a first argument to javacc.jar, so their behavior is different. >=20 > Since you=E2=80=99re reusing the javacc file name so often it makes sense= to > let-bind it. >=20 > Please end the build phase on #T. >=20 > -- > Ricardo >=20