diff --git a/kart.spec b/kart.spec index 55574879a..3f9f46392 100644 --- a/kart.spec +++ b/kart.spec @@ -118,7 +118,6 @@ pyi_analysis = Analysis( noarchive=False, ) -# Git if is_win: pyi_analysis.datas += Tree('vendor/dist/git', prefix='git') # GDAL/osgeo hook doesn't include Proj @@ -131,6 +130,9 @@ else: libexec_root = 'vendor/dist/env/libexec' pyi_analysis.datas += Tree('vendor/dist/env/share', prefix='share') +if is_linux: + pyi_analysis.binaries += [('libcrypt.so.2', '/usr/local/lib/libcrypt.so.2', 'BINARY')] + pyi_pyz = PYZ(pyi_analysis.pure, pyi_analysis.zipped_data, cipher=None) if is_win: diff --git a/platforms/Makefile b/platforms/Makefile index f61afc30c..b4c00592c 100644 --- a/platforms/Makefile +++ b/platforms/Makefile @@ -57,9 +57,8 @@ pyapp-Linux: $(SRC)/vendor/dist/vendor-Linux.tar.gz -v "$(SRC):/src" \ -w /src \ -v "$(abspath linux/.cache):/root/.cache" \ - --entrypoint "/bin/bash" \ - cdrx/pyinstaller-linux \ - -i -c '/src/platforms/linux/pyinstaller.sh $(if $(MANYLINUX_DEBUG),|| bash)' + koordinates2/manylinux2014-pyshared:x86_64 \ + bash -c '/src/platforms/linux/pyinstaller.sh $(if $(MANYLINUX_DEBUG),|| bash)' $(pyapp-Darwin): $(MAKE) pyapp-Darwin diff --git a/platforms/linux/pyinstaller.sh b/platforms/linux/pyinstaller.sh index 51155a3a3..3c2e8c401 100755 --- a/platforms/linux/pyinstaller.sh +++ b/platforms/linux/pyinstaller.sh @@ -1,18 +1,25 @@ #!/bin/bash -set -ex +set -e source /root/.bashrc -PYENV_PREFIX=$(pyenv prefix) +set -xu + +export PATH=/opt/python/cp37-cp37m-shared/bin:${PATH} + +python3 --version +python3 -m venv /venv + +export PATH=/venv/bin:${PATH} { echo ">> Configuring vendor dependencies..."; } 2> /dev/null tar xvzf vendor/dist/vendor-Linux.tar.gz -C /tmp wheelhouse rm -rf vendor/dist/env/ tar xzf vendor/dist/vendor-Linux.tar.gz -C vendor/dist/ env -tar xzf vendor/dist/vendor-Linux.tar.gz -C "$PYENV_PREFIX" --strip-components=1 env/lib/ +tar xzf vendor/dist/vendor-Linux.tar.gz -C /venv --strip-components=1 env/lib/ # get the Rtree installer working successfully -export SPATIALINDEX_C_LIBRARY="$PYENV_PREFIX/lib/libspatialindex_c.so" +export SPATIALINDEX_C_LIBRARY="/venv/lib/libspatialindex_c.so" pip install --no-deps --ignore-installed -r requirements.txt pip install --no-deps \ @@ -21,10 +28,10 @@ pip install --no-deps \ { echo ">> Downgrading PyInstaller (https://github.com/pyinstaller/pyinstaller/issues/4674) ..."; } 2> /dev/null pip install "pyinstaller==3.5.*" -python setup.py install +python3 setup.py install { echo ">> Pre-bundle Smoke Test ..."; } 2> /dev/null -pyenv exec kart --version +kart --version { echo ">> Running PyInstaller ..."; } 2> /dev/null pyinstaller \