lua-users home
lua-l archive

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

On Jan 10, 2015 8:06 AM, "Dirk Laurie" <> wrote:
> There seem to be two ways.

There are way more than two ways.

You presented two extremes, one of which is:

> 1. The Roberto/Luiz way. There is C code and a simple makefile.

* easy to setup in a "works on my machine" capacity
* easy for tweaking by hand, by experienced Unix users (usually to fix
"works on my machine" issues)
* sometimes hard to automate in downstream packaging because instead
of making something configurable via variables people say "just tweak
the makefile!"

> 2. The Gnu way.

* hard to setup
* not meant to be tweaked by hand; autodetection and command-line
flags take care of moving parts (if what you need to tweak was not
foreseen, you're really out of luck)
* trivial for downstream packaging

Your example of tweaking a module for a new Lua version assumes that
the code itself already works for that version. In practice that may
be far from the truth, and the configure check you're trying to
override may be there for preventing you from getting a (sometimes
subtly) broken build.

> So I write to the list, asking why can't people who write Lua packages
> do it the way Roberto and Luiz do it.

Because there are other ways which have their own strengths and weaknesses.

At one point we stopped using Roberto's makefile in the lpeg rockspec.
I don't remember the details, but it was easier to re-specify the
build in pure LuaRocks than to perform all the "tweak the makefile"
changes needed in an automated fashion. Luiz, for example, doesn't
even use version numbers for his modules! No offense intended, but
that's far from being a Holy Grail of best practices.

And I'm not saying they purport themselves to be such, of course. (And
I don't claim to hold all the answers either!) But people do package
their modules following examples from well-known authors, and I've
seen stuff out there in new packages that replicated problems I've
seen before.

> Or just for this problem, won't
> somebody to whom the Gnu way is a piece of cake make us a Lua 5.3
> rock for lcurses please?

Once the upstream maintainer of  lcurses updates their codebase and
configure scripts for 5.3, isn't updating the rock trivial? Shouldn't
you be asking that, perhaps?

As for the question, "how should we package our code, then?", I have
my own biased opinions, like everyone else.

For those choosing the path of the simple makefile, I once wrote this:

-- Hisham