Skip to content

Commit

Permalink
updated configuration for armv7l-linux-gnueabihf
Browse files Browse the repository at this point in the history
Signed-off-by: Cocoa <i@uwucocoa.moe>
  • Loading branch information
cocoa-xu committed Oct 10, 2024
1 parent 06401ab commit a79a6ba
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
54 changes: 53 additions & 1 deletion .github/workflows/linux-precompile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,59 @@ permissions:
contents: write

jobs:
armv7l-linux-gnueabihf:
runs-on: ubuntu-latest
env:
ARCH: armv7l
TARGET: armv7l-linux-gnueabihf
strategy:
matrix:
job:
- {otp: "27.1.1", elixir: "1.17"}
- {otp: "25.3.2.14", elixir: "1.16"}

name: Linux armv7l - OTP ${{ matrix.job.otp }} - Elixir ${{ matrix.job.elixir }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.job.otp }}
elixir-version: ${{ matrix.job.elixir }}

- name: Install system dependecies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential automake autoconf pkg-config \
bc m4 unzip zip gcc g++
- name: Install armv7l specific deps
run: sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

- name: Create precompiled ${{ env.ARCH }} library
run: |
ROOTDIR="$(pwd)"
OTP_ROOTDIR="${ROOTDIR}/.tools/otp"
mkdir -p "${OTP_ROOTDIR}"
cd "${OTP_ROOTDIR}"
curl -fSL "https://github.com/cocoa-xu/otp-build/releases/download/v${{ matrix.job.otp }}/otp-${{ env.TARGET }}.tar.gz" -o "otp-${{ env.TARGET }}.tar.gz"
tar -xzf "otp-${{ env.TARGET }}.tar.gz"
cd "${ROOTDIR}"
export PRECOMPILE_ERL_EI_INCLUDE_DIR="${OTP_ROOTDIR}/usr/local/lib/erlang/usr/include"
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix deps.get
mix elixir_make.precompile
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
cache/*${{ env.TARGET }}*.tar.gz
precompile:
runs-on: ubuntu-20.04
env:
Expand Down Expand Up @@ -44,7 +97,6 @@ jobs:
if: matrix.arch == 'x86_64'
run: |
sudo apt-get install -y gcc-i686-linux-gnu g++-i686-linux-gnu \
gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu \
gcc-s390x-linux-gnu g++-s390x-linux-gnu
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ ifneq ($(EXQLITE_SYSTEM_CFLAGS),)
endif

# Set Erlang-specific compile flags
ERL_CFLAGS ?= -I"$(ERL_EI_INCLUDE_DIR)"
ifeq ($(CC_PRECOMPILER_CURRENT_TARGET),armv7l-linux-gnueabihf)
ERL_CFLAGS ?= -I"$(PRECOMPILE_ERL_EI_INCLUDE_DIR)"
else
ERL_CFLAGS ?= -I"$(ERL_EI_INCLUDE_DIR)"
endif

ifneq ($(STATIC_ERLANG_NIF),)
CFLAGS += -DSTATIC_ERLANG_NIF=1
Expand Down

0 comments on commit a79a6ba

Please sign in to comment.