Skip to content

Commit d93c8f7

Browse files
committed
Add support for arm64
# Conflicts: # contrib/build.Dockerfile # contrib/build_bin.sh
1 parent 5a1beaf commit d93c8f7

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

contrib/build_bin.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
set -ex
66

7+
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
8+
79
eval "$(pyenv init --path)"
810
eval "$(pyenv virtualenv-init -)"
911
pip install -U pip
@@ -12,7 +14,7 @@ pip install poetry
1214
gui_support="${1:---with-gui}";
1315

1416
# Setup poetry and install the dependencies
15-
if [[ $gui_support == "--with-gui" ]]; then
17+
if [[ $gui_support == "--with-gui" && $ARCH == "x86_64" ]]; then
1618
poetry install -E qt
1719
else
1820
poetry install
@@ -26,7 +28,7 @@ TZ=UTC find ${lib_dir} -name '*.py' -type f -execdir touch -t "201901010000.00"
2628
export PYTHONHASHSEED=42
2729
poetry run pyinstaller hwi.spec
2830

29-
if [[ $gui_support == "--with-gui" ]]; then
31+
if [[ $gui_support == "--with-gui" && $ARCH == "x86_64" ]]; then
3032
poetry run contrib/generate-ui.sh
3133
poetry run pyinstaller hwi-qt.spec
3234
fi
@@ -40,7 +42,7 @@ OS=`uname | tr '[:upper:]' '[:lower:]'`
4042
if [[ $OS == "darwin" ]]; then
4143
OS="mac"
4244
fi
43-
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
45+
4446
target_tarfile="hwi-${VERSION}-${OS}-${ARCH}.tar.gz"
4547

4648
if [[ $gui_support == "--with-gui" ]]; then
@@ -54,7 +56,7 @@ target_dir="$target_tarfile.dir"
5456
mkdir $target_dir
5557
mv hwi $target_dir
5658

57-
if [[ $gui_support == "--with-gui" ]]; then
59+
if [[ $gui_support == "--with-gui" && $arch == "x86_64" ]]; then
5860
mv hwi-qt $target_dir
5961
fi
6062

hwi.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_libusb_path():
1313
prefix = proc.communicate()[0].rstrip().decode()
1414
return os.path.join(prefix, "lib", "libusb-1.0.dylib")
1515
if platform.system() == "Linux":
16-
for lib_dir in ["/lib/x86_64-linux-gnu", "/usr/lib64", "/lib64" "/usr/lib", "/lib"]:
16+
for lib_dir in ["/lib/x86_64-linux-gnu", "/lib/aarch64-linux-gnu", "/usr/lib64", "/lib64" "/usr/lib", "/lib"]:
1717
libusb_path = os.path.join(lib_dir, "libusb-1.0.so.0")
1818
if os.path.exists(libusb_path):
1919
return libusb_path

0 commit comments

Comments
 (0)