-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
make install-sysdeps
target + re-enable BSD builds (#2448)
* Add make install-sysdeps target. I want a standardized way to satisfy all system deps from a central point across all UNIX platforms. From now on CI config files should always rely on make install-sysdeps. * Rename setup-dev-env make target to install-pydeps (these are deps intended for running tests) * Re-enable BSD builds
- Loading branch information
Showing
14 changed files
with
175 additions
and
100 deletions.
There are no files selected for viewing
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
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
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
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
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,62 @@ | ||
#!/bin/sh | ||
|
||
# Depending on the UNIX platform, install the necessary system dependencies to: | ||
# * compile psutil | ||
# * run those unit tests that rely on CLI tools (netstat, ps, etc.) | ||
# NOTE: this script MUST be kept compatible with the `sh` shell. | ||
|
||
set -e | ||
|
||
UNAME_S=$(uname -s) | ||
|
||
case "$UNAME_S" in | ||
Linux) | ||
LINUX=true | ||
if command -v apt > /dev/null 2>&1; then | ||
HAS_APT=true | ||
elif command -v yum > /dev/null 2>&1; then | ||
HAS_YUM=true | ||
elif command -v apk > /dev/null 2>&1; then | ||
HAS_APK=true # musl linux | ||
fi | ||
;; | ||
FreeBSD) | ||
FREEBSD=true | ||
;; | ||
NetBSD) | ||
NETBSD=true | ||
;; | ||
OpenBSD) | ||
OPENBSD=true | ||
;; | ||
esac | ||
|
||
# Check if running as root | ||
if [ "$(id -u)" -ne 0 ]; then | ||
SUDO=sudo | ||
fi | ||
|
||
# Function to install system dependencies | ||
main() { | ||
if [ $HAS_APT ]; then | ||
$SUDO apt-get install -y python3-dev gcc | ||
$SUDO apt-get install -y net-tools coreutils util-linux # for tests | ||
elif [ $HAS_YUM ]; then | ||
$SUDO yum install -y python3-devel gcc | ||
$SUDO yum install -y net-tools coreutils util-linux # for tests | ||
elif [ $HAS_APK ]; then | ||
$SUDO apk add python3-dev gcc musl-dev linux-headers coreutils procps | ||
elif [ $FREEBSD ]; then | ||
$SUDO pkg install -y gmake python3 gcc | ||
elif [ $NETBSD ]; then | ||
$SUDO /usr/sbin/pkg_add -v pkgin | ||
$SUDO pkgin update | ||
$SUDO pkgin -y install gmake python311-* gcc12-* | ||
elif [ $OPENBSD ]; then | ||
$SUDO pkg_add gmake gcc python3 | ||
else | ||
echo "Unsupported platform: $UNAME_S" | ||
fi | ||
} | ||
|
||
main |
Oops, something went wrong.