diff --git a/Earthfile b/Earthfile index 5c1353cd..4c047c9e 100644 --- a/Earthfile +++ b/Earthfile @@ -2,7 +2,7 @@ VERSION 0.6 # Start with older Ubuntu to ensure GLIBC symbol versioning support for older linux # Ensure we are using an amd64 platform because some of these targets use cross-platform tooling -FROM ubuntu:16.04 +FROM ubuntu:18.04 # Install build prerequisites deps-base: @@ -12,14 +12,16 @@ deps-base: # Install Cap'n Proto deps-capnp: FROM +deps-base + COPY .capnp_version / COPY scripts/earthly/install_capnproto.sh / - RUN /bin/bash /install_capnproto.sh 1; rm /install_capnproto.sh + RUN /bin/bash /install_capnproto.sh 1; rm /install_capnproto.sh .capnp_version # Install protoc deps-protoc: FROM +deps-capnp + COPY .protoc_version / COPY scripts/earthly/install_protoc.sh / - RUN /bin/bash /install_protoc.sh; rm /install_protoc.sh + RUN /bin/bash /install_protoc.sh; rm /install_protoc.sh .protoc_version # Install Rust deps-rust: @@ -45,9 +47,6 @@ deps-rust: # Install Linux cross-platform tooling deps-cross: FROM +deps-rust - # TODO: gcc-aarch64-linux-gnu is not in the packages for ubuntu 16.04 - # RUN apt-get install -y gcc-aarch64-linux-gnu curl unzip - # RUN apt-get install -y gcc-4.8-arm64-cross RUN curl https://ziglang.org/builds/zig-linux-x86_64-0.11.0-dev.3978+711b4e93e.tar.xz | tar -C /usr/local -xJf - RUN mv /usr/local/zig-linux-x86_64-0.11.0-dev.3978+711b4e93e /usr/local/zig ENV PATH=$PATH:/usr/local/zig @@ -216,6 +215,27 @@ package-linux-arm64-deb: # save artifacts SAVE ARTIFACT --keep-ts /dpkg/out/*.deb AS LOCAL ./target/packages/ +package-linux-arm64-rpm: + FROM --platform arm64 rockylinux:8 + RUN yum install -y createrepo rpm-build rpm-sign yum-utils rpmdevtools + RUN rpmdev-setuptree + ################################# + ### RPMBUILD .RPM FILES + ################################# + RUN mkdir -p /veilid/target + COPY --dir .cargo files scripts veilid-cli veilid-core veilid-server veilid-tools veilid-flutter veilid-wasm Cargo.lock Cargo.toml package /veilid + COPY +build-linux-arm64/aarch64-unknown-linux-gnu /veilid/target/aarch64-unknown-linux-gnu + RUN mkdir -p /rpm-work-dir/veilid-server + # veilid-server + RUN veilid/package/rpm/veilid-server/earthly_make_veilid_server_rpm.sh aarch64 aarch64-unknown-linux-gnu + #SAVE ARTIFACT --keep-ts /root/rpmbuild/RPMS/aarch64/*.rpm AS LOCAL ./target/packages/ + # veilid-cli + RUN veilid/package/rpm/veilid-cli/earthly_make_veilid_cli_rpm.sh aarch64 aarch64-unknown-linux-gnu + # save artifacts + SAVE ARTIFACT --keep-ts /root/rpmbuild/RPMS/aarch64/*.rpm AS LOCAL ./target/packages/ + + + package-linux-amd64: BUILD +package-linux-amd64-deb BUILD +package-linux-amd64-rpm diff --git a/scripts/earthly/install_capnproto.sh b/scripts/earthly/install_capnproto.sh index 8bb78283..61544d6b 100755 --- a/scripts/earthly/install_capnproto.sh +++ b/scripts/earthly/install_capnproto.sh @@ -1,6 +1,10 @@ #!/bin/bash SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -CAPNPROTO_VERSION=$(cat "$SCRIPTDIR/../../.capnp_version") +if [ -f ".capnp_version" ]; then + CAPNPROTO_VERSION=$(cat ".capnp_version") +else + CAPNPROTO_VERSION=$(cat "$SCRIPTDIR/../../.capnp_version") +fi mkdir /tmp/capnproto-install pushd /tmp/capnproto-install diff --git a/scripts/earthly/install_protoc.sh b/scripts/earthly/install_protoc.sh index d2ee75ad..04cb461e 100755 --- a/scripts/earthly/install_protoc.sh +++ b/scripts/earthly/install_protoc.sh @@ -1,6 +1,10 @@ #!/bin/bash SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -PROTOC_VERSION=$(cat "$SCRIPTDIR/../../.protoc_version") +if [ -f ".protoc_version" ]; then + PROTOC_VERSION=$(cat ".protoc_version") +else + PROTOC_VERSION=$(cat "$SCRIPTDIR/../../.protoc_version") +fi UNAME_M=$(uname -m) if [[ "$UNAME_M" == "x86_64" ]]; then