Skip to content

Commit

Permalink
fix: linux installer arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
hiento09 committed Dec 30, 2024
1 parent 990a122 commit 184f9c2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/template-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
shell: bash
run: |
cd engine
make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" SOURCE_BINARY_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }}" SOURCE_BINARY_SERVER_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }}" VERSION=${{ inputs.new_version }} DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DESTINATION_BINARY_SERVER_NAME="${{ steps.set-output-params.outputs.destination_binary_server_name }}" DATA_FOLDER_NAME="${{ steps.set-output-params.outputs.data_folder_name }}" CONFIGURATION_FILE_NAME="${{ steps.set-output-params.outputs.configuration_file_name }}" UNINSTALLER_FILE_NAME="${{ steps.set-output-params.outputs.uninstaller_file_name }}"
make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" SOURCE_BINARY_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }}" SOURCE_BINARY_SERVER_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }}" VERSION=${{ inputs.new_version }} DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DESTINATION_BINARY_SERVER_NAME="${{ steps.set-output-params.outputs.destination_binary_server_name }}" DATA_FOLDER_NAME="${{ steps.set-output-params.outputs.data_folder_name }}" CONFIGURATION_FILE_NAME="${{ steps.set-output-params.outputs.configuration_file_name }}" UNINSTALLER_FILE_NAME="${{ steps.set-output-params.outputs.uninstaller_file_name }}" ARCH="${{ inputs.arch }}"
mv ${{ steps.set-output-params.outputs.package_name }}.deb ${{ steps.set-output-params.outputs.package_name }}-network.deb
- name: Build local Installers
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
rm -rf ${{ steps.set-output-params.outputs.package_name }}
rm ${{ steps.set-output-params.outputs.package_name }}.deb
chmod +x create_deb_local.sh
./create_deb_local.sh ${{ steps.set-output-params.outputs.package_name }} ${{ inputs.new_version }} ../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }} ../../cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }} ${{ steps.set-output-params.outputs.destination_binary_name }} ${{ steps.set-output-params.outputs.destination_binary_server_name }} ${{ steps.set-output-params.outputs.data_folder_name }} ${{ steps.set-output-params.outputs.configuration_file_name }};
./create_deb_local.sh ${{ steps.set-output-params.outputs.package_name }} ${{ inputs.new_version }} ../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }} ../../cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }} ${{ steps.set-output-params.outputs.destination_binary_name }} ${{ steps.set-output-params.outputs.destination_binary_server_name }} ${{ steps.set-output-params.outputs.data_folder_name }} ${{ steps.set-output-params.outputs.configuration_file_name }} ${{ inputs.arch }};
cp ${{ steps.set-output-params.outputs.package_name }}.deb ../../${{ steps.set-output-params.outputs.package_name }}-local.deb
- name: Package
Expand Down
3 changes: 2 additions & 1 deletion engine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DESTINATION_BINARY_SERVER_NAME ?= cortex-server
DATA_FOLDER_NAME ?= .cortex
CONFIGURATION_FILE_NAME ?= .cortexrc
UNINSTALLER_FILE_NAME ?= cortex-uninstall.sh
ARCH ?= amd64

# Default target, does nothing
all:
Expand Down Expand Up @@ -120,7 +121,7 @@ else ifeq ($(shell uname -s),Linux)
@echo "Building installer for linux"; \
cd templates/linux; \
chmod +x create_deb.sh; \
./create_deb.sh $(PACKAGE_NAME) $(VERSION) $(SOURCE_BINARY_PATH) $(SOURCE_BINARY_SERVER_PATH) $(DESTINATION_BINARY_NAME) $(DESTINATION_BINARY_SERVER_NAME) $(DATA_FOLDER_NAME) $(CONFIGURATION_FILE_NAME); \
./create_deb.sh $(PACKAGE_NAME) $(VERSION) $(SOURCE_BINARY_PATH) $(SOURCE_BINARY_SERVER_PATH) $(DESTINATION_BINARY_NAME) $(DESTINATION_BINARY_SERVER_NAME) $(DATA_FOLDER_NAME) $(CONFIGURATION_FILE_NAME) $(ARCH); \
cp $(PACKAGE_NAME).deb ../../
else
@echo "Building installer for Macos"; \
Expand Down
2 changes: 1 addition & 1 deletion engine/templates/linux/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: $PACKAGE_NAME
Version: $VERSION
Section: base
Priority: optional
Architecture: amd64
Architecture: $ARCH
Depends: openmpi-bin,libopenmpi-dev
Maintainer: Homebrew Computer Pte Ltd <[email protected]>
Description: Cortex
Expand Down
4 changes: 3 additions & 1 deletion engine/templates/linux/create_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DESTINATION_BINARY_NAME=$5
DESTINATION_BINARY_SERVER_NAME=$6
DATA_FOLDER_NAME=$7
CONFIGURATION_FILE_NAME=$8
ARCH=$9

mkdir -p $PACKAGE_NAME/DEBIAN

Expand All @@ -31,8 +32,9 @@ chmod 755 $PACKAGE_NAME/DEBIAN/postinst
chmod 755 $PACKAGE_NAME/DEBIAN/postrm
chmod 755 $PACKAGE_NAME/DEBIAN/prerm

export PACKAGE_NAME VERSION
export PACKAGE_NAME VERSION ARCH

envsubst < control > $PACKAGE_NAME/DEBIAN/control
sed -i "s/ARCH/$ARCH/" $PACKAGE_NAME/DEBIAN/control

dpkg-deb --build $PACKAGE_NAME $PACKAGE_NAME.deb
3 changes: 2 additions & 1 deletion engine/templates/linux/create_deb_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DESTINATION_BINARY_NAME=$5
DESTINATION_BINARY_SERVER_NAME=$6
DATA_FOLDER_NAME=$7
CONFIGURATION_FILE_NAME=$8
ARCH=$9

mkdir -p $PACKAGE_NAME/DEBIAN

Expand Down Expand Up @@ -34,7 +35,7 @@ chmod 755 $PACKAGE_NAME/DEBIAN/postinst
chmod 755 $PACKAGE_NAME/DEBIAN/postrm
chmod 755 $PACKAGE_NAME/DEBIAN/prerm

export PACKAGE_NAME VERSION
export PACKAGE_NAME VERSION ARCH

envsubst < control > $PACKAGE_NAME/DEBIAN/control

Expand Down

0 comments on commit 184f9c2

Please sign in to comment.