lua: one dso patch to rule them all

We do this same patch in three different ways for four different Lua
versions, even though the structure of the Makefile barely changes
between releases.  We can easily consolidate this by just modifying
the Makefile ourselves instead of using patches (Makefiles are very
amenable to this).
This commit is contained in:
Alyssa Ross
2021-04-19 16:58:26 +00:00
parent 936b27b5d4
commit 34f8d7e15a
4 changed files with 11 additions and 89 deletions
@@ -38,6 +38,14 @@ self = stdenv.mkDerivation rec {
inherit patches;
postPatch = lib.optionalString (!stdenv.isDarwin) ''
# Add a target for a shared library to the Makefile.
sed -e '1s/^/LUA_SO = liblua.so/' \
-e 's/ALL_T *= */&$(LUA_SO) /' \
-i src/Makefile
cat ${./lua-dso.make} >> src/Makefile
'';
# see configurePhase for additional flags (with space)
makeFlags = [
"INSTALL_TOP=${placeholder "out"}"