From 9be1526cb1c7a1c3fad0685156fb7a86ff194821 Mon Sep 17 00:00:00 2001 From: Jakub Date: Sun, 26 Apr 2026 15:27:24 +0800 Subject: [PATCH 1/5] Create devcontainer for development with X11 forwarding --- .devcontainer/Dockerfile | 21 +++++++++++++++++++++ .devcontainer/devcontainer.json | 12 ++++++++++++ all.options | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..b1324b1 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,21 @@ +FROM debian:trixie +RUN apt update +RUN apt upgrade + +ENV DISPLAY=:0 + +# Install chicken +RUN apt install -y build-essential git +RUN apt install -y chicken-bin + +# Install chicken dependencies +RUN chicken-install srfi-99 srfi-1 srfi-113 srfi-69 csm srfi-78 + +# Install raylib +RUN apt install -y libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev +RUN git clone --depth 1 https://github.com/raysan5/raylib.git raylib && \ +cd raylib/src/ && \ +make PLATFORM=PLATFORM_DESKTOP && \ +make install + +RUN chicken-install raylib \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3cd4515 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "name": "Imugi Dev Container", + "build": { + "dockerfile": "Dockerfile" + }, + "runArgs": [ + "--net", "host", + "-e", "DISPLAY=:0", + "-e", "XAUTHORITY=/tmp/.Xauthority", + "-v", "${localEnv:HOME}/.Xauthority:/tmp/.Xauthority" + ] +} diff --git a/all.options b/all.options index 4efc2d9..a6db636 100644 --- a/all.options +++ b/all.options @@ -1 +1 @@ --static -L /usr/local/lib64/libraylib.a \ No newline at end of file +-static -L /usr/local/lib/libraylib.a -L -lX11 -L -lXrandr -L -lXi -L -lXcursor -L -lXinerama -L -lXext -L -lGL -L -lm -L -lpthread -L -ldl -L -lrt \ No newline at end of file -- 2.47.3 From 0a21a1403371fb785dfdc04352afaca7d5648b23 Mon Sep 17 00:00:00 2001 From: Jakub Date: Sun, 26 Apr 2026 15:55:05 +0800 Subject: [PATCH 2/5] Devcontainer and collab documentation --- COLLABORATION.org | 20 ++++++++++++++++++++ README.org | 13 ------------- 2 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 COLLABORATION.org diff --git a/COLLABORATION.org b/COLLABORATION.org new file mode 100644 index 0000000..64e444e --- /dev/null +++ b/COLLABORATION.org @@ -0,0 +1,20 @@ +#+title: Collaboration + +Imugi can be easily built without any local chicken scheme installation by using the devcontainer spec included in this repository. + +* Using the Devcontainers CLI +First, run ~npm install -g @devcontainers/cli~ to install the devcontainers CLI tool. + +This requires a working Docker installation, the steps to which can be found [[https://docs.docker.com/engine/install/][here]]. Also assign your user to the ~docker~ group to avoid having to use ~sudo~ with docker and devcontainer commands. + +Once both of the above are installed, the devcontainer can be started with ~devcontainer up --workspace-folder .~ in the repository root. This will build a Debian Trixie container including all Chicken dependencies, and also build Raylib as a static library. We prefer to build with static linking in order to make distribution less annoying. + +Once the devcontainer is running, enter it with ~devcontainer exec --workspace-folder . bash~. This will put you at the repository root. + +* Running Tests & Samples +From the ~build~ directory, run ~csm -program ~ to build a particular module, the ~./~ to run it. + +Any module defined in the ~samples~ or ~test~ directory can be run like this, either to show an example game or to run tests for a particular engine module. + + If you are running the devcontainer on an X11 Linux host, running the compiled module should forward the window to your hosts X11 display. YMMV for Wayland and non-Linux hosts. + diff --git a/README.org b/README.org index b81e1ec..c1ba429 100644 --- a/README.org +++ b/README.org @@ -184,16 +184,3 @@ Functions for evaluating the render queues. ~evaluate-render-queue~ evaluates a (create-window process: (next-frame) close-predicate: (window-should-close?)) #+end_src ~create-window~ creates a window using the window parameters described above, sets the target frames per second, then enters a loop which runs the ~process:~ function (~next-frame~ by default) on each frame, unless ~close-predicate:~ (Raylib's ~window-should-close~ function by default) returns true, in which case the window is closed. - -* Dependencies -The following Chicken dependencies are required: -- raylib -- SRFI-99 -- SRFI-113 -- SRFI-69 -- csm -- SRFI-78 - -* Running -From the ~build~ directory, run ~csm -program test.engine .. && ./test.engine~ to run engine tests. - -- 2.47.3 From d82d387f2794ca921efe4855d09ef47baa999588 Mon Sep 17 00:00:00 2001 From: Jakub Date: Sun, 26 Apr 2026 15:55:42 +0800 Subject: [PATCH 3/5] Fix the build command --- COLLABORATION.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COLLABORATION.org b/COLLABORATION.org index 64e444e..ae7ef8b 100644 --- a/COLLABORATION.org +++ b/COLLABORATION.org @@ -12,7 +12,7 @@ Once both of the above are installed, the devcontainer can be started with ~devc Once the devcontainer is running, enter it with ~devcontainer exec --workspace-folder . bash~. This will put you at the repository root. * Running Tests & Samples -From the ~build~ directory, run ~csm -program ~ to build a particular module, the ~./~ to run it. +From the ~build~ directory, run ~csm -program ..~ to build a particular module, the ~./~ to run it. Any module defined in the ~samples~ or ~test~ directory can be run like this, either to show an example game or to run tests for a particular engine module. -- 2.47.3 From a6fa07ff265ef402b50b891334f7d44a33b9efd3 Mon Sep 17 00:00:00 2001 From: Jakub Date: Sun, 26 Apr 2026 16:08:09 +0800 Subject: [PATCH 4/5] Use deps-lock for dependencies --- .devcontainer/Dockerfile | 7 ++++--- deps.lock | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 deps.lock diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b1324b1..5aaf59e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -8,8 +8,8 @@ ENV DISPLAY=:0 RUN apt install -y build-essential git RUN apt install -y chicken-bin -# Install chicken dependencies -RUN chicken-install srfi-99 srfi-1 srfi-113 srfi-69 csm srfi-78 +# Install chicken tools +RUN chicken-install beaker csm # Install raylib RUN apt install -y libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev @@ -18,4 +18,5 @@ cd raylib/src/ && \ make PLATFORM=PLATFORM_DESKTOP && \ make install -RUN chicken-install raylib \ No newline at end of file +# Install egg dependencies +RUN chicken-install -from-list deps.lock \ No newline at end of file diff --git a/deps.lock b/deps.lock new file mode 100644 index 0000000..5740b68 --- /dev/null +++ b/deps.lock @@ -0,0 +1,14 @@ +("raylib" "1.2.0") +("srfi-1" "0.5.1") +("r7rs" "1.0.12") +("srfi-69" "0.4.3") +("matchable" "1.2") +("srfi-113" "2.0.0") +("foreigners" "1.5") +("srfi-99" "1.4.5") +("srfi-14" "0.2.1") +("miscmacros" "1.0") +("srfi-78" "0.5") +("srfi-42" "1.76") +("srfi-128" "0.11") +("srfi-13" "0.3.4") -- 2.47.3 From c0f8635b0be5b206310b3fd32ae796141ad7f159 Mon Sep 17 00:00:00 2001 From: Jakub Date: Sun, 26 Apr 2026 16:09:06 +0800 Subject: [PATCH 5/5] Document .dir-locals.el and deps.lock --- COLLABORATION.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/COLLABORATION.org b/COLLABORATION.org index ae7ef8b..36a7956 100644 --- a/COLLABORATION.org +++ b/COLLABORATION.org @@ -11,6 +11,12 @@ Once both of the above are installed, the devcontainer can be started with ~devc Once the devcontainer is running, enter it with ~devcontainer exec --workspace-folder . bash~. This will put you at the repository root. +* Dependencies +The ~deps.lock~ file contains the versions of eggs used in this repository. They can be installed with ~chicken-install -from-list deps.lock~. + +* Collaborating with Emacs +The ~.dir-locals.el~ file automatically sets the Geiser Scheme implementation to Chicken, for any Scheme source file in this directory. + * Running Tests & Samples From the ~build~ directory, run ~csm -program ..~ to build a particular module, the ~./~ to run it. -- 2.47.3