Skip to content

Commit

Permalink
Linux build instructions in BUILD.md (#531)
Browse files Browse the repository at this point in the history
Adds Linux build instructions and corresponding Docker file.
  • Loading branch information
itscynxx authored Sep 14, 2023
1 parent 07e76e3 commit a27368d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
10 changes: 10 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ The following steps will allow you to compile your own NorthstarLauncher executa

*This guide assumes you have already installed Northstar as shown in [this page](https://r2northstar.gitbook.io/r2northstar-wiki/installing-northstar/basic-setup)*

## Windows
### Steps
1. **Install Git** from [this link](https://git-scm.com)
2. **Clone** the [R2Northstar/NorthstarLauncher](https://github.com/R2Northstar/NorthstarLauncher) repo with submodules using this command `git clone --recurse-submodules https://github.com/R2Northstar/NorthstarLauncher.git`
Expand Down Expand Up @@ -39,3 +40,12 @@ Developers who can work a command line may be interested in using [Visual Studio
- Run `cmake . -G "Ninja"` to generate build files.

- Run `cmake --build .` to build the project.

## Linux
### Steps
1. Clone the GitHub repo
2. Use `cd` to navigate to the cloned repo's directory
3. Then, run the following commands in order:
* `docker build --rm -t northstar-build-fedora .`
* `docker run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build northstar-build-fedora cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows -G "Ninja"`
* `docker run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build northstar-build-fedora cmake --build .`
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM registry.fedoraproject.org/fedora-toolbox:38
RUN dnf update -y && \
dnf install -y \
git \
wine \
wine-mono \
python3 \
msitools \
python3-simplejson \
python3-six \
cmake \
ninja-build \
make \
samba \
libunwind && \
dnf clean all && \
mkdir /opt/msvc/ /build

RUN git config --global --add safe.directory /build
RUN git clone https://github.com/mstorsjo/msvc-wine && \
./msvc-wine/vsdownload.py --accept-license --dest /opt/msvc/ && \
./msvc-wine/install.sh /opt/msvc/ && \
rm -rf ~/.wine ./msvc-wine/ && \
git config --global --add safe.directory '/build'
ENV PATH="/opt/msvc/bin/x64:${PATH}"
WORKDIR /build/

0 comments on commit a27368d

Please sign in to comment.