feat: init luasocket at 3.1.0

This commit is contained in:
soyouzpanda 2025-03-13 22:06:42 +01:00
parent 825a749f74
commit 21ae63573b
Signed by: ecoppens
GPG key ID: 871893E37A732093
2 changed files with 48 additions and 0 deletions

View file

@ -73,6 +73,7 @@ in {
libubootenv = callPackage ./libubootenv {};
linotify = callPackage ./linotify {};
lualinux = callPackage ./lualinux {};
luasocket = callPackage ./luasocket {};
# we need to build real lzma instead of using xz, because the lzma
# decoder in u-boot doesn't understand streaming lzma archives

View file

@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchFromGitHub,
lua,
gcc,
}:
stdenv.mkDerivation rec {
pname = "luasocket";
version = "3.1.0";
src = fetchFromGitHub {
owner = "lunarmodules";
repo = "luasocket";
rev = "v${version}";
hash = "sha256-sKSzCrQpS+9reN9IZ4wkh4dB50wiIfA87xN4u1lyHo4=";
};
nativeBuildInputs = [
gcc
];
buildInputs = [
lua
];
preConfigure = ''
substituteInPlace src/makefile \
--replace-fail "gcc" "$CC"
'';
preInstall = ''
export DESTDIR=$out
export prefix=
'';
meta = {
description = "Network support for the Lua language";
homepage = "https://github.com/lunarmodules/luasocket";
changelog = "https://github.com/lunarmodules/luasocket/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ soyouzpanda ];
mainProgram = "luasocket";
platforms = lib.platforms.all;
};
}