From 73abf952d5e9206a758ef21877ee1172a6abecdd Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sat, 20 Apr 2024 15:09:17 +0100 Subject: [PATCH] package minisock, a minimal Lua socket library --- pkgs/default.nix | 1 + pkgs/minisock/default.nix | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 pkgs/minisock/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 5949cfe..2f3a583 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -82,6 +82,7 @@ in { zyxel-bootconfig = callPackage ./zyxel-bootconfig {}; min-collect-garbage = callPackage ./min-collect-garbage {}; min-copy-closure = callPackage ./min-copy-closure {}; + minisock = callPackage ./minisock {}; nellie = callPackage ./nellie {}; netlink-lua = callPackage ./netlink-lua {}; odhcp-script = callPackage ./odhcp-script {}; diff --git a/pkgs/minisock/default.nix b/pkgs/minisock/default.nix new file mode 100644 index 0000000..0495a5e --- /dev/null +++ b/pkgs/minisock/default.nix @@ -0,0 +1,21 @@ +{ lua, lib, fetchFromGitHub }: +let pname = "minisock"; +in lua.pkgs.buildLuaPackage { + inherit pname; + version = "0.1"; # :shrug: + + src = fetchFromGitHub { + repo = "minisock"; + owner = "philanc"; + rev = "a20db2aaa871653c61045019633279167cf1b458"; + hash = "sha256-zB9KSt0WEGCSYTLA6W9QrsVRFEZYaoBBeXx9VEXmsGY="; + }; + + makeFlags = [ "LUADIR=." "minisock.so" ]; + + installPhase = '' + mkdir -p "$out/lib/lua/${lua.luaversion}" + cp ${pname}.so "$out/lib/lua/${lua.luaversion}/" + ''; + +}