summaryrefslogtreecommitdiffstats
path: root/pkgs/development/interpreters/lua-5/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-04-19 11:38:01 +0000
committerAlyssa Ross <hi@alyssa.is>2021-04-19 16:58:26 +0000
commit34f8d7e15a3ca5762c84f867f70773674b002cb2 (patch)
tree7472a447fc26b8c71eb16ee7c38084075d16696b /pkgs/development/interpreters/lua-5/default.nix
parent936b27b5d4a64f6e9ce3728bdaa8a78490236e6b (diff)
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).
Diffstat (limited to 'pkgs/development/interpreters/lua-5/default.nix')
-rw-r--r--pkgs/development/interpreters/lua-5/default.nix28
1 files changed, 3 insertions, 25 deletions
diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix
index 3a52d58ffaba..ae5d76aa36c0 100644
--- a/pkgs/development/interpreters/lua-5/default.nix
+++ b/pkgs/development/interpreters/lua-5/default.nix
@@ -1,27 +1,10 @@
# similar to interpreters/python/default.nix
{ stdenv, lib, callPackage, fetchurl, fetchpatch }:
-let
- dsoPatch51 = fetchurl {
- url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/lua-arch.patch?h=packages/lua51";
- sha256 = "11fcyb4q55p4p7kdb8yp85xlw8imy14kzamp2khvcyxss4vw8ipw";
- name = "lua-arch.patch";
- };
-
- dsoPatch52 = fetchurl {
- url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/liblua.so.patch?h=packages/lua52";
- sha256 = "1by1dy4ql61f5c6njq9ibf9kaqm3y633g2q8j54iyjr4cxvqwqz9";
- name = "lua-arch.patch";
- };
-in rec {
+rec {
lua5_4 = callPackage ./interpreter.nix {
sourceVersion = { major = "5"; minor = "4"; patch = "2"; };
hash = "0ksj5zpj74n0jkamy3di1p6l10v4gjnd2zjnb453qc6px6bhsmqi";
- patches = [
- # build lua as a shared library as well, MIT-licensed from
- # https://github.com/archlinux/svntogit-packages/tree/packages/lua/trunk
- ./liblua.so.patch
- ];
};
lua5_4_compat = lua5_4.override({
@@ -35,11 +18,6 @@ in rec {
patches =
lib.optionals stdenv.isDarwin [ ./5.2.darwin.patch ];
- postConfigure = lib.optionalString (!stdenv.isDarwin) ''
- cat ${./lua-5.3-dso.make} >> src/Makefile
- sed -e 's/ALL_T *= */& $(LUA_SO)/' -i src/Makefile
- '';
-
postBuild = lib.optionalString (!stdenv.isDarwin) ''
( cd src; make $makeFlags "''${makeFlagsArray[@]}" liblua.so )
'';
@@ -53,7 +31,7 @@ in rec {
lua5_2 = callPackage ./interpreter.nix {
sourceVersion = { major = "5"; minor = "2"; patch = "4"; };
hash = "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr";
- patches = if stdenv.isDarwin then [ ./5.2.darwin.patch ] else [ dsoPatch52 ];
+ patches = lib.optional stdenv.isDarwin ./5.2.darwin.patch;
};
lua5_2_compat = lua5_2.override({
@@ -64,7 +42,7 @@ in rec {
lua5_1 = callPackage ./interpreter.nix {
sourceVersion = { major = "5"; minor = "1"; patch = "5"; };
hash = "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333";
- patches = (if stdenv.isDarwin then [ ./5.1.darwin.patch ] else [ dsoPatch51 ])
+ patches = (lib.optional stdenv.isDarwin ./5.1.darwin.patch)
++ [ ./CVE-2014-5461.patch ];
};