Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/lua/5.5.1/targets.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version = "5.5.1"
license = "MIT license"

Copy link
Copy Markdown
Contributor

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/.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think skip_symlinking is necessary in this case:

Suggested change
skip_symlinking = true


[targets.windows]
source = "windows"
61 changes: 61 additions & 0 deletions packages/lua/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
cd lua-%PACKIT_PACKAGE_VERSION%

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
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" (
Comment on lines +3 to +25

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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:

REM Call vcvarsall.bat to initialize MSVC build environment
call "%PACKIT_VCVARSALL%" %PACKIT_VCVARSALL_ARCH%

Also don't forget the to set the MSVC requirement for Windows in the targets.toml.

(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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
exit /b 0

30 changes: 30 additions & 0 deletions packages/lua/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
```sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary:

Suggested change
```sh

#!/bin/sh

cd lua-$PACKIT_PACKAGE_VERSION

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
cd lua-$PACKIT_PACKAGE_VERSION


# Build Lua
make

if [ $? -ne 0 ]; then
echo "Lua build failed"
exit 1
fi
Comment on lines +9 to +12

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking the status code is only necessary in batch scripts:

Suggested change
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
Comment on lines +17 to +20

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking the status code is only necessary in batch scripts:

Suggested change
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
```
Comment on lines +29 to +30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the script is successful it will already return 0:

Suggested change
exit 0
```

8 changes: 8 additions & 0 deletions packages/lua/package.toml
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"
57 changes: 57 additions & 0 deletions packages/lua/test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
```bat

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary:

Suggested change
```bat

@echo off

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 --verbose is used by a user this is shown to the user.

Suggested change
@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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
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
Comment on lines +48 to +49

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
del /q test.lua
del /q test.luac

exit /b 1
)

del /q test.lua
del /q test.luac
Comment on lines +53 to +54

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
del /q test.lua
del /q test.luac


exit /b 0
```
Comment on lines +56 to +57

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
exit /b 0
```

45 changes: 45 additions & 0 deletions packages/lua/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
```sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary:

Suggested change
```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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
echo "Lua interpreter test failed"
echo "Test failed: 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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
echo "Lua script execution test failed"
echo "Test failed: Lua script execution test failed"

rm -f test.lua

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
echo "Lua compiler test failed"
echo "Test failed: Lua compiler test failed"

rm -f test.lua

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
echo "Lua bytecode execution test failed"
echo "Test failed: Lua bytecode execution test failed"

rm -f test.lua test.luac

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
rm -f test.lua test.luac

exit 1
fi

rm -f test.lua test.luac

Comment on lines +44 to +45

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
rm -f test.lua test.luac

32 changes: 32 additions & 0 deletions packages/neovim/0.12.4/targets.toml
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"
41 changes: 41 additions & 0 deletions packages/neovim/build.bat
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%
12 changes: 12 additions & 0 deletions packages/neovim/build.sh
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
8 changes: 8 additions & 0 deletions packages/neovim/package.toml
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"