diff --git a/chocpkg/chocpkg b/chocpkg/chocpkg index 6e2b38b..eb630a1 100755 --- a/chocpkg/chocpkg +++ b/chocpkg/chocpkg @@ -59,6 +59,9 @@ configure_for_package() { PACKAGE_SOURCE_TYPE=fetch elif [ "${GIT_URL:-}" != "" ]; then PACKAGE_SOURCE_TYPE=git + elif [ "${DEPENDENCIES:-}" != "" ]; then + PACKAGE_SOURCE_TYPE=package-group + PACKAGE_TYPE=target # it doesn't matter else error_exit "Unknown package type; neither PACKAGE_URL nor GIT_URL set." fi @@ -135,6 +138,9 @@ fetch_package() { git clone -b "$GIT_BRANCH" "$GIT_URL" "$PACKAGE_BUILD_DIR" fi ;; + package-group) + error_exit "Can't fetch a package group, only install it." + ;; esac } @@ -179,10 +185,17 @@ do_build() { ) } -build_package() { +install_dependencies() { for dep in $DEPENDENCIES; do chocpkg install "$dep" 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" echo ======================================================= @@ -204,6 +217,11 @@ do_install() { } reinstall_package() { + if [ "$PACKAGE_SOURCE_TYPE" = "package-group" ]; then + install_dependencies + return + fi + build_package "$PACKAGE_NAME" cd "$PACKAGE_BUILD_DIR" do_install diff --git a/pkgdef/extra-libs.sh b/pkgdef/extra-libs.sh new file mode 100644 index 0000000..5b1e106 --- /dev/null +++ b/pkgdef/extra-libs.sh @@ -0,0 +1,7 @@ +# Optional libraries which can be used by Chocolate Doom. +DEPENDENCIES=" +flac +libpng +libsamplerate +libvorbis +"