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: Julien Lepiller
Subject: [bug#35545] [PATCH 06/17] gnu: javacc: Install binaries.
Date: Sat, 4 May 2019 14:14:05 +0200

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.

> 
> > +               (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.

> 
> Since you’re reusing the javacc file name so often it makes sense to
> let-bind it.
> 
> Please end the build phase on #T.
> 
> --
> Ricardo
> 






reply via email to

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