Skip to content

Commit

Permalink
Build script improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
natebuckareff committed Feb 27, 2024
1 parent b6a6b1e commit 3205696
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
5 changes: 5 additions & 0 deletions build-linux-x86_64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
docker build -f ./dockerfile.linux-x86_64 --progress=plain .

id=$(docker create $(docker build -f ./dockerfile.linux-x86_64 -q .))
docker cp $id:/rust/build/vulka-linux-x86_64.zip .
5 changes: 0 additions & 5 deletions build-win-amd64.sh

This file was deleted.

5 changes: 5 additions & 0 deletions build-win-x86_64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
docker build -f ./dockerfile.win-x86_64 --progress=plain .

id=$(docker create $(docker build -f ./dockerfile.win-x86_64 -q .))
docker cp $id:/rust/build/vulka-win-x86_64.zip .
22 changes: 22 additions & 0 deletions dockerfile.linux-x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu:22.04
RUN apt update && apt -y install \
curl zip build-essential cmake git python3 pkg-config libwayland-dev

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN ~/.cargo/bin/rustup update
RUN ~/.cargo/bin/rustup target add x86_64-unknown-linux-gnu
WORKDIR /rust/build/
COPY Cargo.toml .
COPY Cargo.lock .
RUN sh -c "echo 'fn main() {}' > dummy.rs"
RUN sed -i 's#src/main.rs#dummy.rs#' Cargo.toml
RUN ~/.cargo/bin/cargo build --release --target x86_64-unknown-linux-gnu
RUN sed -i 's#dummy.rs#src/main.rs#' Cargo.toml
RUN rm ./dummy.rs
COPY . .
RUN ~/.cargo/bin/cargo build --release --target x86_64-unknown-linux-gnu

RUN cp ./target/x86_64-unknown-linux-gnu/release/vulka .

RUN zip -r vulka-linux-x86_64.zip \
./checker-map.png ./vulka
4 changes: 2 additions & 2 deletions dockerfile.win-amd64 → dockerfile.win-x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ RUN cp /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libstdc++-6.dll .
RUN cp /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libgcc_s_seh-1.dll .
RUN cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll .

RUN zip -r vulka-win-amd64.zip \
./slime_shield.png ./vulka.exe ./libstdc++-6.dll ./libgcc_s_seh-1.dll \
RUN zip -r vulka-win-x86_64.zip \
./checker-map.png ./vulka.exe ./libstdc++-6.dll ./libgcc_s_seh-1.dll \
./libwinpthread-1.dll

0 comments on commit 3205696

Please sign in to comment.