mirror of https://github.com/akuker/RASCSI.git
Merge afdd3c0ae2
into dd9a3296d4
This commit is contained in:
commit
52ba6b4b01
|
@ -161,9 +161,18 @@ function installPackagesWeb() {
|
||||||
|
|
||||||
# cache the pip packages
|
# cache the pip packages
|
||||||
function cachePipPackages(){
|
function cachePipPackages(){
|
||||||
pushd $WEB_INSTALL_PATH
|
CACHEDIR="$HOME/.cache/piscsi"
|
||||||
sudo pip3 install -r ./requirements.txt
|
mkdir -p "$CACHEDIR" || exit 1
|
||||||
popd
|
# Note: these need to be installed in source form ONLY. If the binary packages are installed, the architecture
|
||||||
|
# is selected based upon the building host architecture, not the target architecture. (so, if you're building
|
||||||
|
# a PiSCSI image on x86, pip will download x86 binaries, which aren't usefull on a Raspberry Pi
|
||||||
|
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" setuptools
|
||||||
|
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" wheel
|
||||||
|
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" flit_core
|
||||||
|
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" -r $WEB_INSTALL_PATH/requirements.txt
|
||||||
|
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" -r $CTRLBOARD_INSTALL_PATH/requirements.txt
|
||||||
|
# TODO: The OLED requirements.txt includes a circuit python package that doesn't work with non-binary
|
||||||
|
# pip3 download
|
||||||
}
|
}
|
||||||
|
|
||||||
# compile the PiSCSI binaries
|
# compile the PiSCSI binaries
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
set -e
|
set -e
|
||||||
# set -x # Uncomment to Debug
|
# set -x # Uncomment to Debug
|
||||||
|
|
||||||
|
CACHEDIR="$HOME/.cache/piscsi"
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
# verify packages installed
|
# verify packages installed
|
||||||
ERROR=0
|
ERROR=0
|
||||||
|
@ -65,8 +67,9 @@ if ! test -e venv; then
|
||||||
echo "Activating venv"
|
echo "Activating venv"
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
echo "Installing requirements.txt"
|
echo "Installing requirements.txt"
|
||||||
pip3 install wheel
|
pip3 install wheel --no-index --find-links="$CACHEDIR"
|
||||||
pip3 install -r requirements.txt
|
# Reference: https://pip.pypa.io/en/latest/user_guide/#installing-from-local-packages
|
||||||
|
pip3 install -r requirements.txt --no-index --find-links="$CACHEDIR"
|
||||||
|
|
||||||
if git rev-parse --is-inside-work-tree &> /dev/null; then
|
if git rev-parse --is-inside-work-tree &> /dev/null; then
|
||||||
git rev-parse HEAD > current
|
git rev-parse HEAD > current
|
||||||
|
@ -85,7 +88,7 @@ if [[ $? -eq 0 ]]; then
|
||||||
git rev-parse > current
|
git rev-parse > current
|
||||||
elif [ "$(cat current)" != "$(git rev-parse HEAD)" ]; then
|
elif [ "$(cat current)" != "$(git rev-parse HEAD)" ]; then
|
||||||
echo "New version detected, updating libraries from requirements.txt"
|
echo "New version detected, updating libraries from requirements.txt"
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements.txt --no-index --find-links="$CACHEDIR"
|
||||||
git rev-parse HEAD > current
|
git rev-parse HEAD > current
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue