From 5f438ef0920a6c58c3e092a7d9dcd6fdda917dbc Mon Sep 17 00:00:00 2001 From: Kevin Mulcrone Date: Thu, 13 Jan 2022 16:41:38 -0700 Subject: [PATCH] add build scripts w/o gui --- contrib/build_bin_no_gui.sh | 38 ++++++++++++++++++++++++++++++++++++ contrib/build_dist.sh | 2 +- contrib/build_dist_no_gui.sh | 17 ++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100755 contrib/build_bin_no_gui.sh create mode 100755 contrib/build_dist_no_gui.sh diff --git a/contrib/build_bin_no_gui.sh b/contrib/build_bin_no_gui.sh new file mode 100755 index 000000000..741fa9b49 --- /dev/null +++ b/contrib/build_bin_no_gui.sh @@ -0,0 +1,38 @@ +#! /bin/bash +# Script for building standalone binary releases deterministically + +set -ex + +eval "$(pyenv init --path)" +eval "$(pyenv virtualenv-init -)" +pip install -U pip +pip install poetry + +# Setup poetry and install the dependencies +poetry install + +# We also need to change the timestamps of all of the base library files +lib_dir=`pyenv root`/versions/3.9.7/lib/python3.9 +TZ=UTC find ${lib_dir} -name '*.py' -type f -execdir touch -t "201901010000.00" '{}' \; + +# Make the standalone binary +export PYTHONHASHSEED=42 +poetry run pyinstaller hwi.spec +unset PYTHONHASHSEED + +# Make the final compressed package +pushd dist +VERSION=`poetry run hwi --version | cut -d " " -f 2` +OS=`uname | tr '[:upper:]' '[:lower:]'` +if [[ $OS == "darwin" ]]; then + OS="mac" +fi +target_tarfile="hwi-${VERSION}-${OS}-amd64.tar.gz" +tar -czf $target_tarfile hwi + +# Copy the binaries to subdir for shasum +target_dir="$target_tarfile.dir" +mkdir $target_dir +mv hwi $target_dir + +popd diff --git a/contrib/build_dist.sh b/contrib/build_dist.sh index 6edc4681f..d9afc9f0e 100755 --- a/contrib/build_dist.sh +++ b/contrib/build_dist.sh @@ -9,7 +9,7 @@ pip install -U pip pip install poetry # Setup poetry and install the dependencies -poetry install -E qt +poetry install # Make the distribution archives for pypi poetry build -f wheel diff --git a/contrib/build_dist_no_gui.sh b/contrib/build_dist_no_gui.sh new file mode 100755 index 000000000..d9afc9f0e --- /dev/null +++ b/contrib/build_dist_no_gui.sh @@ -0,0 +1,17 @@ +#! /bin/bash +# Script for building pypi distribution archives deterministically + +set -ex + +eval "$(pyenv init --path)" +eval "$(pyenv virtualenv-init -)" +pip install -U pip +pip install poetry + +# Setup poetry and install the dependencies +poetry install + +# Make the distribution archives for pypi +poetry build -f wheel +# faketime is needed to make sdist detereministic +TZ=UTC faketime -f "2019-01-01 00:00:00" poetry build -f sdist