-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lua-bit32: new package #9707
lua-bit32: new package #9707
Conversation
Please rebase against current master to fix the buildbot. |
@neheb , done. |
71ebdb1
to
43c12b2
Compare
provides bit32, a replacement for luabitops Signed-off-by: Maxim Storchak <[email protected]>
PKG_SRC_NAME:=lua-compat-5.2 | ||
PKG_SRC_VERSION:=0.3 | ||
PKG_SOURCE_URL=https://codeload.github.com/keplerproject/$(PKG_SRC_NAME)/tar.gz/v$(PKG_SRC_VERSION)? | ||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Place above PKG_SOURCE_URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? based on what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That hasn't even merged yet!
|
||
PKG_SRC_NAME:=lua-compat-5.2 | ||
PKG_SRC_VERSION:=0.3 | ||
PKG_SOURCE_URL=https://codeload.github.com/keplerproject/$(PKG_SRC_NAME)/tar.gz/v$(PKG_SRC_VERSION)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get rid of PKG_SRC_NAME. variables are normally not used in URLs unless they change (the version).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what requirement is this? where is it documented for contributors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done this before but was told to replace with normal name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this. Although package name variables are frowned upon on most of the declarations, I see no real problem this time, as the variable is used just as part of the download path to identify the lua compatibility version. |
I'm sorry for not responding in time, I was traveling and didn't have access to internet. |
Can we please backport this package to 19.07.4? |
@PolynomialDivision lua bitop is already available, this bit32 package is only for the major version bump in luaposix, which will not be backported. Is lua bitop not sufficient? |
Ah okay. Thanks! |
Here's some code that will automatically use native (on lua 5.3) or lua bitop, or whwatever else you plugin) -- Try and figure out a bitop library...
local bitnative, err = loadstring("if 2 & 1<<1 then return true end")
band = nil
bor = nil
lshift = nil
rshift = nil
if bitnative then
local magic_str = [[
bor = function(a,b) return a | b end
band = function(a,b) return a & b end
lshift = function(a,b) return a << b end
rshift = function(a,b) return a >> b end
]]
local f, err = loadstring(magic_str)
if f then f() else print("loadstring failed?!", err) end
-- sanity
if band(0xfff, 0x2) ~= 0x2 then error("wat") end
else
-- try bitop, it's common too
local hasbit, bit = pcall(require, "bit")
if hasbit then
bor = bit.bor
band = bit.band
lshift = bit.lshift
rshift = bit.rshift
end
end |
provides bit32, a replacement for luabitops
Signed-off-by: Maxim Storchak [email protected]
Maintainer: me
Compile tested: ath79, WNDR3800, r10703+3-e1f588e446
Run tested: ath79, WNDR3800, base system r9880+3-bd3a18bbe4, actually tested in a chroot with r10703+3-e1f588e446
Description:
This package provides bit32, a backport of Lua 5.2 bit manipulation library. It's required for new luaposix.