scripts/rebuild.sh

163 lines
2.6 KiB
Bash
Raw Normal View History

all_pkgs=(
2019-04-30 21:21:21 -07:00
# deps
2019-04-27 06:57:23 -07:00
cef-standard
cereal
2019-04-30 21:21:21 -07:00
libsodium-git
mozc
vim-runtime-git
# packages
chocolate-doom
2019-04-27 06:57:23 -07:00
chromium-vaapi-bin
chromium-widevine
desmume-git
dolphin-emu-git
eternity-engine-git
2019-04-27 06:57:23 -07:00
fceux-git
gdcc
2019-04-30 21:21:21 -07:00
godot
2019-05-03 19:09:35 -07:00
gopherus
2019-04-27 06:57:23 -07:00
gvim-git
gzdoom-legacy
higan-bsnes
higan_v106-source
2019-04-27 06:57:23 -07:00
mednaffe
megatools
mgba-git
2019-05-03 19:09:35 -07:00
motsognir
2019-04-27 06:57:23 -07:00
mupen64plus-git
mupen64plus-gui-git
mupen64plus-noncore-plugins-git
obs-linuxbrowser-bin
obs-studio-git
pcsx2-git
ppsspp-git
prboom-plus
2019-04-27 06:57:23 -07:00
ripcord
rpcs3-git
sharenix-git
slade
squirrel-sql
2019-04-30 21:21:21 -07:00
uim-mozc
2019-04-27 06:57:23 -07:00
xf86-input-xwiimote-git
xf86-video-amdgpu-git
xwiimote-git
zdoom
)
declare -A options=(
["cef-standard"]="--asdeps"
["cereal"]="--asdeps"
["libsodium-git"]="--asdeps"
2019-04-30 21:21:21 -07:00
["mozc"]="--asdeps"
["vim-runtime-git"]="--asdeps"
["higan_v106-source"]="--is-higan"
["mupen64plus-noncore-plugins-git"]="--no-pull -f"
["ppsspp-git"]="--install-as ppsspp-git"
2019-04-27 06:57:23 -07:00
)
pkg_ver() {
sed '/^pkgver\=/!d;s/pkgver\=\(.*\)/\1/' PKGBUILD
}
build_package() {
cd ~/bin
local pkg=$1
2019-04-27 06:57:23 -07:00
shift
if [[ ! -d ~/bin/$pkg ]]
then
git clone https://aur.archlinux.org/$pkg.git
fi
cd $pkg
2019-04-27 06:57:23 -07:00
local special_handling
local no_pull
local install_as
2019-04-30 21:21:14 -07:00
local makepkg_args="-srLcCf --noconfirm"
2019-04-27 06:57:23 -07:00
while (( $# ))
2019-04-27 06:57:23 -07:00
do
case $1 in
2019-04-27 06:57:23 -07:00
--is-higan)
special_handling=1
shift
cd higan
2019-04-30 21:21:14 -07:00
make clean
2019-04-27 06:57:23 -07:00
make -j12
make install
;;
--no-pull)
no_pull=1
shift
;;
--install-as)
install_as=$2
shift 2
;;
--asdeps|--skipinteg|-f)
makepkg_args="$makepkg_args $1"
shift
;;
*)
echo "error in rebuild configuration ($1), aborting"
exit 1
;;
esac
done
if [[ $special_handling ]]
2019-04-27 06:57:23 -07:00
then
return
fi
2019-04-27 06:57:23 -07:00
if [[ ! $no_pull ]]
then
git pull
fi
2019-04-27 06:57:23 -07:00
if [[ ! $install_as ]]
then
makepkg_args="$makepkg_args -i"
fi
2019-04-27 06:57:23 -07:00
local pkgver
2019-04-27 06:57:23 -07:00
makepkg $makepkg_args
2019-04-27 06:57:23 -07:00
local res=$?
2019-04-27 06:57:23 -07:00
if (( $res ))
then
2019-04-30 21:21:14 -07:00
echo "error in rebuild, aborting"
exit $res
2019-04-27 06:57:23 -07:00
fi
if [[ $install_as ]]
then
pkgver=$(pkg_ver)
sudo pacman --noconfirm --needed -U $install_as-$pkgver*.pkg.tar
fi
}
main() {
local pkg
local pkgs
if (( $# ))
then
pkgs=$@
else
pkgs=${all_pkgs[*]}
fi
for pkg in $pkgs
do
build_package $pkg ${options[$pkg]}
done
2019-04-27 06:57:23 -07:00
}
main $@
2019-04-27 06:57:23 -07:00
## EOF