gnu: luajit: Make available as ‘luajit’.
authorTobias Geerinckx-Rice <me@tobias.gr>
Thu, 8 Feb 2018 00:38:03 +0000 (01:38 +0100)
committerTobias Geerinckx-Rice <me@tobias.gr>
Thu, 8 Feb 2018 04:01:42 +0000 (05:01 +0100)
* gnu/packages/lua.scm (luajit)[arguments]: Add a ‘create-luajit-symlink’
phase to make the interpreter available simply as ‘luajit’.

gnu/packages/lua.scm

index fd14956..5592b96 100644 (file)
@@ -127,9 +127,19 @@ for configuration, scripting, and rapid prototyping.")
               (patches (search-patches "luajit-no_ldconfig.patch"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:tests? #f                      ;luajit is distributed without tests
-       #:phases (modify-phases %standard-phases (delete 'configure))
-       #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
+     `(#:tests? #f                      ; luajit is distributed without tests
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)            ; no configure script
+         (add-after 'install 'create-luajit-symlink
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (with-directory-excursion bin
+                 (symlink ,(string-append name "-" version)
+                          ,name)
+                 #t)))))
+         #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
     (home-page "http://www.luajit.org/")
     (synopsis "Just in time compiler for Lua programming language version 5.1")
     (description