Skip to content

Commit

Permalink
Merge pull request #20 from sigboe/install
Browse files Browse the repository at this point in the history
fix situation where AUR package cannot build as is from AUR, but user has the package installed
  • Loading branch information
stefanpartheym committed May 28, 2023
2 parents 429c24e + 1bf7797 commit 4ae5beb
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
#!/usr/bin/env bash
RED='\033[0;31m'
ORANGE='\033[0;33m'
NC='\033[0m'
MAKEPKG="makepkg -si --noconfirm"


error() {
printf "${RED}%s${NC} %s\n" "ERROR:" "${1}"
exit 1
}

warning() {
printf "${ORANGE}%s${NC} %s\n" "WARNING:" "${1}"
}

# Configure package manager here if necessary:
if [[ -x "$(command -v yay)" ]]; then
PKGMAN="yay -S --noconfirm"
elif [[ -x "$(command -v /bin/paru)" ]]; then
PKGMAN="paru -S --noconfirm"
else
echo "ERROR: Couldn't find a package manager, please install either yay or paru"
exit 1
error "Couldn't find a package manager, please install either yay or paru"
fi

# Configure makepkg here if necessary:
MAKEPKG="makepkg -si --noconfirm"

error() {
echo "ERROR: ${1}"
exit 1
}

build_and_install() {
echo "# Build and install package: ${1}"
pushd "${1}" || error "Not a directory: ${1}"
Expand Down Expand Up @@ -48,7 +53,7 @@ if pacman -Qq linux-hardened >/dev/null 2>/dev/null; then
fi

# General dependencies to make the webcam work:
general_dependencies="intel-ivsc-driver-dkms-git intel-ivsc-firmware icamerasrc-git gst-plugin-pipewire"
general_dependencies=( intel-ivsc-driver-dkms-git intel-ivsc-firmware icamerasrc-git gst-plugin-pipewire )

build_and_install "intel-ipu6-dkms-git"

Expand All @@ -57,7 +62,7 @@ echo "# Install dependency for intel-ipu6ep-camera-hal-git"
if eval "${PKGMAN} intel-ipu6ep-camera-bin"; then
echo "=> SUCCESS"
else
error "# Failed to install: intel-ipu6ep-camera-bin"
error " Failed to install: intel-ipu6ep-camera-bin"
fi

build_and_install "intel-ipu6ep-camera-hal-git"
Expand All @@ -66,17 +71,19 @@ build_and_install "v4l2-relayd"

# Install general dependencies
echo "# Install general dependencies"
if eval "${PKGMAN} ${general_dependencies}"; then
if eval "${PKGMAN} ${general_dependencies[*]}"; then
echo "=> SUCCESS"
elif pacman -Qq "${general_dependencies[@]}"; then
warning "Dependencies failed to update, but are already installed. Trying to continue."
else
error "Failed to install: ${general_dependencies}"
error "Failed to install: ${general_dependencies[*]}"
fi

echo "# Enable: v4l2-relayd.service"
if sudo systemctl enable v4l2-relayd.service; then
echo "=> SUCCESS"
else
error "# Failed to enable: v4l2-relayd.service"
error "Failed to enable: v4l2-relayd.service"
fi
echo "# Start: v4l2-relayd.service"
if sudo systemctl start v4l2-relayd.service; then
Expand Down

0 comments on commit 4ae5beb

Please sign in to comment.