about summary refs log tree commit diff
path: root/pkgs/development/interpreters/lua-5
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-12-25 21:42:47 +0100
committerGitHub <noreply@github.com>2022-12-25 21:42:47 +0100
commitf4c3e67d80fa29a321a226ffa2557a35c549010a (patch)
treef3dd8c3e559f1c17f1f88ed01fa831fa01ef9a6d /pkgs/development/interpreters/lua-5
parent5af3f865e84ecc9baa846ec1d85cc7192f0d3543 (diff)
parentb3748800270090094701bbd3b74c5990f9b9a8cc (diff)
Merge pull request #206807 from SuperSandro2000/lua-sourceVersion
Diffstat (limited to 'pkgs/development/interpreters/lua-5')
-rw-r--r--pkgs/development/interpreters/lua-5/build-lua-package.nix2
-rw-r--r--pkgs/development/interpreters/lua-5/default.nix17
-rw-r--r--pkgs/development/interpreters/lua-5/interpreter.nix10
3 files changed, 14 insertions, 15 deletions
diff --git a/pkgs/development/interpreters/lua-5/build-lua-package.nix b/pkgs/development/interpreters/lua-5/build-lua-package.nix
index d11c0d0f03906..a15a12dd284d0 100644
--- a/pkgs/development/interpreters/lua-5/build-lua-package.nix
+++ b/pkgs/development/interpreters/lua-5/build-lua-package.nix
@@ -14,7 +14,7 @@
 , rockspecVersion ? version
 
 # by default prefix `name` e.g. "lua5.2-${name}"
-, namePrefix ? "${lua.pname}${lua.sourceVersion.major}.${lua.sourceVersion.minor}-"
+, namePrefix ? "${lua.pname}${lib.versions.majorMinor version}-"
 
 # Dependencies for building the package
 , buildInputs ? []
diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix
index ac903545b0f32..3cf436419f34d 100644
--- a/pkgs/development/interpreters/lua-5/default.nix
+++ b/pkgs/development/interpreters/lua-5/default.nix
@@ -1,5 +1,5 @@
 # similar to interpreters/python/default.nix
-{ stdenv, lib, callPackage, fetchurl, fetchpatch, makeBinaryWrapper }:
+{ stdenv, lib, callPackage, fetchFromGitHub, fetchurl, fetchpatch, makeBinaryWrapper }:
 
 
 let
@@ -8,7 +8,6 @@ let
   # copied from python
   passthruFun =
     { executable
-    , sourceVersion
     , luaversion
     , packageOverrides
     , luaOnBuildForBuild
@@ -67,7 +66,7 @@ let
         withPackages = import ./with-packages.nix { inherit buildEnv luaPackages;};
         pkgs = luaPackages;
         interpreter = "${self}/bin/${executable}";
-        inherit executable luaversion sourceVersion;
+        inherit executable luaversion;
         luaOnBuild = luaOnBuildForHost.override { inherit packageOverrides; self = luaOnBuild; };
 
         tests = callPackage ./tests { inherit (luaPackages) wrapLua; };
@@ -80,7 +79,7 @@ in
 rec {
   lua5_4 = callPackage ./interpreter.nix {
     self = lua5_4;
-    sourceVersion = { major = "5"; minor = "4"; patch = "4"; };
+    version = "5.4.4";
     hash = "sha256-Fkx4SWU7gK5nvsS3RzuIS/XMjS3KBWU0dewu0nuev2E=";
     makeWrapper = makeBinaryWrapper;
     inherit passthruFun;
@@ -112,7 +111,7 @@ rec {
 
   lua5_3 = callPackage ./interpreter.nix {
     self = lua5_3;
-    sourceVersion = { major = "5"; minor = "3"; patch = "6"; };
+    version = "5.3.6";
     hash = "0q3d8qhd7p0b7a4mh9g7fxqksqfs6mr1nav74vq26qvkp2dxcpzw";
     makeWrapper = makeBinaryWrapper;
     inherit passthruFun;
@@ -129,7 +128,7 @@ rec {
 
   lua5_2 = callPackage ./interpreter.nix {
     self = lua5_2;
-    sourceVersion = { major = "5"; minor = "2"; patch = "4"; };
+    version = "5.2.4";
     hash = "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr";
     makeWrapper = makeBinaryWrapper;
     inherit passthruFun;
@@ -146,7 +145,7 @@ rec {
 
   lua5_1 = callPackage ./interpreter.nix {
     self = lua5_1;
-    sourceVersion = { major = "5"; minor = "1"; patch = "5"; };
+    version = "5.1.5";
     hash = "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333";
     makeWrapper = makeBinaryWrapper;
     inherit passthruFun;
@@ -156,12 +155,12 @@ rec {
 
   luajit_2_0 = import ../luajit/2.0.nix {
     self = luajit_2_0;
-    inherit callPackage lib passthruFun;
+    inherit callPackage fetchFromGitHub lib passthruFun;
   };
 
   luajit_2_1 = import ../luajit/2.1.nix {
     self = luajit_2_1;
-    inherit callPackage passthruFun;
+    inherit callPackage fetchFromGitHub passthruFun;
   };
 
 }
diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix
index c265785b8d85d..59afff3794494 100644
--- a/pkgs/development/interpreters/lua-5/interpreter.nix
+++ b/pkgs/development/interpreters/lua-5/interpreter.nix
@@ -9,19 +9,19 @@
 , pkgsBuildTarget
 , pkgsHostHost
 , pkgsTargetTarget
-, sourceVersion
+, version
 , hash
 , passthruFun
 , patches ? []
 , postConfigure ? null
 , postBuild ? null
 , staticOnly ? stdenv.hostPlatform.isStatic
-, luaAttr ? "lua${sourceVersion.major}_${sourceVersion.minor}"
+, luaAttr ? "lua${lib.versions.major version}_${lib.versions.minor version}"
 } @ inputs:
 let
   luaPackages = self.pkgs;
 
-  luaversion = with sourceVersion; "${major}.${minor}";
+  luaversion = lib.versions.majorMinor version;
 
 plat = if (stdenv.isLinux && lib.versionOlder self.luaversion "5.4") then "linux"
        else if (stdenv.isLinux && lib.versionAtLeast self.luaversion "5.4") then "linux-readline"
@@ -36,7 +36,7 @@ in
 
 stdenv.mkDerivation rec {
   pname = "lua";
-  version = "${luaversion}.${sourceVersion.patch}";
+  inherit version;
 
   src = fetchurl {
     url = "https://www.lua.org/ftp/${pname}-${version}.tar.gz";
@@ -136,7 +136,7 @@ stdenv.mkDerivation rec {
     inputs' = lib.filterAttrs (n: v: ! lib.isDerivation v && n != "passthruFun") inputs;
     override = attr: let lua = attr.override (inputs' // { self = lua; }); in lua;
   in passthruFun rec {
-    inherit self luaversion packageOverrides luaAttr sourceVersion;
+    inherit self luaversion packageOverrides luaAttr;
     executable = "lua";
     luaOnBuildForBuild = override pkgsBuildBuild.${luaAttr};
     luaOnBuildForHost = override pkgsBuildHost.${luaAttr};