Moved build stuff to docker

This commit is contained in:
2026-03-02 06:59:51 -06:00
parent df106e3988
commit 9ee446431b
202 changed files with 95 additions and 165 deletions

View File

@@ -1,13 +0,0 @@
#!/bin/bash
docker build -t myapp:latest -f .ci/dolphin/Dockerfile .
docker run -it -v ./:/workdir myapp:latest /bin/bash -c ' \
export PATH="$DEVKITPPC/bin:$PATH" && \
cd /workdir && \
rm -rf build-gamecube && \
mkdir -p build-gamecube && \
# cmake -S. -Bbuild-gamecube -DDUSK_TARGET_SYSTEM=gamecube -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/GameCube.cmake" && \
cmake -S. -Bbuild-gamecube -DDUSK_TARGET_SYSTEM=wii -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/Wii.cmake" && \
cd build-gamecube && \
make -j$(nproc) VERBOSE=1 && \
cp ./Dusk.dol ./boot.dol
'

View File

@@ -1,13 +0,0 @@
#!/bin/bash
docker build -t myapp:latest -f .ci/dolphin/Dockerfile .
docker run -v ./:/workdir myapp:latest /bin/bash -c ' \
export PATH="$DEVKITPPC/bin:$PATH" && \
cd /workdir && \
rm -rf build-wii && \
mkdir -p build-wii && \
cmake -S. -Bbuild-wii -DDUSK_TARGET_SYSTEM=wii -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/Wii.cmake" && \
cd build-wii && \
make -j$(nproc) VERBOSE=1 && \
mv ./Dusk.dol ./boot.dol
'
# docker run -it -v ./:/workdir myapp:latest /bin/bash

View File

@@ -67,7 +67,7 @@ if(ENABLE_TESTS)
)
else()
set(DUSK_LIBRARY_TARGET_NAME "${DUSK_BINARY_TARGET_NAME}" CACHE INTERNAL ${DUSK_CACHE_TARGET})
add_executable(${DUSK_BINARY_TARGET_NAME} ${DUSK_SOURCES_DIR}/dusk/null.c)
add_executable(${DUSK_BINARY_TARGET_NAME} ${DUSK_SOURCES_DIR}/null.c)
endif()
# Toolchains

View File

@@ -1,74 +0,0 @@
# Copyright (c) 2025 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
if(NOT cglm_FOUND)
find_package(cglm REQUIRED)
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC cglm)
endif()
if(NOT libzip_FOUND)
find_package(libzip REQUIRED)
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC zip)
endif()
if(NOT Lua_FOUND)
find_package(Lua REQUIRED)
if(Lua_FOUND AND NOT TARGET Lua::Lua)
add_library(Lua::Lua INTERFACE IMPORTED)
set_target_properties(
Lua::Lua
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}"
)
endif()
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC Lua::Lua)
endif()
# Libs
# Includes
target_include_directories(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR}
)
# Sources
# Main Binary Source
target_sources(${DUSK_BINARY_TARGET_NAME}
PUBLIC
main.c
)
# Defs
dusk_env_to_h(duskdefs.env duskdefs.h)
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
DUSK_TARGET_SYSTEM="${DUSK_TARGET_SYSTEM}"
)
# Subdirs
add_subdirectory(assert)
add_subdirectory(asset)
add_subdirectory(debug)
add_subdirectory(display)
add_subdirectory(engine)
add_subdirectory(error)
add_subdirectory(event)
add_subdirectory(input)
add_subdirectory(item)
add_subdirectory(locale)
add_subdirectory(map)
add_subdirectory(scene)
add_subdirectory(script)
add_subdirectory(story)
add_subdirectory(time)
add_subdirectory(ui)
add_subdirectory(util)
if(DUSK_TARGET_SYSTEM STREQUAL "linux" OR DUSK_TARGET_SYSTEM STREQUAL "psp")
add_subdirectory(thread)
endif()

View File

@@ -4,10 +4,10 @@
# https://opensource.org/licenses/MIT
include(FetchContent)
FetchContent_Declare(
cglm
GIT_REPOSITORY https://git.wish.moe/YourWishes/cglm.git
# GIT_REPOSITORY https://git.wish.moe/YourWishes/cglm.git
GIT_REPOSITORY https://github.com/recp/cglm.git
GIT_TAG v0.9.6
)

View File

@@ -1,5 +1,7 @@
# Find link platform-specific libraries
find_package(SDL2 REQUIRED)
find_package(OpenGL REQUIRED)
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
SDL2
pthread
@@ -7,3 +9,5 @@ target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
GL
m
)
# TEST

