diff --git a/Vedvfile.manjaro b/Vedvfile.manjaro index 7ad57dd..fbc8027 100644 --- a/Vedvfile.manjaro +++ b/Vedvfile.manjaro @@ -7,7 +7,7 @@ RUN echo 'export IMAGE_BUILDING=true' | \ WORKDIR /home/vedv/ydf # generate mirrors -RUN sudo pacman-mirrors --country United_States +RUN sudo pacman-mirrors --fasttrack # install flatpak gnome base system RUN sudo -H flatpak install --assumeyes --noninteractive \ diff --git a/packages.env b/packages.env index 6210570..5d3ac3f 100644 --- a/packages.env +++ b/packages.env @@ -22,10 +22,14 @@ PKG_DEV_ANY_NPM=( # ## RUNTIME -PKG_RUN_MANJARO_YAY=( - +PKG_RUN_MANJARO_PACMAN=( + bash ) +# PKG_RUN_MANJARO_YAY=( + +# ) + ## OPTIONAL PKG_OPT_MANJARO_PACMAN=( yay @@ -62,7 +66,9 @@ PKG_DEV_MANJARO_NPM=("${PKG_DEV_ANY_NPM[@]}") # ## RUNTIME -PKG_RUN_UBUNTU_APT=() +PKG_RUN_UBUNTU_APT=( + bash +) # PKG_RUN_UBUNTU_PIP=("${PKG_RUN_ANY_PIP[@]}") # PKG_RUN_UBUNTU_NPM=("${PKG_RUN_ANY_NPM[@]}") diff --git a/src/usr/lib/ydf/components/package/ydf-package-service.bash b/src/usr/lib/ydf/components/package/ydf-package-service.bash index 6c4aab1..e86008d 100644 --- a/src/usr/lib/ydf/components/package/ydf-package-service.bash +++ b/src/usr/lib/ydf/components/package/ydf-package-service.bash @@ -35,7 +35,8 @@ readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON='@flatpak @snap install docke readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_ANY="preinstall ${__YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON}" # MANJARO readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_MANJARO="preinstall @pacman @yay ${__YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON}" -readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_UBUNTU="preinstall ${__YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON}" + +readonly __YDF_PACKAGE_SERVICE_INSTRUCTIONS_UBUNTU="preinstall @apt @apt-get ${__YDF_PACKAGE_SERVICE_INSTRUCTIONS_COMMON}" # # FUNCTIONS @@ -556,6 +557,48 @@ ydf::package_service::__instruction_dconf_ini() { dconf load / /dev/null; then - sudo ln -s "$(command -v fdfind)" "$(dirname "$(command -v fdfind)")/fd" -fi +## apt packages +sudo -E apt-get install -y "${PKG_DEV_UBUNTU_APT[@]}" -# Install snap packages +# snap packages # shellcheck disable=SC2086 for s in "${PKG_DEV_UBUNTU_SNAP[@]}"; do sudo snap install $s; done -# Install npm packages +# npm packages sudo -H npm install -g "${PKG_DEV_UBUNTU_NPM[@]}" -# Install bash bats libs +## github packages + +### Install bash bats libs for bats_lib in bats-support bats-assert bats-file; do repo="https://github.com/bats-core/${bats_lib}.git" tag="$(git ls-remote --tags --exit-code --sort='v:refname' --refs "$repo" | tail -n 1 | cut -d/ -f3)" sudo -H git clone "$repo" --depth 1 --branch "$tag" "/usr/lib/bash-${bats_lib}-git" >/dev/null done - +#### configure bash libs sudo ln -s /usr/lib/bash-bats-file-git /usr/lib/bats-file +### Install vedv if [[ "$IMAGE_BUILDING" == false ]]; then - # Install vedv ( cd "$(mktemp -d)" @@ -57,7 +58,14 @@ EOF ) fi +# Configure + +## configure fd +if command -v fdfind >/dev/null; then + sudo ln -s "$(command -v fdfind)" "$(dirname "$(command -v fdfind)")/fd" +fi + +## configure git hooks if [[ "$IMAGE_BUILDING" == false ]]; then - # configure git hooks git config core.hooksPath .githooks fi diff --git a/tools/install-opt-manjaro b/tools/install-opt-manjaro index aa6c0e2..9f91382 100755 --- a/tools/install-opt-manjaro +++ b/tools/install-opt-manjaro @@ -57,5 +57,10 @@ if [[ -f .ydf.env ]]; then fi cd "$(mktemp -d)" -git clone https://github.com/yunielrc/yzsh.git && cd yzsh -make install + +for pkg in "${PKG_OPT_MANJARO_GITHUB[@]}"; do + ( + git clone "https://github.com/${pkg}.git" && cd "${pkg#*/}" + make install + ) +done diff --git a/tools/install-opt-ubuntu b/tools/install-opt-ubuntu index 7a63ce5..bdc56f3 100755 --- a/tools/install-opt-ubuntu +++ b/tools/install-opt-ubuntu @@ -16,16 +16,13 @@ export DEBIAN_FRONTEND=noninteractive sudo -E apt-get update -y && sudo -E apt-get upgrade -y -# Install flatpak -sudo -E add-apt-repository ppa:flatpak/stable -y && - sudo -E apt-get update -y && - sudo -E apt-get install flatpak -y && - sudo -H flatpak remote-add --if-not-exists \ - flathub https://dl.flathub.org/repo/flathub.flatpakrepo +# Add apt repositories -# Install docker +## Add flatpak repo +sudo -E add-apt-repository ppa:flatpak/stable -y && + sudo -E apt-get update -y -## Add Docker's official GPG key: +## Add docker's official GPG key sudo -E apt-get update -y sudo -E apt-get install -y ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings @@ -33,17 +30,38 @@ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg -## Add the repository to Apt sources: +## Add docker repo echo \ "deb [arch=\"$(dpkg --print-architecture)\" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ \"$(. /etc/os-release && echo "$VERSION_CODENAME")\" stable" | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null sudo -E apt-get update -y -## Install -sudo -E apt-get install -y docker-ce docker-ce-cli \ - containerd.io docker-buildx-plugin docker-compose-plugin +# Install Packages + +## apt packages +sudo -E apt-get install -y "${PKG_OPT_UBUNTU_APT[@]}" + +## github packages +sudo -E apt-get install -y make git + +cd "$(mktemp -d)" +for pkg in "${PKG_OPT_MANJARO_GITHUB[@]}"; do + ( + git clone "https://github.com/${pkg}.git" && cd "${pkg#*/}" + make install + ) +done +cd - + +# Configure + +## configure flatpak +sudo -H flatpak remote-add --if-not-exists \ + flathub https://dl.flathub.org/repo/flathub.flatpakrepo + +## configure docker sudo systemctl enable docker if [[ "$IMAGE_BUILDING" == false ]]; then @@ -53,7 +71,7 @@ fi sudo groupadd docker || : sudo usermod -aG docker "$USER" -# Install YZSH +## configure YZSH if [[ -f .ydf.env ]]; then # shellcheck source=../.ydf.env @@ -66,8 +84,3 @@ if [[ -f .ydf.env ]]; then ## fi - -sudo -E apt-get install -y make git -cd "$(mktemp -d)" -git clone https://github.com/yunielrc/yzsh.git && cd yzsh -make install diff --git a/tools/list-pkgs-run-manjaro b/tools/list-pkgs-run-manjaro index 6a9183b..0a6be50 100755 --- a/tools/list-pkgs-run-manjaro +++ b/tools/list-pkgs-run-manjaro @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# List manjaro prod dependencies +# List manjaro runtime dependencies # set -eu @@ -11,4 +11,7 @@ set -eu echo "# SYSTEM: $(uname -a)" echo '# PACMAN' -pacman --color never -Q bash "${PKG_RUN_MANJARO_YAY[@]}" +pacman --color never -Q "${PKG_RUN_MANJARO_PACMAN[@]}" + +# echo '# YAY' +# pacman --color never -Q "${PKG_RUN_MANJARO_YAY[@]}" diff --git a/tools/list-pkgs-run-ubuntu b/tools/list-pkgs-run-ubuntu index bc5ced9..05b8346 100755 --- a/tools/list-pkgs-run-ubuntu +++ b/tools/list-pkgs-run-ubuntu @@ -10,7 +10,7 @@ set -eu echo "# SYSTEM: $(uname -a)" echo '# APT' -apt -qq list --installed bash "${PKG_RUN_UBUNTU_APT[@]}" 2>/dev/null | +apt -qq list --installed "${PKG_RUN_UBUNTU_APT[@]}" 2>/dev/null | sed -E 's/\/\S+//' | awk '{print $1, $2}'