rebuild: add support for using arguments as packages to build
parent
cb74fccba0
commit
b34ed6face
58
rebuild.sh
58
rebuild.sh
|
@ -1,17 +1,19 @@
|
||||||
pkgs=(
|
all_pkgs=(
|
||||||
cef-standard
|
cef-standard
|
||||||
cereal
|
cereal
|
||||||
|
chocolate-doom
|
||||||
chromium-vaapi-bin
|
chromium-vaapi-bin
|
||||||
chromium-widevine
|
chromium-widevine
|
||||||
clementine-qt5-git
|
clementine-qt5-git
|
||||||
desmume-git
|
desmume-git
|
||||||
dolphin-emu-git
|
dolphin-emu-git
|
||||||
|
eternity-engine-git
|
||||||
fceux-git
|
fceux-git
|
||||||
gdcc
|
gdcc
|
||||||
gvim-git
|
gvim-git
|
||||||
gzdoom-legacy
|
gzdoom-legacy
|
||||||
higan_v106-source
|
|
||||||
higan-bsnes
|
higan-bsnes
|
||||||
|
higan_v106-source
|
||||||
libsodium-git
|
libsodium-git
|
||||||
mednaffe
|
mednaffe
|
||||||
megatools
|
megatools
|
||||||
|
@ -23,6 +25,7 @@ pkgs=(
|
||||||
obs-studio-git
|
obs-studio-git
|
||||||
pcsx2-git
|
pcsx2-git
|
||||||
ppsspp-git
|
ppsspp-git
|
||||||
|
prboom-plus
|
||||||
ripcord
|
ripcord
|
||||||
rpcs3-git
|
rpcs3-git
|
||||||
sharenix-git
|
sharenix-git
|
||||||
|
@ -37,35 +40,36 @@ pkgs=(
|
||||||
declare -A options=(
|
declare -A options=(
|
||||||
["cef-standard"]="--asdeps"
|
["cef-standard"]="--asdeps"
|
||||||
["cereal"]="--asdeps"
|
["cereal"]="--asdeps"
|
||||||
["ppsspp-git"]="--install-as ppsspp-git"
|
|
||||||
["mupen64plus-noncore-plugins-git"]="--no-pull -f"
|
|
||||||
["higan_v106-source"]="--is-higan"
|
["higan_v106-source"]="--is-higan"
|
||||||
["libsodium-git"]="--asdeps"
|
["libsodium-git"]="--asdeps"
|
||||||
|
["mupen64plus-noncore-plugins-git"]="--no-pull -f"
|
||||||
|
["ppsspp-git"]="--install-as ppsspp-git"
|
||||||
["vim-runtime-git"]="--asdeps"
|
["vim-runtime-git"]="--asdeps"
|
||||||
)
|
)
|
||||||
pkg_ver() {
|
pkg_ver() {
|
||||||
sed '/^pkgver\=/!d;s/pkgver\=\(.*\)/\1/' PKGBUILD
|
sed '/^pkgver\=/!d;s/pkgver\=\(.*\)/\1/' PKGBUILD
|
||||||
}
|
}
|
||||||
build_package() {
|
build_package() {
|
||||||
pkg=$1
|
cd ~/bin
|
||||||
|
|
||||||
|
local pkg=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
if [[ ! -d ~/bin/$pkg ]]
|
if [[ ! -d ~/bin/$pkg ]]
|
||||||
then
|
then
|
||||||
cd ~/bin
|
|
||||||
git clone https://aur.archlinux.org/$pkg.git
|
git clone https://aur.archlinux.org/$pkg.git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ~/bin/$pkg
|
cd $pkg
|
||||||
|
|
||||||
special_handling=
|
local special_handling
|
||||||
no_pull=
|
local no_pull
|
||||||
install_as=
|
local install_as
|
||||||
makepkg_args="-srLc --noconfirm --needed"
|
local makepkg_args="-srLc --noconfirm --needed"
|
||||||
|
|
||||||
while [[ $@ ]]
|
while (( $# ))
|
||||||
do
|
do
|
||||||
case "$1" in
|
case $1 in
|
||||||
--is-higan)
|
--is-higan)
|
||||||
special_handling=1
|
special_handling=1
|
||||||
shift
|
shift
|
||||||
|
@ -93,8 +97,11 @@ build_package() {
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ ! $special_handling ]]
|
if [[ $special_handling ]]
|
||||||
then
|
then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! $no_pull ]]
|
if [[ ! $no_pull ]]
|
||||||
then
|
then
|
||||||
git pull
|
git pull
|
||||||
|
@ -105,16 +112,17 @@ build_package() {
|
||||||
makepkg_args="$makepkg_args -i"
|
makepkg_args="$makepkg_args -i"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
o_pkgver=$(pkg_ver)
|
local o_pkgver=$(pkg_ver)
|
||||||
|
local pkgver
|
||||||
|
|
||||||
makepkg $makepkg_args
|
makepkg $makepkg_args
|
||||||
|
|
||||||
res=$?
|
local res=$?
|
||||||
|
|
||||||
if (( $res ))
|
if (( $res ))
|
||||||
then
|
then
|
||||||
pkgver=$(pkg_ver)
|
pkgver=$(pkg_ver)
|
||||||
if [[ ! $pkgver == $o_pkgver ]]
|
if [[ ! $install_as ]] || [[ ! $pkgver == $o_pkgver ]]
|
||||||
then
|
then
|
||||||
echo "error in rebuild, aborting"
|
echo "error in rebuild, aborting"
|
||||||
exit $res
|
exit $res
|
||||||
|
@ -126,12 +134,24 @@ build_package() {
|
||||||
pkgver=$(pkg_ver)
|
pkgver=$(pkg_ver)
|
||||||
sudo pacman --noconfirm --needed -U $install_as-$pkgver*.pkg.tar.xz
|
sudo pacman --noconfirm --needed -U $install_as-$pkgver*.pkg.tar.xz
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
main() {
|
||||||
|
local pkg
|
||||||
|
local pkgs
|
||||||
|
|
||||||
for pkg in ${pkgs[*]}
|
if (( $# ))
|
||||||
|
then
|
||||||
|
pkgs=$@
|
||||||
|
else
|
||||||
|
pkgs=${all_pkgs[*]}
|
||||||
|
fi
|
||||||
|
|
||||||
|
for pkg in $pkgs
|
||||||
do
|
do
|
||||||
build_package $pkg ${options[$pkg]}
|
build_package $pkg ${options[$pkg]}
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
main $@
|
||||||
|
|
||||||
## EOF
|
## EOF
|
||||||
|
|
Loading…
Reference in New Issue