View File

@@ -0,0 +1 @@
include(./dolphin.cmake)

View File

@@ -1,5 +1,6 @@
FROM devkitpro/devkitppc
WORKDIR /workdir
RUN apt update && \
apt install -y python3 python3-pip python3-polib python3-pil python3-dotenv python3-pyqt5 python3-opengl && \
dkp-pacman -S --needed --noconfirm gamecube-sdl2 ppc-liblzma ppc-libzip
VOLUME ["/workdir"]

View File

@@ -1,3 +1,3 @@
#!/bin/bash
docker build -t dusk-dolphin -f docker/dolphin/Dockerfile .
docker run --rm -v $(pwd):/workdir dusk-dolphin ls
docker run --rm -v $(pwd):/workdir dusk-dolphin /bin/bash -c "./scripts/build-gamecube.sh"

View File

@@ -5,6 +5,6 @@ if [ -z "$DEVKITPRO" ]; then
fi
mkdir -p build-gamecube
cmake -S. -Bbuild-gamecube -DDUSK_TARGET_SYSTEM=gamcube -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/GameCube.cmake"
cmake -S. -Bbuild-gamecube -DDUSK_TARGET_SYSTEM=gamecube -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/GameCube.cmake"
cd build-gamecube
make -j$(nproc) VERBOSE=1

3
scripts/build-wii-docker.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
docker build -t dusk-dolphin -f docker/dolphin/Dockerfile .
docker run --rm -v $(pwd):/workdir dusk-dolphin /bin/bash -c "./scripts/build-wii.sh"

View File

@@ -1,6 +1,71 @@
# Copyright (c) 2026 Dominic Masters
# Copyright (c) 2025 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
add_subdirectory(dusk)
# Required Libraries
if(NOT cglm_FOUND)
find_package(cglm REQUIRED)
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC cglm)
endif()
if(NOT libzip_FOUND)
find_package(libzip REQUIRED)
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC zip)
endif()
if(NOT Lua_FOUND)
find_package(Lua REQUIRED)
if(Lua_FOUND AND NOT TARGET Lua::Lua)
add_library(Lua::Lua INTERFACE IMPORTED)
set_target_properties(
Lua::Lua
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}"
)
endif()
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC Lua::Lua)
endif()
# Includes
target_include_directories(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR}
)
# Main Binary Source
target_sources(${DUSK_BINARY_TARGET_NAME}
PUBLIC
main.c
)
# Defs
dusk_env_to_h(duskdefs.env duskdefs.h)
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
DUSK_TARGET_SYSTEM="${DUSK_TARGET_SYSTEM}"
)
# Subdirs
add_subdirectory(assert)
add_subdirectory(asset)
add_subdirectory(debug)
add_subdirectory(display)
add_subdirectory(engine)
add_subdirectory(error)
add_subdirectory(event)
add_subdirectory(input)
add_subdirectory(item)
add_subdirectory(locale)
add_subdirectory(map)
add_subdirectory(scene)
add_subdirectory(script)
add_subdirectory(story)
add_subdirectory(time)
add_subdirectory(ui)
add_subdirectory(util)
# if(DUSK_TARGET_SYSTEM STREQUAL "linux" OR DUSK_TARGET_SYSTEM STREQUAL "psp")
# add_subdirectory(thread)
# endif()

View File

@@ -28,7 +28,7 @@ void paletteInit(
memoryZero(palette, sizeof(palette_t));
palette->colorCount = colorCount;
memoryCopy(colors, palette->colors, colorCount * sizeof(color_t));
memoryCopy(palette->colors, colors, colorCount * sizeof(color_t));
}
void paletteBind(palette_t *palette, const uint8_t slot) {

View File

@@ -1,28 +0,0 @@
# Copyright (c) 2025 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Libs
# Includes
target_include_directories(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR}
)
# Sources
# Main Binary Source
target_sources(${DUSK_BINARY_TARGET_NAME}
PUBLIC
main.c
)
# Defs
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
DUSK_TARGET_SYSTEM="${DUSK_TARGET_SYSTEM}"
)
# Subdirs

View File

@@ -1,13 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include <stdio.h>
int main() {
printf("Hello, Dusk!\n");
return 0;
}

View File

@@ -1,12 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
// NULL (Empty source) file for allowing CMake to not complain about missing
// a source file early on during the build.
static void nullFunction(void) {
}

Some files were not shown because too many files have changed in this diff Show More