diff --git a/projects/github.com/luvit/luv/package.yml b/projects/github.com/luvit/luv/package.yml new file mode 100644 index 00000000..17897130 --- /dev/null +++ b/projects/github.com/luvit/luv/package.yml @@ -0,0 +1,52 @@ +distributable: + url: https://github.com/luvit/luv/archive/{{version}}-0.tar.gz + strip-components: 1 +versions: + #github: luvit/luv + - 1.45.0 +dependencies: + libuv.org: '*' +runtime: + env: + LUA_CPATH: "{{prefix}}/lib/lua/{{deps.lua.org.version.major}}/?.so;;" +build: + dependencies: + cmake.org: '*' + lua.org: '*' + luajit.org: '*' + linux: + curl.se: '*' + script: + - run: curl -L "$lua_compact" | tar -xz --strip-component=1 + working-directory: deps/lua-compat-5.3 + - cmake -S . -B buildjit $CMAKE_ARGS -DWITH_LUA_ENGINE=LuaJIT -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON + - cmake --build buildjit + - cmake --install buildjit + - cmake -S . -B buildlua $CMAKE_ARGS -DWITH_LUA_ENGINE=Lua -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=OFF + - cmake --build buildlua + - cmake --install buildlua + - run: | + ln -s {{deps.lua.org.version.marketing}} {{deps.lua.org.version.major}} + working-directory: "{{prefix}}/lib/lua" + env: + lua_compact: https://github.com/keplerproject/lua-compat-5.3/archive/v0.10.tar.gz + CMAKE_ARGS: + - -DCMAKE_INSTALL_PREFIX="{{prefix}} + - -DCMAKE_INSTALL_LIBDIR=lib + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_FIND_FRAMEWORK=LAST + - -DCMAKE_VERBOSE_MAKEFILE=ON + - -Wno-dev + - -DBUILD_TESTING=OFF + - -DWITH_SHARED_LIBUV=ON + - -DLUA_BUILD_TYPE=System + - -DLUA_COMPAT53_DIR=$SRCROOT/deps/lua-compat-5.3 + - -DBUILD_MODULE=ON +test: + dependencies: + lua.org: '*' + freedesktop.org/pkg-config: '*' + script: + - pkg-config --modversion libluv | grep {{version}} + - lua test.lua | grep 'Sleeping' + - lua test.lua | grep 'Awake!' diff --git a/projects/github.com/luvit/luv/test.lua b/projects/github.com/luvit/luv/test.lua new file mode 100644 index 00000000..3f374b68 --- /dev/null +++ b/projects/github.com/luvit/luv/test.lua @@ -0,0 +1,8 @@ +local uv = require('luv') +local timer = uv.new_timer() +timer:start(1000, 0, function() + print("Awake!") + timer:close() +end) +print("Sleeping"); +uv.run() \ No newline at end of file