guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#35545] [PATCH 06/17] gnu: javacc: Install binaries.


From: Ricardo Wurmus
Subject: [bug#35545] [PATCH 06/17] gnu: javacc: Install binaries.
Date: Sat, 04 May 2019 19:08:34 +0200
User-agent: mu4e 1.0; emacs 26.1

Julien Lepiller <address@hidden> writes:

> Le Sat, 04 May 2019 13:52:11 +0200,
> Ricardo Wurmus <address@hidden> a écrit :
>
>> Julien Lepiller <address@hidden> writes:
>>
>> > * gnu/packages/java.scm (javacc)[arguments]: Add install-bin
>> > phase.
>> […]
>> > +         (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’s 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.

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]