Skip to content

Commit

Permalink
Merge #655: --without-gui for building without GUI support
Browse files Browse the repository at this point in the history
f6d246a Typo (Kiminuo)
56e541f `contrib/build_bin.sh` and `contrib/build_bin.sh` now accepts `--without-gui` as their first parameters to build without the GUI support. (Kiminuo)

Pull request description:

  Alternative to #561

  Addresses #561 (comment):

  > Instead of a new script, I would prefer if an option were just added to the existing script(s) that would disable the qt build.

ACKs for top commit:
  achow101:
    ACK f6d246a

Tree-SHA512: fbce40b6d21c3523b747439e7018153b18589e736aae717bced28e42af4c12f0104afead537683e5d9d027e64023f728d3e6803fc95cfd21b6871c4cb1984d6a
  • Loading branch information
achow101 committed Jan 3, 2023
2 parents b194a27 + f6d246a commit 4f3ca2f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
29 changes: 24 additions & 5 deletions contrib/build_bin.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /bin/bash
# Script for building standalone binary releases deterministically
# Usage: First script parameter can be `--without-gui` to build without UI support

set -ex

Expand All @@ -8,8 +9,14 @@ eval "$(pyenv virtualenv-init -)"
pip install -U pip
pip install poetry

gui_support="${1:---with-gui}";

# Setup poetry and install the dependencies
poetry install -E qt
if [[ $gui_support == "--with-gui" ]]; then
poetry install -E qt
else
poetry install
fi

# 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
Expand All @@ -18,8 +25,12 @@ 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
poetry run contrib/generate-ui.sh
poetry run pyinstaller hwi-qt.spec

if [[ $gui_support == "--with-gui" ]]; then
poetry run contrib/generate-ui.sh
poetry run pyinstaller hwi-qt.spec
fi

unset PYTHONHASHSEED

# Make the final compressed package
Expand All @@ -30,12 +41,20 @@ if [[ $OS == "darwin" ]]; then
OS="mac"
fi
target_tarfile="hwi-${VERSION}-${OS}-amd64.tar.gz"
tar -czf $target_tarfile hwi hwi-qt

if [[ $gui_support == "--with-gui" ]]; then
tar -czf $target_tarfile hwi hwi-qt
else
tar -czf $target_tarfile hwi
fi

# Copy the binaries to subdir for shasum
target_dir="$target_tarfile.dir"
mkdir $target_dir
mv hwi $target_dir
mv hwi-qt $target_dir

if [[ $gui_support == "--with-gui" ]]; then
mv hwi-qt $target_dir
fi

popd
9 changes: 8 additions & 1 deletion contrib/build_dist.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /bin/bash
# Script for building pypi distribution archives deterministically
# Usage: First script parameter can be `--without-gui` to build without UI support

set -ex

Expand All @@ -8,8 +9,14 @@ eval "$(pyenv virtualenv-init -)"
pip install -U pip
pip install poetry

gui_support="${1:---with-gui}";

# Setup poetry and install the dependencies
poetry install -E qt
if [[ $gui_support == "--with-gui" ]]; then
poetry install -E qt
else
poetry install
fi

# Make the distribution archives for pypi
poetry build -f wheel
Expand Down
2 changes: 1 addition & 1 deletion docs/development/release-process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Release Process

1. Bump version number in ``pyproject.toml`` and ``hwilib/__init__.py``, generate the setup.py file, and git tag release
2. Build distribution archives for PyPi with ``contrib/build_dist.sh``
3. For MacOS and Linux, use ``contrib/build_bin.sh``. This needs to be run on a MacOS machine for the MacOS binary and on a Linux machine for the linux one.
3. For MacOS and Linux, use ``contrib/build_bin.sh``. This needs to be run on a macOS machine for the macOS binary and on a Linux machine for the linux one.
4. For Windows, use ``contrib/build_wine.sh`` to build the Windows binary using wine
5. Make ``SHA256SUMS.txt`` using ``contrib/make_shasums.sh``.
6. Make ``SHA256SUMS.txt.asc`` using ``gpg --clearsign SHA256SUMS.txt``
Expand Down

0 comments on commit 4f3ca2f

Please sign in to comment.