Files
Aaru/build.sh

79 lines
2.6 KiB
Bash
Raw Permalink Normal View History

2020-03-12 12:44:37 +00:00
#!/usr/bin/env bash
2025-11-21 01:16:38 +00:00
AARU_VERSION=6.0.0-alpha.15.1
2022-10-12 14:19:16 +02:00
OS_NAME=$(uname)
2020-03-12 12:44:37 +00:00
mkdir -p build
# Create standalone versions
cd Aaru
for conf in Debug Release;
do
2025-08-14 03:35:26 +01:00
for distro in linux-arm64 linux-arm linux-x64 osx-x64 osx-arm64 win-arm64 win-x64 win-x86;
2020-03-12 12:44:37 +00:00
do
2025-08-22 01:15:20 +01:00
dotnet publish -f net10.0 -r ${distro} -c ${conf}
2020-03-12 12:44:37 +00:00
# Package the Linux packages (stopped working)
2025-08-22 02:02:55 +01:00
# if [[ ${distro} == alpine* ]] || [[ ${distro} == linux* ]]; then
# dotnet tarball -f net10.0 -r ${distro} -c ${conf} -o ../build
# dotnet rpm -f net10.0 -r ${distro} -c ${conf} -o ../build
# dotnet deb -f net10.0 -r ${distro} -c ${conf} -o ../build
# elif [[ ${distro} == win* ]] || [[ ${distro} == osx* ]]; then
# dotnet zip -f net10.0 -r ${distro} -c ${conf} -o ../build
# elif [[ ${distro} == rhel* ]] || [[ ${distro} == sles* ]]; then
# pkg="rpm"
# else
# pkg="deb"
2025-08-22 02:02:55 +01:00
# fi
2025-08-14 03:35:26 +01:00
done
2020-03-12 12:44:37 +00:00
done
cd ..
# If we are compiling on Linux check if we are on Arch Linux and then create the Arch Linux package as well
if [[ ${OS_NAME} == Linux ]]; then
2025-08-14 03:35:26 +01:00
OS_RELEASE=`pcregrep -o1 -e "^ID=(?<distro_id>\w+)" /etc/os-release`
2020-03-12 12:44:37 +00:00
2025-08-14 11:34:45 +01:00
if [[ ${OS_RELEASE} != arch && ${OS_RELEASE} != cachyos ]]; then
2020-03-12 12:44:37 +00:00
exit 0
fi
tar --exclude-vcs --exclude="*/bin" --exclude="*/obj" --exclude="build" --exclude="pkg/pacman/*/*.tar.xz" \
--exclude="pkg/pacman/*/src" --exclude="pkg/pacman/*/pkg" --exclude="pkg/pacman/*/*.tar" \
2020-12-03 02:09:18 +00:00
--exclude="pkg/pacman/*/*.asc" --exclude="*.user" --exclude=".idea" --exclude=".vs" --exclude=".vscode" \
--exclude="build.iso" --exclude=".DS_Store" -cvf pkg/pacman/stable/aaru-src-${AARU_VERSION}.tar .
2020-03-12 12:44:37 +00:00
cd pkg/pacman/stable
xz -v9e aaru-src-${AARU_VERSION}.tar
gpg --armor --detach-sign aaru-src-${AARU_VERSION}.tar.xz
cp PKGBUILD PKGBUILD.bak
echo -e \\n >> PKGBUILD
makepkg -g >> PKGBUILD
makepkg
mv PKGBUILD.bak PKGBUILD
2020-03-12 14:38:55 +00:00
mv aaru-src-${AARU_VERSION}.tar.xz aaru-src-${AARU_VERSION}.tar.xz.asc ../../../build
cd ../../..
2020-03-12 12:44:37 +00:00
fi
2021-10-01 00:55:29 +01:00
mv pkg/pacman/stable/*.pkg.tar.zst build/
2020-03-12 12:44:37 +00:00
cd build
2022-03-06 02:23:01 +00:00
for i in *.deb *.rpm *.zip *.tar.gz *.pkg.tar.zst;
2020-03-12 12:44:37 +00:00
do
gpg --armor --detach-sign "$i"
done
2020-04-17 23:30:12 +01:00
2020-04-18 00:18:55 +01:00
cd ..
2020-04-17 23:30:12 +01:00
rm -Rf build/macos/Aaru.app
mkdir -p build/macos/Aaru.app/Contents/Resources
mkdir -p build/macos/Aaru.app/Contents/MacOS
cp Aaru/Aaru.icns build/macos/Aaru.app/Contents/Resources
cp Aaru/Info.plist build/macos/Aaru.app/Contents
2025-08-22 01:15:20 +01:00
cp -r Aaru/bin/Release/net10.0/osx-x64/publish/* build/macos/Aaru.app/Contents/MacOS
2020-04-17 23:30:12 +01:00
rm -Rf build/macos-dbg/Aaru.app
mkdir -p build/macos-dbg/Aaru.app/Contents/Resources
mkdir -p build/macos-dbg/Aaru.app/Contents/MacOS
cp Aaru/Aaru.icns build/macos-dbg/Aaru.app/Contents/Resources
cp Aaru/Info.plist build/macos-dbg/Aaru.app/Contents
2025-08-22 01:15:20 +01:00
cp -r Aaru/bin/Debug/net10.0/osx-x64/publish/* build/macos-dbg/Aaru.app/Contents/MacOS