Skip to content

Commit 4f3ca2f

Browse files
committed
Merge #655: --without-gui for building without GUI support
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
2 parents b194a27 + f6d246a commit 4f3ca2f

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

contrib/build_bin.sh

+24-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#! /bin/bash
22
# Script for building standalone binary releases deterministically
3+
# Usage: First script parameter can be `--without-gui` to build without UI support
34

45
set -ex
56

@@ -8,8 +9,14 @@ eval "$(pyenv virtualenv-init -)"
89
pip install -U pip
910
pip install poetry
1011

12+
gui_support="${1:---with-gui}";
13+
1114
# Setup poetry and install the dependencies
12-
poetry install -E qt
15+
if [[ $gui_support == "--with-gui" ]]; then
16+
poetry install -E qt
17+
else
18+
poetry install
19+
fi
1320

1421
# We also need to change the timestamps of all of the base library files
1522
lib_dir=`pyenv root`/versions/3.9.7/lib/python3.9
@@ -18,8 +25,12 @@ TZ=UTC find ${lib_dir} -name '*.py' -type f -execdir touch -t "201901010000.00"
1825
# Make the standalone binary
1926
export PYTHONHASHSEED=42
2027
poetry run pyinstaller hwi.spec
21-
poetry run contrib/generate-ui.sh
22-
poetry run pyinstaller hwi-qt.spec
28+
29+
if [[ $gui_support == "--with-gui" ]]; then
30+
poetry run contrib/generate-ui.sh
31+
poetry run pyinstaller hwi-qt.spec
32+
fi
33+
2334
unset PYTHONHASHSEED
2435

2536
# Make the final compressed package
@@ -30,12 +41,20 @@ if [[ $OS == "darwin" ]]; then
3041
OS="mac"
3142
fi
3243
target_tarfile="hwi-${VERSION}-${OS}-amd64.tar.gz"
33-
tar -czf $target_tarfile hwi hwi-qt
44+
45+
if [[ $gui_support == "--with-gui" ]]; then
46+
tar -czf $target_tarfile hwi hwi-qt
47+
else
48+
tar -czf $target_tarfile hwi
49+
fi
3450

3551
# Copy the binaries to subdir for shasum
3652
target_dir="$target_tarfile.dir"
3753
mkdir $target_dir
3854
mv hwi $target_dir
39-
mv hwi-qt $target_dir
55+
56+
if [[ $gui_support == "--with-gui" ]]; then
57+
mv hwi-qt $target_dir
58+
fi
4059

4160
popd

contrib/build_dist.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#! /bin/bash
22
# Script for building pypi distribution archives deterministically
3+
# Usage: First script parameter can be `--without-gui` to build without UI support
34

45
set -ex
56

@@ -8,8 +9,14 @@ eval "$(pyenv virtualenv-init -)"
89
pip install -U pip
910
pip install poetry
1011

12+
gui_support="${1:---with-gui}";
13+
1114
# Setup poetry and install the dependencies
12-
poetry install -E qt
15+
if [[ $gui_support == "--with-gui" ]]; then
16+
poetry install -E qt
17+
else
18+
poetry install
19+
fi
1320

1421
# Make the distribution archives for pypi
1522
poetry build -f wheel

docs/development/release-process.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Release Process
33

44
1. Bump version number in ``pyproject.toml`` and ``hwilib/__init__.py``, generate the setup.py file, and git tag release
55
2. Build distribution archives for PyPi with ``contrib/build_dist.sh``
6-
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.
6+
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.
77
4. For Windows, use ``contrib/build_wine.sh`` to build the Windows binary using wine
88
5. Make ``SHA256SUMS.txt`` using ``contrib/make_shasums.sh``.
99
6. Make ``SHA256SUMS.txt.asc`` using ``gpg --clearsign SHA256SUMS.txt``

0 commit comments

Comments
 (0)