2023-02-22 01:44:27 +00:00
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
DEPENDENCIES+=(
|
|
|
|
git
|
|
|
|
make
|
|
|
|
)
|
|
|
|
|
|
|
|
REQUIRED_ENV+=()
|
|
|
|
|
2022-08-16 00:30:37 +00:00
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
PACKAGE_INSTALL_DIR="$HOME/.local/share/source-packages"
|
2022-08-17 00:48:56 +00:00
|
|
|
[ ! -d "$PACKAGE_INSTALL_DIR" ] && mkdir -p "$PACKAGE_INSTALL_DIR"
|
2022-08-16 00:30:37 +00:00
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
CLONE() {
|
|
|
|
cd "$PACKAGE_INSTALL_DIR"
|
2023-02-22 01:44:27 +00:00
|
|
|
STATUS "downloading $NAME"
|
2022-08-16 00:30:37 +00:00
|
|
|
git clone "$TARGET" "$NAME" \
|
2023-02-22 01:44:27 +00:00
|
|
|
&& SUCCESS "successfully downloaded '$NAME'" \
|
|
|
|
|| FAIL 1 "failed to download '$NAME'" \
|
2022-08-16 00:30:37 +00:00
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
PULL() {
|
2023-02-22 01:44:27 +00:00
|
|
|
STATUS "updating '$NAME'"
|
2022-08-16 00:30:37 +00:00
|
|
|
cd "$PACKAGE_INSTALL_DIR/$NAME"
|
|
|
|
git pull origin $(git rev-parse --abbrev-ref HEAD) \
|
2023-02-22 01:44:27 +00:00
|
|
|
&& SUCCESS "successfully updated '$NAME'" \
|
|
|
|
|| FAIL 1 "failed to update '$NAME'" \
|
2022-08-16 00:30:37 +00:00
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
BUILD() {
|
|
|
|
cd "$PACKAGE_INSTALL_DIR/$NAME"
|
|
|
|
|
|
|
|
CHECK_MAKE && { MAKE && return 0 || return 1; }
|
|
|
|
CHECK_MAKEPKG && { MAKEPKG && return 0 || return 2; }
|
|
|
|
|
2023-02-22 01:44:27 +00:00
|
|
|
WARNING 'could not detect supported installation method'
|
2022-08-16 00:30:37 +00:00
|
|
|
|
2023-02-22 01:44:27 +00:00
|
|
|
REMINDER 'complete manual installation in the directory below:'
|
|
|
|
REMINDER "$PACKAGE_INSTALL_DIR/$NAME"
|
2022-08-16 00:30:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CHECK_MAKE() { [ -f ./Makefile ]; }
|
|
|
|
CHECK_MAKEPKG() { [ -f ./PKGBUILD ]; }
|
|
|
|
|
|
|
|
MAKE() {
|
|
|
|
[[ $CLEAN -eq 1 ]] && {
|
2023-02-22 01:44:27 +00:00
|
|
|
STATUS "cleaning '$NAME'"
|
2022-08-16 00:30:37 +00:00
|
|
|
make clean
|
|
|
|
}
|
|
|
|
|
2023-02-22 01:44:27 +00:00
|
|
|
STATUS "building '$NAME'"
|
2022-08-16 00:30:37 +00:00
|
|
|
make \
|
2023-02-22 01:44:27 +00:00
|
|
|
&& SUCCESS "finished building '$NAME'" \
|
|
|
|
|| FAIL 1 "build failed for '$NAME' (see above)"\
|
2022-08-16 00:30:37 +00:00
|
|
|
;
|
|
|
|
|
2023-02-22 01:44:27 +00:00
|
|
|
STATUS "installing '$NAME'"
|
|
|
|
GETSUDO
|
2022-08-16 00:30:37 +00:00
|
|
|
sudo make install \
|
2023-02-22 01:44:27 +00:00
|
|
|
&& SUCCESS "succesfully installed '$NAME'" \
|
|
|
|
|| FAIL 2 "failed to install '$NAME' (see above)"\
|
2022-08-16 00:30:37 +00:00
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
MAKEPKG() {
|
2023-02-22 01:44:27 +00:00
|
|
|
STATUS "installing '$NAME'"
|
2022-08-16 00:30:37 +00:00
|
|
|
yes | makepkg -si \
|
2023-02-22 01:44:27 +00:00
|
|
|
&& SUCCESS "succesfully installed '$NAME'" \
|
|
|
|
|| FAIL 1 "failed to install '$NAME' (see above)"\
|
2022-08-16 00:30:37 +00:00
|
|
|
;
|
|
|
|
}
|