-
Notifications
You must be signed in to change notification settings - Fork 1
Add package: lua #88
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
base: main
Are you sure you want to change the base?
Add package: lua #88
Changes from all commits
6ae1dbe
c108933
4e1a3a1
a7c166e
a4625c7
0e1726e
b7e153f
200debe
24e7c3f
4a0bcb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -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 | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think
Suggested change
|
||||
|
|
||||
| [targets.windows] | ||||
| source = "windows" | ||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,61 @@ | ||||
| cd lua-%PACKIT_PACKAGE_VERSION% | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Newer versions of Packit automatically go to this directory, so this is not necessary anymore.
Suggested change
|
||||
|
|
||||
| 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" ( | ||||
|
Comment on lines
+3
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Initialising MSVC like this is not necessary in newer versions of Packit. You can use this instead: Also don't forget the to set the MSVC requirement for Windows in the (I couldn't select the whole MSVC init part, but please remove it all :)) |
||||
| 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 | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can remove this, if the script is successful it will exit with 0 already:
Suggested change
|
||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||
| ```sh | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not necessary:
Suggested change
|
||||||||||
| #!/bin/sh | ||||||||||
|
|
||||||||||
| cd lua-$PACKIT_PACKAGE_VERSION | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Newer versions of Packit automatically go to this directory, so this is not necessary anymore.
Suggested change
|
||||||||||
|
|
||||||||||
| # Build Lua | ||||||||||
| make | ||||||||||
|
|
||||||||||
| if [ $? -ne 0 ]; then | ||||||||||
| echo "Lua build failed" | ||||||||||
| exit 1 | ||||||||||
| fi | ||||||||||
|
Comment on lines
+9
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checking the status code is only necessary in batch scripts:
Suggested change
|
||||||||||
|
|
||||||||||
| # 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 | ||||||||||
|
Comment on lines
+17
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checking the status code is only necessary in batch scripts:
Suggested change
|
||||||||||
|
|
||||||||||
| # 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 | ||||||||||
| ``` | ||||||||||
|
Comment on lines
+29
to
+30
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the script is successful it will already return 0:
Suggested change
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||
| ```bat | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not necessary:
Suggested change
|
||||||
| @echo off | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of doing this please redirect any output from these test script to filedescriptor 3. If
Suggested change
|
||||||
|
|
||||||
| 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 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is executed in a temporary file, so removing the test files is not necessary:
Suggested change
|
||||||
| 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 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is executed in a temporary file, so removing the test files is not necessary:
Suggested change
|
||||||
| 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 | ||||||
|
Comment on lines
+48
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is executed in a temporary file, so removing the test files is not necessary:
Suggested change
|
||||||
| exit /b 1 | ||||||
| ) | ||||||
|
|
||||||
| del /q test.lua | ||||||
| del /q test.luac | ||||||
|
Comment on lines
+53
to
+54
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is executed in a temporary file, so removing the test files is not necessary:
Suggested change
|
||||||
|
|
||||||
| exit /b 0 | ||||||
| ``` | ||||||
|
Comment on lines
+56
to
+57
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the script is successful it will already return 0 (also remove the quotes):
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||
| ```sh | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not necessary:
Suggested change
|
||||||
| #!/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" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the same format as in other tests, like this:
Suggested change
|
||||||
| 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" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the same format as in other tests, like this:
Suggested change
|
||||||
| rm -f test.lua | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Packit tests are executed in a temporary directory, so removing test file is unnecessary:
Suggested change
|
||||||
| 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" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the same format as in other tests, like this:
Suggested change
|
||||||
| rm -f test.lua | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Packit tests are executed in a temporary directory, so removing test file is unnecessary:
Suggested change
|
||||||
| 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" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the same format as in other tests, like this:
Suggested change
|
||||||
| rm -f test.lua test.luac | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Packit tests are executed in a temporary directory, so removing test file is unnecessary:
Suggested change
|
||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| rm -f test.lua test.luac | ||||||
|
|
||||||
|
Comment on lines
+44
to
+45
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Packit tests are executed in a temporary directory, so removing test file is unnecessary:
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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% |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" |
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.
Please use the SPDX format for the licenses. You can find them here: https://spdx.org/licenses/.