added compile script

This commit is contained in:
Paul Wilde 2024-11-25 12:28:22 +00:00
parent d0997234b6
commit fa64cf55f4
5 changed files with 38 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

38
scripts/build.sh Executable file
View file

@ -0,0 +1,38 @@
#!/usr/bin/env sh
version=$(grep -i version norg.nimble | awk '{print $3}' | sed "s/\"//g" | sed "s/\./_/g")
dir=$(pwd)
echo Building for Linux
nimble build -d:linux
if [ $? != 1 ]; then
echo "Compressing..."
cd bin || exit
tar cvzf "norg_linux_$version.tar.gz" norg
rm norg
cd "$dir" || exit
echo Done.
fi
echo Building for FreeBSD
nimble build -d:freebsd
if [ $? != 1 ]; then
echo "Compressing..."
cd bin || exit
tar cvzf "norg_freebsd_$version.tar.gz" norg
rm norg
cd "$dir" || exit
echo Done.
fi
echo Building for Windows
nimble build -d:mingw
if [ $? != 1 ]; then
echo "Zipping..."
cd bin || exit
cp ../resources/windows/lib* ./
zip "norg_windows_$version.zip" norg.exe lib*
rm ./lib*
cd "$dir" || exit
rm bin/norg.exe
echo Done.
fi