1
1
#! /bin/bash
2
2
# Script for building standalone binary releases deterministically
3
+ # Usage: First script parameter can be `--without-gui` to build without UI support
3
4
4
5
set -ex
5
6
@@ -8,8 +9,14 @@ eval "$(pyenv virtualenv-init -)"
8
9
pip install -U pip
9
10
pip install poetry
10
11
12
+ gui_support=" ${1:- --with-gui} " ;
13
+
11
14
# 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
13
20
14
21
# We also need to change the timestamps of all of the base library files
15
22
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"
18
25
# Make the standalone binary
19
26
export PYTHONHASHSEED=42
20
27
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
+
23
34
unset PYTHONHASHSEED
24
35
25
36
# Make the final compressed package
@@ -30,12 +41,20 @@ if [[ $OS == "darwin" ]]; then
30
41
OS=" mac"
31
42
fi
32
43
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
34
50
35
51
# Copy the binaries to subdir for shasum
36
52
target_dir=" $target_tarfile .dir"
37
53
mkdir $target_dir
38
54
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
40
59
41
60
popd
0 commit comments