-
-
Save Strykar/db26343797caaeb619abfe37f05bfbc0 to your computer and use it in GitHub Desktop.
Revisions
-
michaelbeaumont revised this gist
May 24, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ aur fetch ${aur_deps[@]} for pkg in ${aur_deps[@]}; do pushd ${pkg} sudo -u nobody BUILDDIR="/tmp/build" SRCDEST="/tmp/build" aur build --no-sync pacinstall --dbsync --no-confirm --yolo ${pkg} popd done -
michaelbeaumont renamed this gist
May 24, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
michaelbeaumont revised this gist
May 24, 2024 . No changes.There are no files selected for viewing
-
michaelbeaumont created this gist
May 24, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/usr/bin/env bash set -ex PACKAGES=( neovim-git ) # All this is basically to get around makepkg calling pacman with sudo # Otherwise we could just call `aur sync` and be done with it cd /tmp pacman_deps=$(aur depends ${PACKAGES[@]} --json --all | jq -r '.[] | select(.ID == null) | .Name') pacman -S --needed --noconfirm ${pacman_deps[@]} # We install needed deps in topological order using tsort aur_deps=$(aur depends ${PACKAGES[@]} -r | tsort) aur fetch ${aur_deps[@]} for pkg in ${aur_deps[@]}; do pushd ${pkg} sudo -u nobody BUILDDIR="/tmp/build" SRCDEST="/tmp/build" aur build --no-sync pacinstall --dbsync --no-confirm --resolve-conflicts=provided ${pkg} popd done # Move what we actually need into the image cp -r --no-preserve=ownership /aur ${DESTDIR} cp --parents /etc/pacman.d/aur.conf ${DESTDIR} reflector --latest 5 --sort rate --save ${DESTDIR}/etc/pacman.d/mirrorlist This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/usr/bin/env bash set -ex # Setup pacman to read modular configs mkdir -p /etc/pacman.d echo > /etc/pacman.d/dummy.conf "# This exists just so /etc/pacman.d is never empty and we can Include = /etc/pacman.d/*.conf" echo -e "\nInclude = /etc/pacman.d/*.conf" >> /etc/pacman.conf # Configure pacman pacman-key --init pacman-key --populate # Install the aur packages we just built pacman -Sy pacinstall --dbsync \ --no-confirm \ --yolo \ $(pacman -Sql aur) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ #!/usr/bin/env bash set -e if [[ "${1}" != "build" ]]; then exit 0 fi # Setup pacman reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist pacman-key --init pacman-key --populate cd /tmp # Manually build and install aurutils sudo -u nobody git clone https://aur.archlinux.org/aurutils.git pushd aurutils ( source ./PKGBUILD pacman -S \ --needed \ --noconfirm \ "${makedepends[@]}" "${depends[@]}" "${checkdepends[@]}" ) sudo -u nobody PKGDEST="/tmp" PKGEXT=".pkg.tar" makepkg --clean --cleanbuild popd pacman -U --noconfirm /tmp/aurutils-*.pkg.tar # Add local repo reference echo > /etc/pacman.d/aur.conf " [aur] SigLevel = Optional TrustAll Server = file:///aur" echo -e "\nInclude = /etc/pacman.d/*.conf" >> /etc/pacman.conf # Create empty repository # All the arch tooling assumes we can use sudo when we can't here # so we own this repo as -u nobody and call pacman explicitly install -d /aur -o nobody sudo -u nobody tar -ca -f /aur/aur.db.tar.xz -T /dev/null sudo -u nobody ln -s /aur/aur.db.tar.xz /aur/aur.db pacman -Sy