SHA256
1
0
forked from pool/lua-luautf8

4 Commits

Author SHA256 Message Date
87d912a334 Switch off building lua51 build of the package. 2025-10-24 16:50:10 +02:00
630616354a Make the package buildable with LuaJIT. 2025-10-12 09:52:58 +02:00
baeb47c2ce Add luajit version to _multibuild 2025-10-06 10:49:07 +02:00
49264d8bae Update to 0.1.6:
- Add 'normalize_nfc' and 'isnfc' functions
  - Update to Unicode 15.1
  - Add new 'grapheme_indices' function
  - Improve grammar, spelling, and formatting of README.md
  - Fix bugs in NFC normalization code
  - Explicitly include limits.h instead of transitively assuming
    it
2025-07-25 23:00:16 +02:00
7 changed files with 81 additions and 11 deletions

4
.gitignore vendored
View File

@@ -1 +1,5 @@
.osc
_scmsync.obsinfo
_buildconfig-*
_buildinfo-*.xml
lua-luautf8-*-build/

BIN
0.1.6.tar.gz LFS Normal file

Binary file not shown.

View File

@@ -1,5 +1,5 @@
<multibuild>
<package>lua51</package>
<package>luajit</package>
<package>lua53</package>
<package>lua54</package>
</multibuild>

View File

@@ -1,3 +1,26 @@
-------------------------------------------------------------------
Fri Oct 24 14:50:10 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Switch off building lua51 build of the package.
-------------------------------------------------------------------
Sun Oct 12 07:52:14 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Make the package buildable with LuaJIT.
- Add warnings-away.patch to remove compilation warnings.
-------------------------------------------------------------------
Fri Jul 25 20:57:36 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Update to 0.1.6:
- Add 'normalize_nfc' and 'isnfc' functions
- Update to Unicode 15.1
- Add new 'grapheme_indices' function
- Improve grammar, spelling, and formatting of README.md
- Fix bugs in NFC normalization code
- Explicitly include limits.h instead of transitively assuming
it
-------------------------------------------------------------------
Mon Apr 1 02:00:36 UTC 2024 - Gordon Leung <pirateclip@protonmail.com>

View File

@@ -28,13 +28,17 @@
%define luarock_arch %{_arch}
%endif
%endif
Version: 0.1.5+git6
Version: 0.1.6
Release: 0
Summary: A utf-8 support module for Lua and LuaJIT
License: MIT
Group: Development/Languages/Other
URL: https://github.com/starwing/luautf8
Source: %{mod_name}-%{version}.tar.zst
# Source: %%{mod_name}-%%{version}.tar.zst
Source: https://github.com/starwing/luautf8/archive/refs/tags/%{version}.tar.gz
# PATCH-{FIX|FEATURE}-{OPENSUSE|SLE|UPSTREAM} name-of-file.patch bsc#[0-9]+ mcepl@suse.com
# this patch makes things totally awesome
Patch0: warnings-away.patch
BuildRequires: %{flavor}-devel
BuildRequires: %{flavor}-luarocks
BuildRequires: lua-macros
@@ -60,17 +64,21 @@ test in lua test suite2.
%autosetup -n %{mod_name}-%{version}
%build
%luarocks_build "rockspecs/%{mod_name}-%{rock_version}.rockspec"
%__cc %{optflags} -fPIC %(pkgconf --cflags lua) -c lutf8lib.c -o lutf8lib.o
%__cc -shared %{?build_ldflags} %(pkgconf --libs lua) -o lua-utf8.so lutf8lib.o
%install
%luarocks_install "%{mod_name}-%{rock_version}.linux-%{luarock_arch}.rock"
install -dD %{buildroot}%{lua_archdir}
install -p -m 755 lua-utf8.so %{buildroot}%{lua_archdir}
%check
for testf in test*.lua
do
lua $testf
done
%files
%{lua_archdir}
%{luarocks_treedir}/%{mod_name}
%docdir %{luarocks_treedir}/%{mod_name}/%{rock_version}/doc
%license %{luarocks_treedir}/%{mod_name}/%{rock_version}/doc/LICENSE
%license LICENSE
%changelog

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c20ea6902d71b5ec0136877868648a827b01b5c5fe13cf28bca32c2151afef3
size 430351

35
warnings-away.patch Normal file
View File

@@ -0,0 +1,35 @@
---
lutf8lib.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: luautf8-0.1.6/lutf8lib.c
===================================================================
--- luautf8-0.1.6.orig/lutf8lib.c 2025-10-12 03:12:28.128159114 +0200
+++ luautf8-0.1.6/lutf8lib.c 2025-10-12 03:27:47.904089867 +0200
@@ -626,7 +626,7 @@
if (fixedup) {
/* The preceding starter/combining mark sequence was bad; convert fixed-up codepoints
* to UTF-8 bytes */
- if (starter != -1)
+ if (starter != (utfint)-1)
add_utf8char(buff, starter);
for (unsigned int i = 0; i < vec_size; i++)
add_utf8char(buff, vector[i] >> 8);
@@ -643,7 +643,7 @@
}
vec_size = 0; /* Clear vector of combining marks in readiness for next such sequence */
fixedup = 0;
- } else if (starter != -1) {
+ } else if (starter != (utfint)-1) {
/* This starter was preceded immediately by another starter
* Check if this one should combine with it */
fixedup = 0;
@@ -725,7 +725,7 @@
if (vec_size)
goto process_combining_marks; /* Finish processing trailing combining marks */
- if (starter != -1)
+ if (starter != (utfint)-1)
add_utf8char(buff, starter);
if (vector != onstack)