Skip to content

Commit

Permalink
Added bindgen where necessary, and set up crosscompiling rust targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Dec 26, 2024
1 parent fb89848 commit 0b45473
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
- `naev-steamruntime` (Used for testing linux steam builds in the steamruntime (sniper) environment with extra dependencies installed.)
- `naev-windows` (Used to cross compile for Windows.)

### v1.11.1
- Added bindgen where necessary, and set up crosscompiling rust targets

### v1.11.0
- 'naev-macos`, `naev-steamruntime`, `naev-release`, `naev-docs`, `naev-windows`: Added rust support

Expand Down
7 changes: 6 additions & 1 deletion naev-macos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ENV OSXCROSS_MP_INC "1"
ENV APPIMAGE_EXTRACT_AND_RUN 1

# Install build tools.
RUN microdnf --nodocs --setopt=install_weak_deps=0 -y install cargo clang cmake gettext genisoimage git llvm meson ninja-build python3-pip python3-pyyaml rust unzip tar texinfo xz zlib zip && \
RUN microdnf --nodocs --setopt=install_weak_deps=0 -y install bindgen clang cmake gettext genisoimage git llvm meson ninja-build python3-pip python3-pyyaml rustup unzip tar texinfo xz zlib zip && \
microdnf clean all && \
# Need Meson >=1.2.0 for fancy wrap files.
python3 -m pip install meson --upgrade && \
Expand All @@ -113,5 +113,10 @@ RUN microdnf --nodocs --setopt=install_weak_deps=0 -y install cargo clang cmake
rmdir /opt && ln -s /usr/lib/osxcross/macports/pkgs/opt /opt && \
# Set WORKDIR when you spin up the image.
mkdir -p /tmp/naevBuild

# Install cross compilation rust toolchain
RUN rustup-init -y -t x86_64-apple-darwin -t aarch64-apple-darwin --default-toolchain stable
ENV PATH=/root/.cargo/bin:$PATH

WORKDIR /tmp/naevBuild
CMD [ "/usr/bin/macports-configure.sh", "/bin/bash" ]
2 changes: 1 addition & 1 deletion naev-steamruntime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN curl -L -O https://github.com/adah1972/libunibreak/releases/download/libunib
RUN apt-get -y install \
autoconf \
automake \
bindgen \
build-essential \
cmake \
git-core \
Expand Down Expand Up @@ -127,7 +128,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip \
command -v ffmpeg && \
ffmpeg -version


# Install Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
ENV PATH "$PATH:/root/.cargo/bin"
Expand Down
6 changes: 5 additions & 1 deletion naev-windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WORKDIR /tmp
COPY _copr:copr.fedorainfracloud.org:jackgreiner:ucrt64-libraries.repo /etc/yum.repos.d

RUN microdnf update -y && \
microdnf --nodocs --setopt=install_weak_deps=0 -y install cargo gcc gettext git meson ninja-build python3-pyyaml rust tar texinfo xz unzip zip \
microdnf --nodocs --setopt=install_weak_deps=0 -y install bindgen gcc gettext git meson ninja-build python3-pyyaml rustup tar texinfo xz unzip zip \
# Install mingw64 packages
ucrt64-gcc ucrt64-gcc-c++ ucrt64-dlfcn ucrt64-enet ucrt64-freetype ucrt64-libvorbis ucrt64-libxml2 ucrt64-libtiff \
ucrt64-openal-soft ucrt64-SDL2 ucrt64-SDL2_image ucrt64-libpng mingw32-nsis ucrt64-pcre2 ucrt64-physfs && \
Expand All @@ -23,6 +23,10 @@ RUN microdnf update -y && \
unzip OpenBLAS-0.3.28-x64-64.zip -d /usr/x86_64-w64-mingw32ucrt/sys-root/mingw && \
rm -rf OpenBLAS-0.3.28-x64-64.zip

# Install cross compilation rust toolchain
RUN rustup-init -y -t x86_64-pc-windows-gnu --default-toolchain stable
ENV PATH=/root/.cargo/bin:$PATH

# Force appimages to run in extract mode since FUSE is not available
ENV APPIMAGE_EXTRACT_AND_RUN 1

Expand Down

0 comments on commit 0b45473

Please sign in to comment.