luajit.org (#2939)

* luajit.org

* ROLLING ver

* wip

* maybe LUAJIT_PATH

* LUA_PATH

---------

Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
Andrew 2023-09-06 23:30:23 +03:00 committed by GitHub
parent 9c8861c0fb
commit 6285966ee7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,40 @@
distributable:
url: https://github.com/LuaJIT/LuaJIT/archive/v{{version.raw}}.ROLLING.tar.gz
strip-components: 1
versions:
github: LuaJIT/LuaJIT/tags
match: /v\d+\.\d+\.ROLLING/
strip:
- /^v/
- /\.ROLLING/
runtime:
env:
LUA_PATH: "{{prefix}}/share/luajit-{{version.marketing}}/?.lua"
build:
dependencies:
darwin:
tea.xyz/gx/cc: c99
linux:
gnu.org/gcc: '*'
tea.xyz/gx/make: '*'
script:
- make --jobs {{hw.concurrency}} amalg PREFIX={{prefix}}
- make --jobs {{hw.concurrency}} install PREFIX={{prefix}}
- mkdir -p {{prefix}}/doc
- mv doc/* {{prefix}}/doc/
- run: ln -s luajit-{{version.raw}}. luajit
working-directory: "{{prefix}}/bin"
- run: |
ln -s libluajit-5.1.dylib libluajit.dylib
ln -s libluajit-5.1.a libluajit.a
working-directory: "{{prefix}}/lib"
provides:
- bin/luajit
- bin/luajit-{{version.marketing}}.
test:
script:
- luajit -v | grep {{version.marketing}}
- luajit test.lua | grep 55
- luajit -e "print(package.path)"
- luajit -b test.lua test.o
- ls . | grep "test.o"

View file

@ -0,0 +1,11 @@
function fibonacci(n)
if n <= 0 then
return 0
elseif n == 1 then
return 1
else
return fibonacci(n - 1) + fibonacci(n - 2)
end
end
print("Fibonacci(10) =", fibonacci(10))