Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for arm64 on amd64 #615

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions contrib/build_bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

set -ex

ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')

eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
pip install -U pip
Expand All @@ -12,7 +14,7 @@ pip install poetry
gui_support="${1:---with-gui}";

# Setup poetry and install the dependencies
if [[ $gui_support == "--with-gui" ]]; then
if [[ $gui_support == "--with-gui" && $ARCH == "x86_64" ]]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PySide2 was not ready for arm64, I had issues with shiboken2 package (see). With #691, it might be fixed.

poetry install -E qt
else
poetry install
Expand All @@ -26,7 +28,7 @@ TZ=UTC find ${lib_dir} -name '*.py' -type f -execdir touch -t "201901010000.00"
export PYTHONHASHSEED=42
poetry run pyinstaller hwi.spec

if [[ $gui_support == "--with-gui" ]]; then
if [[ $gui_support == "--with-gui" && $ARCH == "x86_64" ]]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not run for arm64.

poetry run contrib/generate-ui.sh
poetry run pyinstaller hwi-qt.spec
fi
Expand All @@ -40,7 +42,7 @@ OS=`uname | tr '[:upper:]' '[:lower:]'`
if [[ $OS == "darwin" ]]; then
OS="mac"
fi
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moved up in this file.


target_tarfile="hwi-${VERSION}-${OS}-${ARCH}.tar.gz"

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

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

Expand Down
2 changes: 1 addition & 1 deletion hwi.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_libusb_path():
prefix = proc.communicate()[0].rstrip().decode()
return os.path.join(prefix, "lib", "libusb-1.0.dylib")
if platform.system() == "Linux":
for lib_dir in ["/lib/x86_64-linux-gnu", "/usr/lib64", "/lib64" "/usr/lib", "/lib"]:
for lib_dir in ["/lib/x86_64-linux-gnu", "/lib/aarch64-linux-gnu", "/usr/lib64", "/lib64" "/usr/lib", "/lib"]:
libusb_path = os.path.join(lib_dir, "libusb-1.0.so.0")
if os.path.exists(libusb_path):
return libusb_path
Expand Down
Loading