From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:55079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMy9n-0007XB-Rx for guix-patches@gnu.org; Sat, 04 May 2019 13:09:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMy9m-0004oV-Rr for guix-patches@gnu.org; Sat, 04 May 2019 13:09:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMy9m-0004oO-HU for guix-patches@gnu.org; Sat, 04 May 2019 13:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMy9m-0002sN-CH for guix-patches@gnu.org; Sat, 04 May 2019 13:09:02 -0400 Subject: [bug#35545] [PATCH 06/17] gnu: javacc: Install binaries. Resent-Message-ID: References: <20190503145820.606f37db@sybil.lepiller.eu> <20190503130134.24788-1-julien@lepiller.eu> <20190503130134.24788-6-julien@lepiller.eu> <87y33mfndg.fsf@elephly.net> <20190504141405.3f1ad2b0@sybil.lepiller.eu> From: Ricardo Wurmus In-reply-to: <20190504141405.3f1ad2b0@sybil.lepiller.eu> Date: Sat, 04 May 2019 19:08:34 +0200 Message-ID: <87sgtuf8q5.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: Julien Lepiller Cc: 35545@debbugs.gnu.org Julien Lepiller writes: > Le Sat, 04 May 2019 13:52:11 +0200, > Ricardo Wurmus a =C3=A9crit : > >> Julien Lepiller writes: >> >> > * gnu/packages/java.scm (javacc)[arguments]: Add install-bin >> > phase. >> [=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`" " $*")))) >> >> I think it=E2=80=99s better not to use basename here. We already know t= he >> store location. > > basename gets the filename, not directory name of the command that was > invoked. Ah, right. So this is related to the symlinking further down, got it. >> > + (chmod (string-append bin "/javacc") #o755) >> > + (symlink (string-append bin "/javacc") >> > + (string-append bin "/jjdoc")) >> > + (symlink (string-append bin "/javacc") >> > + (string-append bin "/jjtree")))))))) >> >> 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. Could you please add this as a comment? -- Ricardo