Skip to content

Instantly share code, notes, and snippets.

@vansoest
Last active January 21, 2025 12:46
Show Gist options
  • Select an option

  • Save vansoest/8ac590c25d3fb214e6e94eb1598c2ae5 to your computer and use it in GitHub Desktop.

Select an option

Save vansoest/8ac590c25d3fb214e6e94eb1598c2ae5 to your computer and use it in GitHub Desktop.
Helper script to build specific nvidia aur versions in arch linux
#!/bin/bash
# List of packages and the date for the specific state to checkout
packages=(
"lib32-nvidia-utils-beta"
# "lib32-opencl-nvidia-beta"
"nvidia-beta-dkms"
"nvidia-settings-beta"
"nvidia-utils-beta"
# "opencl-nvidia-beta"
)
# specific_date="2024-08-21" # 560.31.02
specific_date="2024-06-27" # 555.58
# Directory to clone repositories into
base_dir="$(pwd)/aur_packages"
mkdir -p "$base_dir"
for package in "${packages[@]}"; do
echo -e "\nProcessing package: $package\n"
package_dir="$base_dir/$package"
# Step 1: Clone the AUR repository
if [ ! -d "$package_dir" ]; then
echo "Cloning repository for $package..."
git clone "https://aur.archlinux.org/$package.git" "$package_dir"
else
echo "Repository for $package already exists. Skipping clone."
fi
# Step 2: Checkout the specific date
echo "Checking out the state of $package as of $specific_date..."
cd "$package_dir"
commit_hash=$(git rev-list -n 1 --before="$specific_date 23:59:59" master)
if [ -n "$commit_hash" ]; then
git checkout "$commit_hash"
else
echo "No commits found before $specific_date for $package. Skipping checkout."
continue
fi
# Step 3: Build
echo "Building $package..."
makepkg --noconfirm -d
# Return to base directory
cd "$base_dir"
done
echo -e "\nAll packages processed."
# file **/*-560*.tar.xz
# pacman -U **/*-555*.tar.xz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment