From 6285966ee7b51ab514ca78388dca45d819a4a2f7 Mon Sep 17 00:00:00 2001 From: Andrew <51118083+ArionThinker@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:30:23 +0300 Subject: [PATCH] luajit.org (#2939) * luajit.org * ROLLING ver * wip * maybe LUAJIT_PATH * LUA_PATH --------- Co-authored-by: Jacob Heider --- projects/luajit.org/package.yml | 40 +++++++++++++++++++++++++++++++++ projects/luajit.org/test.lua | 11 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 projects/luajit.org/package.yml create mode 100644 projects/luajit.org/test.lua diff --git a/projects/luajit.org/package.yml b/projects/luajit.org/package.yml new file mode 100644 index 00000000..d7318047 --- /dev/null +++ b/projects/luajit.org/package.yml @@ -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" diff --git a/projects/luajit.org/test.lua b/projects/luajit.org/test.lua new file mode 100644 index 00000000..b86892cd --- /dev/null +++ b/projects/luajit.org/test.lua @@ -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))