mirror of
https://github.com/chocolate-doom/chocpkg.git
synced 2025-02-02 05:21:55 +00:00
Add support for package groups.
This conveniently allows a whole set of packages to be installed from a single command, without needing an actual package to be built that depends on them all.
This commit is contained in:
parent
2deaf2af97
commit
09a1ff9b8c
2 changed files with 26 additions and 1 deletions
|
@ -59,6 +59,9 @@ configure_for_package() {
|
||||||
PACKAGE_SOURCE_TYPE=fetch
|
PACKAGE_SOURCE_TYPE=fetch
|
||||||
elif [ "${GIT_URL:-}" != "" ]; then
|
elif [ "${GIT_URL:-}" != "" ]; then
|
||||||
PACKAGE_SOURCE_TYPE=git
|
PACKAGE_SOURCE_TYPE=git
|
||||||
|
elif [ "${DEPENDENCIES:-}" != "" ]; then
|
||||||
|
PACKAGE_SOURCE_TYPE=package-group
|
||||||
|
PACKAGE_TYPE=target # it doesn't matter
|
||||||
else
|
else
|
||||||
error_exit "Unknown package type; neither PACKAGE_URL nor GIT_URL set."
|
error_exit "Unknown package type; neither PACKAGE_URL nor GIT_URL set."
|
||||||
fi
|
fi
|
||||||
|
@ -135,6 +138,9 @@ fetch_package() {
|
||||||
git clone -b "$GIT_BRANCH" "$GIT_URL" "$PACKAGE_BUILD_DIR"
|
git clone -b "$GIT_BRANCH" "$GIT_URL" "$PACKAGE_BUILD_DIR"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
package-group)
|
||||||
|
error_exit "Can't fetch a package group, only install it."
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,10 +185,17 @@ do_build() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
build_package() {
|
install_dependencies() {
|
||||||
for dep in $DEPENDENCIES; do
|
for dep in $DEPENDENCIES; do
|
||||||
chocpkg install "$dep"
|
chocpkg install "$dep"
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
build_package() {
|
||||||
|
if [ "$PACKAGE_SOURCE_TYPE" = "package-group" ]; then
|
||||||
|
error_exit "Can't build a package group, only install it."
|
||||||
|
fi
|
||||||
|
install_dependencies
|
||||||
fetch_package "$PACKAGE_NAME"
|
fetch_package "$PACKAGE_NAME"
|
||||||
|
|
||||||
echo =======================================================
|
echo =======================================================
|
||||||
|
@ -204,6 +217,11 @@ do_install() {
|
||||||
}
|
}
|
||||||
|
|
||||||
reinstall_package() {
|
reinstall_package() {
|
||||||
|
if [ "$PACKAGE_SOURCE_TYPE" = "package-group" ]; then
|
||||||
|
install_dependencies
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
build_package "$PACKAGE_NAME"
|
build_package "$PACKAGE_NAME"
|
||||||
cd "$PACKAGE_BUILD_DIR"
|
cd "$PACKAGE_BUILD_DIR"
|
||||||
do_install
|
do_install
|
||||||
|
|
7
pkgdef/extra-libs.sh
Normal file
7
pkgdef/extra-libs.sh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# Optional libraries which can be used by Chocolate Doom.
|
||||||
|
DEPENDENCIES="
|
||||||
|
flac
|
||||||
|
libpng
|
||||||
|
libsamplerate
|
||||||
|
libvorbis
|
||||||
|
"
|
Loading…
Reference in a new issue