Skip to content

Commit 535ac74

Browse files
committed
Add support for ARM64
1 parent a7da10c commit 535ac74

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/hst_autocompile.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ BUILD_DIR='/tmp/hestiacp-src'
106106
INSTALL_DIR='/usr/local/hestia'
107107
SRC_DIR="$(cd "$(dirname "$0")/.." && pwd)"
108108
ARCHIVE_DIR="$SRC_DIR/src/archive/"
109+
architecture="$(uname -m)"
110+
if [ $architecture == 'aarch64' ]; then
111+
BUILD_ARCH='arm64'
112+
else
113+
BUILD_ARCH='amd64'
114+
fi
109115
RPM_DIR="$BUILD_DIR/rpm/"
110116
DEB_DIR="$BUILD_DIR/deb/"
111117
if [ -f '/etc/redhat-release' ]; then
@@ -204,7 +210,6 @@ fi
204210

205211
echo "Build version $BUILD_VER, with Nginx version $NGINX_V and PHP version $PHP_V"
206212

207-
BUILD_ARCH='amd64'
208213
HESTIA_V="${BUILD_VER}_${BUILD_ARCH}"
209214
OPENSSL_V='1.1.1j'
210215
PCRE_V='8.44'
@@ -270,6 +275,7 @@ if [ "$HESTIA_DEBUG" ]; then
270275
echo "Hestia version : $BUILD_VER"
271276
echo "Nginx version : $NGINX_V"
272277
echo "PHP version : $PHP_V"
278+
echo "Architecture : $BUILD_ARCH"
273279
echo "Debug mode : $HESTIA_DEBUG"
274280
echo "Source directory : $SRC_DIR"
275281
fi
@@ -372,6 +378,9 @@ if [ "$NGINX_B" = true ] ; then
372378
# Get Debian package files
373379
mkdir -p $BUILD_DIR_HESTIANGINX/DEBIAN
374380
get_branch_file 'src/deb/nginx/control' "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
381+
if [ "$BUILD_ARCH" != "amd64" ]; then
382+
sed -i "s/%amd64%/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
383+
fi
375384
get_branch_file 'src/deb/nginx/copyright' "$BUILD_DIR_HESTIANGINX/DEBIAN/copyright"
376385
get_branch_file 'src/deb/nginx/postinst' "$BUILD_DIR_HESTIANGINX/DEBIAN/postinst"
377386
get_branch_file 'src/deb/nginx/postrm' "$BUILD_DIR_HESTIANGINX/DEBIAN/portrm"
@@ -502,6 +511,9 @@ if [ "$PHP_B" = true ] ; then
502511
[ "$HESTIA_DEBUG" ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
503512
mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
504513
get_branch_file 'src/deb/php/control' "$BUILD_DIR_HESTIAPHP/DEBIAN/control"
514+
if [ "$BUILD_ARCH" != "amd64" ]; then
515+
sed -i "s/%amd64%/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIAPHP/DEBIAN/control"
516+
fi
505517
get_branch_file 'src/deb/php/copyright' "$BUILD_DIR_HESTIAPHP/DEBIAN/copyright"
506518

507519
# Get custom config
@@ -595,6 +607,9 @@ if [ "$HESTIA_B" = true ]; then
595607
# Get Debian package files
596608
mkdir -p $BUILD_DIR_HESTIA/DEBIAN
597609
get_branch_file 'src/deb/hestia/control' "$BUILD_DIR_HESTIA/DEBIAN/control"
610+
if [ "$BUILD_ARCH" != "amd64" ]; then
611+
sed -i "s/%amd64%/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIA/DEBIAN/control"
612+
fi
598613
get_branch_file 'src/deb/hestia/copyright' "$BUILD_DIR_HESTIA/DEBIAN/copyright"
599614
get_branch_file 'src/deb/hestia/postinst' "$BUILD_DIR_HESTIA/DEBIAN/postinst"
600615
chmod +x $BUILD_DIR_HESTIA/DEBIAN/postinst

0 commit comments

Comments
 (0)