-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Firefox Snap armhf/arm64 cross-compilation
- Loading branch information
Alexandre
committed
Jan 24, 2024
1 parent
b8d8dbf
commit 95ad6d7
Showing
2 changed files
with
209 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
ARCH=${ARCH:-amd64} | ||
|
||
# This will create and start an instance. You are responsible for performing a | ||
# 'snap run snapcraft clean' step | ||
snap run snapcraft --build-for=${ARCH} --verbosity verbose --use-lxd | ||
rv=$? | ||
|
||
if [ "${rv}" -ne "1" ]; then | ||
echo "Happy happy person." | ||
exit 0 | ||
fi; | ||
|
||
INSTANCE=$(lxc list --project snapcraft --columns "n" --format "compact" | grep firefox-on-amd64-for-arm64) | ||
NB=$(echo ${INSTANCE} | wc -l) | ||
if [ "${NB}" -ne "1" ]; then | ||
echo "Clean instances please." | ||
exit 1; | ||
fi; | ||
|
||
lxc start --project snapcraft ${INSTANCE} | ||
|
||
lxc exec --project snapcraft ${INSTANCE} -- dpkg --add-architecture arm64 | ||
lxc exec --project snapcraft ${INSTANCE} -- sed -ri "s/^deb /deb [arch=amd64] /g" /etc/apt/sources.list | ||
lxc exec --project snapcraft ${INSTANCE} -- apt update | ||
lxc exec --project snapcraft ${INSTANCE} -- apt --fix-broken install -y | ||
lxc exec --project snapcraft ${INSTANCE} -- apt upgrade -y | ||
|
||
lxc stop --project snapcraft ${INSTANCE} | ||
|
||
snap run snapcraft --build-for=${ARCH} --verbosity verbose --use-lxd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters