Skip to content

Commit f0315a6

Browse files
committed
2 parents 38b4b7a + ded99e2 commit f0315a6

4 files changed

Lines changed: 109 additions & 1 deletion

File tree

.dockerignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.builds/
2+
.pytest_cache/
3+
.vscode/
4+
Builds/
5+
build/
6+
builds/
7+
node_modules/
8+
public/
9+
venv/
10+
venv*/
11+
12+
*.aps
13+
*.dmg
14+
*.exe
15+
*.msi
16+
Screenshot*.png
17+
youtube-screenshot.PNG
18+
*.tar.gz
19+
*.zip
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: Arch Linux Docker Build
4+
5+
on:
6+
push:
7+
pull_request:
8+
9+
jobs:
10+
build-archlinux-docker:
11+
runs-on: ubuntu-24.04
12+
timeout-minutes: 90
13+
steps:
14+
- name: Checkout repository with tags and submodules
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
submodules: recursive
19+
20+
- name: Build Arch Linux Docker image
21+
run: docker build --pull -f docker/archlinux/Dockerfile -t knobkraft-orm-arch .
22+
23+
- name: Verify executable can be copied from the image
24+
run: |
25+
container_id=$(docker create knobkraft-orm-arch)
26+
docker cp "$container_id:/KnobKraft-orm/builds/The-Orm/KnobKraftOrm" ./KnobKraftOrm-arch
27+
docker rm "$container_id"
28+
test -s ./KnobKraftOrm-arch

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ This will produce the executable in the path `builds\The-Orm\Release`, namely a
179179

180180
## Building on Linux
181181

182-
See the azure-pipelines.yml file for some hints how the Ubuntu server is doing it. Mainly, you need to install a long list of prerequisites and development libraries:
182+
See the GitHub Actions workflow files for some hints how the Ubuntu server is doing it. Mainly, you need to install a long list of prerequisites and development libraries:
183183

184184
sudo apt-get -y update && sudo apt-get install -y libcurl4-openssl-dev pkg-config libtbb-dev libasound2-dev libboost-dev libgtk-3-dev libwebkit2gtk-4.0-dev libglew-dev libjack-dev libicu-dev libpython3-all-dev
185185

@@ -192,6 +192,25 @@ This will produce a single executable `builds/The-Orm/KnobKraftOrm` that you can
192192

193193
The LDFLAGS is required for a certain combination of gcc version/pybind11, else you will run into internal compiler errors. See issue #6 for a discussion.
194194

195+
## Building on Arch Linux with Docker
196+
197+
If you are running Arch Linux (or an Arch derivative) and the release binary fails due to library mismatches, you can build an Arch-linked binary in Docker using `docker/archlinux/Dockerfile`. This is based on the setup contributed in issue #319.
198+
199+
Clone the repository with submodules and build the Docker image from the repository root:
200+
201+
git clone --recurse-submodules https://github.com/christofmuc/KnobKraft-orm
202+
cd KnobKraft-orm
203+
docker build -f docker/archlinux/Dockerfile -t knobkraft-orm-arch .
204+
205+
The Docker build compiles KnobKraft Orm and runs the PatchDatabase doctest binary. The resulting `KnobKraftOrm` executable is linked against Arch Linux libraries and is expected to run on Arch or Arch-derivative hosts only; for Debian, Ubuntu, Fedora, or other distributions, use the native Linux build instructions above or create a matching distro-specific Docker build instead. To copy the compiled application out of the image:
206+
207+
container_id=$(docker create knobkraft-orm-arch)
208+
docker cp "$container_id:/KnobKraft-orm/builds/The-Orm" ./The-Orm-arch
209+
docker rm "$container_id"
210+
./The-Orm-arch/KnobKraftOrm
211+
212+
The same Dockerfile is built by the `Arch Linux Docker Build` GitHub Action so the documented Arch build path is checked regularly.
213+
195214
## Building on macOS
196215

197216
If you are inclined to build on Mac, you know what you're doing. I'd recommend to install the build requisites via homebrew like this

docker/archlinux/Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM archlinux:base-devel AS dependencies
2+
3+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4+
5+
RUN pacman -Syu --noconfirm \
6+
&& pacman -S --needed --noconfirm \
7+
alsa-lib \
8+
cmake \
9+
curl \
10+
freetype2 \
11+
git \
12+
glew \
13+
gtk3 \
14+
icu \
15+
jack2 \
16+
libxext \
17+
mesa \
18+
pkgconf \
19+
python \
20+
tbb \
21+
webkit2gtk-4.1 \
22+
&& pacman -Scc --noconfirm
23+
24+
FROM dependencies AS build
25+
26+
WORKDIR /KnobKraft-orm
27+
COPY . .
28+
29+
RUN git config --global --add safe.directory /KnobKraft-orm \
30+
&& git submodule update --recursive --init --depth 1
31+
32+
RUN cmake -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=off \
33+
-DBUILD_PATCH_DATABASE_TESTS=ON \
34+
-S . \
35+
-B builds
36+
37+
RUN cmake --build builds --parallel "$(nproc)"
38+
39+
RUN cmake --build builds --target patch_database_migration_test --parallel "$(nproc)" \
40+
&& ./builds/patch_database_migration_test
41+
42+
RUN test -x builds/The-Orm/KnobKraftOrm

0 commit comments

Comments
 (0)