-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
# Determine the package manager | ||
if command -v apt-get >/dev/null 2>&1; then | ||
PACKAGE_MANAGER="apt-get" | ||
elif command -v dnf >/dev/null 2>&1; then | ||
PACKAGE_MANAGER="dnf" | ||
elif command -v yum >/dev/null 2>&1; then | ||
PACKAGE_MANAGER="yum" | ||
elif command -v zypper >/dev/null 2>&1; then | ||
PACKAGE_MANAGER="zypper" | ||
elif command -v pacman >/dev/null 2>&1; then | ||
PACKAGE_MANAGER="pacman" | ||
else | ||
echo "Unsupported package manager. Exiting." | ||
exit 1 | ||
fi | ||
|
||
# Define the package names | ||
if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then | ||
ALSA_PACKAGE="libasound2-dev" | ||
JACK_PACKAGE="libjack-jackd2-dev" | ||
elif [[ "$PACKAGE_MANAGER" == "dnf" || "$PACKAGE_MANAGER" == "yum" ]]; then | ||
ALSA_PACKAGE="alsa-lib-devel" | ||
JACK_PACKAGE="jack-audio-connection-kit-devel" | ||
elif [[ "$PACKAGE_MANAGER" == "zypper" ]]; then | ||
ALSA_PACKAGE="alsa-devel" | ||
JACK_PACKAGE="jack-devel" | ||
elif [[ "$PACKAGE_MANAGER" == "pacman" ]]; then | ||
ALSA_PACKAGE="alsa-lib" | ||
JACK_PACKAGE="jack" | ||
fi | ||
|
||
# Update package lists for the latest version of the repository | ||
if [[ "$PACKAGE_MANAGER" == "pacman" ]]; then | ||
echo "Updating package databases..." | ||
sudo pacman -Syq --noconfirm || { | ||
echo "Updating package databases failed. Exiting." | ||
exit 1 | ||
} | ||
else | ||
echo "Updating package lists..." | ||
sudo $PACKAGE_MANAGER update -yq || { | ||
echo "Updating package lists failed. Exiting." | ||
exit 1 | ||
} | ||
fi | ||
|
||
# Install necessary packages for ALSA | ||
echo "Installing ALSA development files..." | ||
sudo $PACKAGE_MANAGER install -yq $ALSA_PACKAGE || { | ||
echo "Installing ALSA development files failed. Exiting." | ||
exit 1 | ||
} | ||
|
||
# Install necessary packages for JACK | ||
echo "Installing JACK development files..." | ||
sudo $PACKAGE_MANAGER install -yq $JACK_PACKAGE || { | ||
echo "Installing JACK development files failed. Exiting." | ||
exit 1 | ||
} | ||
|
||
echo "Build environment preparation complete." |