Skip to content

Commit 56e541f

Browse files
committed
contrib/build_bin.sh and contrib/build_bin.sh now accepts --without-gui as their first parameters to build without the GUI support.
1 parent 36ccaf7 commit 56e541f

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
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

0 commit comments

Comments
 (0)