christofmuc / KnobKraft-orm

The KnobKraft Orm - The free modern cross-platform MIDI Sysex Librarian
GNU Affero General Public License v3.0
184 stars 23 forks source link

Build Linux version using Docker #319

Open christofmuc opened 2 months ago

christofmuc commented 2 months ago

This was documented by @fractalf in issue #312 , breaking it out to track status separately:

Arch linux builds (docker setup)

I'm on EndeavourOS (based on Arch Linux) and the binary you provide from your build pipeline didn't work for me due to some error on libicuuc.so

$ ./KnobKraftOrm 
./KnobKraftOrm: error while loading shared libraries: libicuuc.so.66: cannot open shared object file: No such file or directory

..so I made a docker setup to build it for Arch Linux and thought I'd share it here if you or anyone else is interested.

docker-compose.yml

version: "3.7"
services:
    knobkraft-builder:
        build:
            context: .
            dockerfile: Dockerfile-arch
        image: knobkraft-builder
        container_name: knobkraft-builder
        tty: true

Dockerfile-arch

FROM archlinux:base-20240101.0.204074
RUN pacman -Sy
RUN pacman -S --noconfirm \
    git \
    base-devel \
    cmake \
    alsa-utils \
    webkit2gtk \
    glew \
    python \
    pybind11

RUN git clone https://github.com/christofmuc/KnobKraft-orm.git
WORKDIR /KnobKraft-orm
RUN git submodule update --recursive --init --depth 1
RUN cmake -D CMAKE_INTERPROCEDURAL_OPTIMIZATION=off -S . -B builds
# "-j15" means use 15 cores when compiling. Adjust it to your own architecture
RUN cmake --build builds -- -j15

Run it like this and copy the binaries to your local ~/bin

$ docker compose up -d --build
$ docker cp knobkraft-builder:/KnobKraft-orm/builds/The-Orm ~/bin
$ ~/bin/The-Orm/KnobKraftOrm