luaPackages.utf8: init at 1.3-0-f36cc914ae9015cd3045987abadd83bbcfae98f0

This commit is contained in:
Ulysses Zhan
2026-03-19 15:47:52 -07:00
parent 2189379971
commit 5ee828f5b8
3 changed files with 43 additions and 0 deletions
@@ -5242,6 +5242,38 @@ final: prev: {
}
) { };
utf8 = callPackage (
{
buildLuarocksPackage,
fetchFromGitHub,
fetchurl,
luaOlder,
}:
buildLuarocksPackage {
pname = "utf8";
version = "1.3-0";
knownRockspec =
(fetchurl {
url = "mirror://luarocks/utf8-1.3-0.rockspec";
sha256 = "1szsrwb15yyvrqwyqrr7g5ivihc0kl4pc7qq439q235f3x8jv2jp";
}).outPath;
src = fetchFromGitHub {
owner = "dannote";
repo = "luautf8";
rev = "f36cc914ae9015cd3045987abadd83bbcfae98f0";
hash = "sha256-xLWqglAzqcxY+R8GOC+D3uzL2+9ZriEx8Kj41LkI5vU=";
};
disabled = luaOlder "5.1";
meta = {
homepage = "http://github.com/starwing/luautf8";
description = "A UTF-8 support module for Lua";
license.fullName = "MIT";
};
}
) { };
vstruct = callPackage (
{
buildLuarocksPackage,
@@ -1129,6 +1129,16 @@ in
meta.broken = lua.luaversion != "5.1";
});
utf8 = prev.utf8.overrideAttrs {
postPatch = ''
sed -i '/#include <assert.h>/a\
#ifndef lua_assert\
#define lua_assert(x) assert(x)\
#endif
' lutf8lib.c
'';
};
vstruct = prev.vstruct.overrideAttrs (_: {
meta.broken = luaOlder "5.1" || luaAtLeast "5.4";
});