Separate dependency lock files

This commit is contained in:
2024-10-24 15:20:05 -04:00
parent d51c9e6359
commit 63cd99cd4d

View File

@@ -153,161 +153,164 @@ parse_input() {
install_dependencies() { install_dependencies() {
debug "${FUNCNAME[0]}" debug "${FUNCNAME[0]}"
local lock_file="$BUILDROOT/.dependencies"
local -a pkg_list local -a pkg_list
local lock_file
# TODO please contribute your platform here
if ((FROM_SOURCE)); then if ((FROM_SOURCE)); then
# For building from source with make lock_file="$BUILDROOT/.dependencies_sc"
# https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem
case "$ID" in
fedora|centos)
pkg_list+=(
"bash-completion"
"bzip2"
"gcc"
"gcc-c++"
"git"
"make"
"ncurses-devel"
"patch"
"rsync"
"tar"
"unzip"
"wget"
"which"
"diffutils"
"python2"
"python3"
"python3-setuptools"
"python3-pyelftools"
"perl-base"
"perl-Data-Dumper"
"perl-File-Compare"
"perl-File-Copy"
"perl-FindBin"
"perl-IPC-Cmd"
"perl-Thread-Queue"
"perl-Time-Piece"
"perl-JSON-PP"
"swig"
"clang" # for qosify
"llvm15-libs"
"patch")
;;
debian|ubuntu)
pkg_list+=(
"build-essential"
"clang"
"flex"
"g++"
"gawk"
"gcc-multilib"
"gettext"
"git"
"libncurses5-dev"
"libssl-dev"
"python3-distutils"
"rsync"
"unzip"
"zlib1g-dev"
"file"
"wget"
"patch")
;;
arch)
pkg_list+=(
"base-devel"
"autoconf"
"automake"
"bash"
"binutils"
"bison"
"bzip2"
"clang"
"fakeroot"
"file"
"findutils"
"flex"
"gawk"
"gcc"
"gettext"
"git"
"grep"
"groff"
"gzip"
"libelf"
"libtool"
"libxslt"
"m4"
"make"
"ncurses"
"openssl"
"patch"
"pkgconf"
"python"
"rsync"
"sed"
"texinfo"
"time"
"unzip"
"util-linux"
"wget"
"which"
"zlib"
"patch")
;;
*)
debug "Skipping dependency install, your OS is unsupported"
return 1
;;
esac
else else
# For Imagebuilder lock_file="$BUILDROOT/.dependencies_ib"
case "$ID" in fi
fedora|centos)
pkg_list+=( if [[ ! -f $lock_file ]]; then
"@c-development" if ((FROM_SOURCE)); then
"@development-tools" # For building from source code
"@development-libs" # https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem
"perl-FindBin" case "$ID" in
"zlib-static" fedora|centos)
"elfutils-libelf-devel" pkg_list+=(
"gawk" "bash-completion"
"unzip" "bzip2"
"file" "gcc"
"wget" "gcc-c++"
"python3" "git"
"python2" "make"
"axel" "ncurses-devel"
"perl-IPC-Cmd") "patch"
;; "rsync"
debian|ubuntu) "tar"
pkg_list+=( "unzip"
"build-essential" "wget"
"libncurses5-dev" "which"
"libncursesw5-dev" "diffutils"
"zlib1g-dev" "python2"
"gawk" "python3"
"git" "python3-setuptools"
"gettext" "python3-pyelftools"
"libssl-dev" "perl-base"
"xsltproc" "perl-Data-Dumper"
"wget" "perl-File-Compare"
"unzip" "perl-File-Copy"
"python" "perl-FindBin"
"axel") "perl-IPC-Cmd"
;; "perl-Thread-Queue"
*) "perl-Time-Piece"
debug "Skipping dependency install, your OS is unsupported" "perl-JSON-PP"
return 1 "swig"
;; "clang" # for qosify
esac "llvm15-libs"
"patch")
;;
debian|ubuntu)
pkg_list+=(
"build-essential"
"clang"
"flex"
"g++"
"gawk"
"gcc-multilib"
"gettext"
"git"
"libncurses5-dev"
"libssl-dev"
"python3-distutils"
"rsync"
"unzip"
"zlib1g-dev"
"file"
"wget"
"patch")
;;
arch)
pkg_list+=(
"base-devel"
"autoconf"
"automake"
"bash"
"binutils"
"bison"
"bzip2"
"clang"
"fakeroot"
"file"
"findutils"
"flex"
"gawk"
"gcc"
"gettext"
"git"
"grep"
"groff"
"gzip"
"libelf"
"libtool"
"libxslt"
"m4"
"make"
"ncurses"
"openssl"
"patch"
"pkgconf"
"python"
"rsync"
"sed"
"texinfo"
"time"
"unzip"
"util-linux"
"wget"
"which"
"zlib"
"patch")
;;
*)
debug "Skipping dependency install, your OS is unsupported"
return 1
;;
esac
else
# For Imagebuilder
case "$ID" in
fedora|centos)
pkg_list+=(
"@c-development"
"@development-tools"
"@development-libs"
"perl-FindBin"
"zlib-static"
"elfutils-libelf-devel"
"gawk"
"unzip"
"file"
"wget"
"python3"
"python2"
"axel"
"perl-IPC-Cmd")
;;
debian|ubuntu)
pkg_list+=(
"build-essential"
"libncurses5-dev"
"libncursesw5-dev"
"zlib1g-dev"
"gawk"
"git"
"gettext"
"libssl-dev"
"xsltproc"
"wget"
"unzip"
"python"
"axel")
;;
*)
debug "Skipping dependency install, your OS is unsupported"
return 1
;;
esac
fi
fi fi
# Skip dependency installation if lock file is present
[[ -f $lock_file ]] && return
pkg_install "${pkg_list[@]}" && echo "${pkg_list[@]}" > "$lock_file" pkg_install "${pkg_list[@]}" && echo "${pkg_list[@]}" > "$lock_file"
} }