Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .containerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*

3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
root = true

[*]
insert_final_newline = true

[*.sh]
end_of_line = lf
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.sh text eol=lf
* text=auto
158 changes: 126 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,162 @@ on:
workflow_dispatch:

jobs:
#osx-x64:
#osx-arm64:
win-x64:
runs-on: windows-2022
osx-x64:
runs-on: macos-15
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: bootstrap vcpkg
run: ./vcpkg/bootstrap-vcpkg.bat
- name: Bootstrap vcpkg
run: vcpkg/bootstrap-vcpkg.sh

- name: build vcpkg packages
run: ./windows/build-vcpkg.ps1 x64-windows win-x64
- name: Vcpkg install
run: vcpkg/vcpkg install --triplet=x64-osx

- uses: actions/upload-artifact@v3
- name: Build
run: python ./scripts/osx.py --rid osx-x64

- uses: actions/upload-artifact@v4
with:
name: win-x64
path: builds/win-x64/*.dll
name: osx-x64
path: artifacts
if-no-files-found: error

win-arm64:
runs-on: windows-2022
osx-arm64:
runs-on: macos-15
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: bootstrap vcpkg
run: ./vcpkg/bootstrap-vcpkg.bat
- name: Bootstrap vcpkg
run: vcpkg/bootstrap-vcpkg.sh

- name: Vcpkg install
run: vcpkg/vcpkg install --triplet=arm64-osx

- name: build vcpkg packages
run: ./windows/build-vcpkg.ps1 arm64-windows win-arm64
- name: Build
run: python ./scripts/osx.py --rid osx-arm64

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: win-arm64
path: builds/win-arm64/*.dll
name: osx-arm64
path: artifacts
if-no-files-found: error

linux-x64:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Build server environment
run: docker build -t build-env-server -f linux-build-env-server.Containerfile .

- name: Build client environment
run: docker build -t build-env-client -f linux-build-env-client.Containerfile .

- name: Run server build
run: docker run --rm -v ${{ github.workspace }}:/work build-env-server /work/scripts/linux-server.py

- name: Run client build
run: docker run --rm -v ${{ github.workspace }}:/work build-env-client /work/scripts/linux-from-container.sh linux-x64 x64-linux

- uses: actions/upload-artifact@v4
with:
name: linux-x64
path: artifacts
if-no-files-found: error

linux-arm64:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: bootstrap vcpkg
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Build server environment
run: docker build -t build-env-server -f linux-build-env-server.Containerfile .

- name: create build container
- name: Build client environment
run: docker build -t build-env-client -f linux-build-env-client-arm64.Containerfile .

- name: Run server build
run: docker run --rm -v ${{ github.workspace }}:/work build-env-server /work/scripts/linux-server.py

- name: Run client build
run: docker run --rm -v ${{ github.workspace }}:/work build-env-client /work/scripts/linux-from-container.sh linux-arm64 arm64-linux

- uses: actions/upload-artifact@v4
with:
name: linux-arm64
path: artifacts
if-no-files-found: error

win-x64:
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Install Deps
shell: cmd
run: choco install ninja --limit-output --no-progress

- name: Bootstrap vcpkg
run: vcpkg/bootstrap-vcpkg.bat

- name: Vcpkg install
run: vcpkg/vcpkg.exe install --triplet=x64-windows

- name: Build
shell: cmd
run: |
cd linux
./build-build-env.sh
call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\VsDevCmd.bat" -arch=x64 -host_arch=x64
python ./scripts/windows.py --rid=win-x64

- name: build vcpkg packages
- uses: actions/upload-artifact@v4
with:
name: win-x64
path: artifacts
if-no-files-found: error

win-arm64:
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Install Deps
shell: cmd
run: choco install ninja --limit-output --no-progress

- name: Bootstrap vcpkg
run: vcpkg/bootstrap-vcpkg.bat

- name: Vcpkg install
run: vcpkg/vcpkg.exe install --triplet=arm64-windows

- name: Build
shell: cmd
run: |
cd linux
./build-vcpkg.sh x64-linux-dynamic linux-x64
call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\VsDevCmd.bat" -arch=arm64 -host_arch=x64
python ./scripts/windows.py --rid=win-arm64

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: linux-x64
path: builds/linux-x64/*.so*
name: win-arm64
path: artifacts
if-no-files-found: error
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
builds/
build/
.DS_Store
artifacts
__pycache__
vcpkg_installed
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
[submodule "glfw"]
path = glfw
url = https://github.com/glfw/glfw.git
[submodule "fluidsynth"]
path = fluidsynth
url = https://github.com/FluidSynth/fluidsynth.git

[submodule "vcpkg"]
path = vcpkg
url = https://github.com/microsoft/vcpkg.git
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.typeCheckingMode": "standard"
}
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# SS14 Native-Build

A collection of submodules providing dependencies for building [Space Station 14](https://github.com/space-wizards/space-station-14) and [RobustToolbox](https://github.com/space-wizards/RobustToolbox).

Building is handled through the `Build Natives` workflow action and relies on Github's runners to perform the actual compilation.
Local building is possible by running your platform's python file under the [scripts](./scripts/) directory.

Each platform produces an zip file containing all relevant shared libs for it, any debug symbols, and a `notes.md` giving information on where and what commit the code came from.

## Building manually

You should always start by running `git submodule update --init` to initialize the source code directories.

Note that these instructions will not necessarily allow building "clean" binaries that are suitably shippable to end users. For example, Linux builds are normally ran in a container to have a clean environment.

### Windows

Ensure you have the following things installed & available in PATH:

* MSVC
* Ninja
* CMake
* Python 3

To do the build, open up a command prompt set up for compiling with MSVC (by running e.g. `x64 Native Tools Command Prompt for VS 2022`) and then run the following commands:

```
vcpkg/bootstrap-vcpkg.bat
vcpkg/vcpkg.exe install

scripts/windows.py
```

The built files will be in `artifacts/`.

### macOS

Ensure you have the following things installed & available in PATH:

* XCode
* Ninja
* CMake
* Python 3

To do the build, open up a terminal and run the following commands:

```
vcpkg/bootstrap-vcpkg.sh
vcpkg/vcpkg install

scripts/osx.py
```

The built files will be in `artifacts/`.

### Linux

Ensure you have the following things installed & available in PATH:

* A crapload of dependencies. Check the docs of the libraries we're using and keep installing `-dev` packages until it builds.
* Ninja
* CMake
* Python 3

To do the build, open up a terminal and run the following commands:

```
vcpkg/bootstrap-vcpkg.sh
vcpkg/vcpkg install

scripts/linux-server.py
scripts/linux.py
```

The built files will be in `artifacts/`.
2 changes: 1 addition & 1 deletion SDL
Submodule SDL updated 2598 files
17 changes: 0 additions & 17 deletions build_freetype_macos.ps1

This file was deleted.

1 change: 0 additions & 1 deletion fluidsynth
Submodule fluidsynth deleted from 19a20e
2 changes: 1 addition & 1 deletion freetype
Submodule freetype updated 745 files
2 changes: 1 addition & 1 deletion glfw
Submodule glfw updated 169 files
4 changes: 4 additions & 0 deletions linux-build-env-client-arm64.Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM registry.gitlab.steamos.cloud/steamrt/sniper/sdk/arm64

# Remove dubious ownership check from git
RUN git config --global --add safe.directory '*'
4 changes: 4 additions & 0 deletions linux-build-env-client.Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM registry.gitlab.steamos.cloud/steamrt/sniper/sdk

# Remove dubious ownership check from git
RUN git config --global --add safe.directory '*'
17 changes: 17 additions & 0 deletions linux-build-env-server.Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:18.04

RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc build-essential git make cmake ca-certificates curl ninja-build pkg-config

# Python setup
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends zlib1g zlib1g-dev libssl-dev libbz2-dev libsqlite3-dev
ENV HOME="/root"
WORKDIR $HOME
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
ENV PYENV_ROOT="$HOME/.pyenv"
ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"
RUN pyenv install 3.11
RUN pyenv global 3.11

# Remove dubious ownership check from git
RUN git config --global --add safe.directory '*'
1 change: 0 additions & 1 deletion linux/.gitignore

This file was deleted.

Loading