Ricardo Wurmus <ricardo.wur...@mdc-berlin.de> skribis: > * gnu/packages/lua.scm (lua5.2-lpeg): New variable.
I think you didn’t get feedback on this one. > +(define-public lua5.2-lpeg > + (package (inherit lua-lpeg) > + (name "lua5.2-lpeg") > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + (delete 'configure) > + ;; `make install` isn't available, so we have to do it manually > + (replace 'install > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((out (assoc-ref outputs "out")) > + (lua-version ,(version-major+minor (package-version > lua-5.2)))) > + (install-file "lpeg.so" > + (string-append out "/lib/lua/" lua-version)) > + (install-file "re.lua" > + (string-append out "/share/lua/" lua-version)) It would be best to avoid duplicating this phase since the only difference is the version number. However, this is currently inconvenient, so it’s probably fine to keep it, with an “XXX” comment. To fix it, we’d have to arrange for the phase to stand alone as opposed to getting the Lua version number from the “host side”. So it would be written along the lines of: (lambda … (let* ((lua (assoc-ref inputs "lua")) (lua-version (extract-version lua))) …)) The Python stuff uses a similar pattern. The ‘extract-version’ thing is necessarily hacky and brittle though. Alternately, we could pass the info as an environment variable, something that’s not done anywhere yet. Ludo’.