2024-01-31 23:13:22 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -f /etc/os-release ]; then
|
|
|
|
. /etc/os-release
|
|
|
|
OS=$NAME
|
|
|
|
elif [ -f /etc/lsb-release ]; then
|
|
|
|
. /etc/lsb-release
|
|
|
|
OS=$DISTRIB_ID
|
|
|
|
else
|
|
|
|
OS=$(uname -s)
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $OS in
|
|
|
|
"Ubuntu")
|
|
|
|
echo Ubuntu
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y jq curl p7zip-full nodejs npm unzip
|
|
|
|
npm install -g @electron/asar
|
|
|
|
./build_deb.sh
|
|
|
|
|
|
|
|
mkdir dist
|
|
|
|
mv deb/*.deb dist
|
|
|
|
;;
|
|
|
|
"Arch Linux")
|
|
|
|
echo "Arch Linux"
|
|
|
|
pacman -Syy --noconfirm
|
|
|
|
pacman -S --noconfirm git sudo base-devel p7zip nodejs jq npm electron libpulse
|
|
|
|
# fix access
|
|
|
|
mkdir /.npm
|
|
|
|
chown -R 65534:65534 "/.npm"
|
|
|
|
# fix "asar: command not found"
|
|
|
|
npm install -g @electron/asar
|
|
|
|
# fix makepkg from non-root
|
|
|
|
mkdir /home/build
|
|
|
|
chgrp nobody /home/build
|
|
|
|
chmod g+ws /home/build
|
|
|
|
setfacl -m u::rwx,g::rwx /home/build
|
|
|
|
setfacl -d --set u::rwx,g::rwx,o::- /home/build
|
|
|
|
chown nobody .
|
|
|
|
sudo -u nobody makepkg --log
|
|
|
|
|
|
|
|
mkdir dist
|
|
|
|
mv *.pkg.tar.zst dist
|
|
|
|
;;
|
2024-02-01 00:07:07 +03:00
|
|
|
# "NixOS")
|
|
|
|
# echo NixOS
|
|
|
|
# nix build
|
|
|
|
# ;;
|
2024-01-31 23:13:22 +03:00
|
|
|
*)
|
|
|
|
echo "Operating system is not recognized."
|
|
|
|
;;
|
|
|
|
esac
|