diff --git a/packages/lua/5.5.1/targets.toml b/packages/lua/5.5.1/targets.toml new file mode 100644 index 0000000..dd30fcc --- /dev/null +++ b/packages/lua/5.5.1/targets.toml @@ -0,0 +1,16 @@ +version = "5.5.1" +license = "MIT license" +dependencies = [] +build_dependencies = [] + +[source] +url = "https://github.com/lua/lua/releases/tag/v5.5.1.tar.gz" +checksum = "1c4b4068d67061f2a2231ad2b5422e77acea1487ea9890f6320af614f4373dce" + +[targets.linux] + +[targets.mac] +skip_symlinking = true + +[targets.windows] +source = "windows" \ No newline at end of file diff --git a/packages/lua/build.bat b/packages/lua/build.bat new file mode 100644 index 0000000..fa33246 --- /dev/null +++ b/packages/lua/build.bat @@ -0,0 +1,61 @@ +cd lua-%PACKIT_PACKAGE_VERSION% + +REM Read Visual Studio install path +for /f "tokens=* usebackq" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do ( + set "VSPATH=%%i" +) + +if not exist "%VSPATH%" ( + echo Visual Studio cannot be loaded from %VSPATH% + exit /b 1 +) + +REM Check if vcvarsall.bat exists +set "VCVARSALL=%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" +if not exist "%VCVARSALL%" ( + echo vcvarsall.bat cannot be loaded from %VCVARSALL% + exit /b 1 +) + +echo Found vcvarsall.bat at %VCVARSALL% + +REM Retrieve architecture from target +if "%PACKIT_TARGET%"=="x86_64-pc-windows-msvc" ( + set "ARCH=x64" +) else if "%PACKIT_TARGET%"=="aarch64-pc-windows-msvc" ( + set "ARCH=arm64" +) else ( + echo Target %PACKIT_TARGET% is not supported for this package + exit /b 1 +) + +REM Set MSVC build environment +call "%VCVARSALL%" %ARCH% +if ERRORLEVEL 1 ( + echo Failed to initialize Visual Studio build environment + exit /b %ERRORLEVEL% +) + +REM Build Lua +make +if ERRORLEVEL 1 ( + echo Lua build failed + exit /b %ERRORLEVEL% +) + +REM Install binaries +robocopy src "%PACKIT_PACKAGE_PATH%\bin" lua.exe lua.exe +if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL% + +robocopy src "%PACKIT_PACKAGE_PATH%\bin" luac.exe luac.exe +if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL% + +REM Install headers +robocopy src "%PACKIT_PACKAGE_PATH%\include" lua.h lualib.h lauxlib.h luaconf.h +if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL% + +REM Install library +robocopy src "%PACKIT_PACKAGE_PATH%\lib" lua.lib +if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL% + +exit /b 0 \ No newline at end of file diff --git a/packages/lua/build.sh b/packages/lua/build.sh new file mode 100644 index 0000000..6826f69 --- /dev/null +++ b/packages/lua/build.sh @@ -0,0 +1,30 @@ +```sh +#!/bin/sh + +cd lua-$PACKIT_PACKAGE_VERSION + +# Build Lua +make + +if [ $? -ne 0 ]; then + echo "Lua build failed" + exit 1 +fi + +# Install Lua into the Packit package directory +make install INSTALL_TOP="$PACKIT_PACKAGE_PATH" + +if [ $? -ne 0 ]; then + echo "Lua installation failed" + exit 1 +fi + +# Move man pages to share/man +if [ -d "$PACKIT_PACKAGE_PATH/man" ]; then + mkdir -p "$PACKIT_PACKAGE_PATH/share/man" + mv "$PACKIT_PACKAGE_PATH/man/man1" "$PACKIT_PACKAGE_PATH/share/man/man1" + rmdir "$PACKIT_PACKAGE_PATH/man" +fi + +exit 0 +``` diff --git a/packages/lua/package.toml b/packages/lua/package.toml new file mode 100644 index 0000000..6166992 --- /dev/null +++ b/packages/lua/package.toml @@ -0,0 +1,8 @@ +name = "lua" +description = "The lua language" +homepage = "https://lua.org/home.html" +versions = [ "5.5.1"] + +[supported_versions] +unix = "5.5.1" +windows = "5.5.1" \ No newline at end of file diff --git a/packages/lua/test.bat b/packages/lua/test.bat new file mode 100644 index 0000000..f7e1ec0 --- /dev/null +++ b/packages/lua/test.bat @@ -0,0 +1,57 @@ +```bat +@echo off + +set "TEST_TEXT=shoot for the stars, aim for the moon" + +REM Test Lua interpreter +for /f "delims=" %%i in ('"%PACKIT_PACKAGE_PATH%\bin\lua.exe" -e "print(""shoot for the stars, aim for the moon"")"') do ( + set "RESULT=%%i" +) + +if not "%RESULT%"=="%TEST_TEXT%" ( + echo Test failed: Lua interpreter test failed + exit /b 1 +) + +REM Create a Lua source file +echo print("shoot for the stars, aim for the moon") > test.lua + +REM Test running a Lua source file +set "RESULT=" +for /f "delims=" %%i in ('"%PACKIT_PACKAGE_PATH%\bin\lua.exe" test.lua') do ( + set "RESULT=%%i" +) + +if not "%RESULT%"=="%TEST_TEXT%" ( + echo Test failed: Lua script execution test failed + del /q test.lua + exit /b 1 +) + +REM Test Lua compiler +"%PACKIT_PACKAGE_PATH%\bin\luac.exe" -o test.luac test.lua + +if ERRORLEVEL 1 ( + echo Test failed: Lua compiler test failed + del /q test.lua + exit /b 1 +) + +REM Test running compiled Lua bytecode +set "RESULT=" +for /f "delims=" %%i in ('"%PACKIT_PACKAGE_PATH%\bin\lua.exe" test.luac') do ( + set "RESULT=%%i" +) + +if not "%RESULT%"=="%TEST_TEXT%" ( + echo Test failed: Lua bytecode execution test failed + del /q test.lua + del /q test.luac + exit /b 1 +) + +del /q test.lua +del /q test.luac + +exit /b 0 +``` diff --git a/packages/lua/test.sh b/packages/lua/test.sh new file mode 100644 index 0000000..aaff012 --- /dev/null +++ b/packages/lua/test.sh @@ -0,0 +1,45 @@ +```sh +#!/bin/sh + +test_text="shoot for the stars, aim for the moon" + +# Test Lua interpreter +result=$("$PACKIT_PACKAGE_PATH/bin/lua" -e 'print("shoot for the stars, aim for the moon")') + +if [ "$result" != "$test_text" ]; then + echo "Lua interpreter test failed" + exit 1 +fi + +# Create a Lua source file +echo 'print("shoot for the stars, aim for the moon")' > test.lua + +# Test running a Lua source file +result=$("$PACKIT_PACKAGE_PATH/bin/lua" test.lua) + +if [ "$result" != "$test_text" ]; then + echo "Lua script execution test failed" + rm -f test.lua + exit 1 +fi + +# Test Lua compiler +"$PACKIT_PACKAGE_PATH/bin/luac" -o test.luac test.lua + +if [ $? -ne 0 ]; then + echo "Lua compiler test failed" + rm -f test.lua + exit 1 +fi + +# Test running compiled Lua bytecode +result=$("$PACKIT_PACKAGE_PATH/bin/lua" test.luac) + +if [ "$result" != "$test_text" ]; then + echo "Lua bytecode execution test failed" + rm -f test.lua test.luac + exit 1 +fi + +rm -f test.lua test.luac + diff --git a/packages/neovim/0.12.4/targets.toml b/packages/neovim/0.12.4/targets.toml new file mode 100644 index 0000000..6953d25 --- /dev/null +++ b/packages/neovim/0.12.4/targets.toml @@ -0,0 +1,32 @@ +version = "0.12.4" +license = "Apache 2.0" + +dependencies = [ + gettext, +] + +build_dependencies = [ + cmake, +] + +[source.unix] +url = "https://github.com/neovim/neovim/archive/refs/tags/v0.12.4.tar.gz" +mirrors = [ +] +checksum = "2727da95d2b8b809bc7c71e085452e47dfe1d8aa7cfaa15c68004e23f6f0a6dd" + +[source.windows] +url = "https://github.com/neovim/neovim/archive/refs/tags/v0.12.4.tar.gz" +mirrors = [ +] +checksum = "2727da95d2b8b809bc7c71e085452e47dfe1d8aa7cfaa15c68004e23f6f0a6dd" + +[targets.linux] +source = "unix" + +[targets.mac] +source = "unix" +skip_symlinking = true + +[targets.windows] +source = "windows" \ No newline at end of file diff --git a/packages/neovim/build.bat b/packages/neovim/build.bat new file mode 100644 index 0000000..8c7f586 --- /dev/null +++ b/packages/neovim/build.bat @@ -0,0 +1,41 @@ +@echo off + +cd neovim-%PACKIT_PACKAGE_VERSION% + +REM Read Visual Studio install path +for /f "tokens=* usebackq" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do ( + set VSPATH=%%i +) + +if not exist "%VSPATH%" ( + echo Visual Studio cannot be loaded from %VSPATH% + exit /b 1 +) + +set "VCVARSALL=%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" +if not exist "%VCVARSALL%" ( + echo vcvarsall.bat cannot be loaded from %VCVARSALL% + exit /b 1 +) + +if "%PACKIT_TARGET%"=="x86_64-pc-windows-msvc" ( + set ARCH=x64 +) else if "%PACKIT_TARGET%"=="aarch64-pc-windows-msvc" ( + set ARCH=arm64 +) else ( + echo Unsupported target %PACKIT_TARGET% + exit /b 1 +) + +call "%VCVARSALL%" %ARCH% + +cmake -B build ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX="%PACKIT_PACKAGE_PATH%" +if ERRORLEVEL 1 exit /b %ERRORLEVEL% + +cmake --build build --config Release +if ERRORLEVEL 1 exit /b %ERRORLEVEL% + +cmake --install build --config Release +if ERRORLEVEL 1 exit /b %ERRORLEVEL% \ No newline at end of file diff --git a/packages/neovim/build.sh b/packages/neovim/build.sh new file mode 100644 index 0000000..24ebda8 --- /dev/null +++ b/packages/neovim/build.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +cd "neovim-$PACKIT_PACKAGE_VERSION" + +cmake -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="$PACKIT_PACKAGE_PATH" + +cmake --build build + +cmake --install build \ No newline at end of file diff --git a/packages/neovim/package.toml b/packages/neovim/package.toml new file mode 100644 index 0000000..99b0e61 --- /dev/null +++ b/packages/neovim/package.toml @@ -0,0 +1,8 @@ +name = "neovim" +description = "hyperextensible Vim-based text editor" +homepage = "https://github.com/neovim/neovim" +versions = [ "0.12.4"] + +[supported_versions] +unix = "0.12.4" +windows = "0.12.4" \ No newline at end of file