Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5615c9d
Big rework of the kos-ports build system
pcercuei Jun 21, 2026
4199ef9
Add CI
pcercuei Jun 24, 2026
ea8cd4b
mruby: Fix build and bump version
pcercuei Jun 25, 2026
ff164b5
SDL: Install a .pc file
pcercuei Jun 26, 2026
55488ba
SDL_ttf: Discover SDL using pkg-config
pcercuei Jun 26, 2026
639e409
jimtcl: Disable building of jimsh
pcercuei Jun 26, 2026
0e82bae
micropython: Fix build and install of headers
pcercuei Jun 26, 2026
803bf69
mruby: Fix parallel build
pcercuei Jun 26, 2026
1e9e74e
libmp3: Fix parallel build
pcercuei Jun 27, 2026
bedfe4f
Inherit sysroot path from KallistiOS
pcercuei Jun 27, 2026
2ea536f
Use per-arch build directories
pcercuei Jun 27, 2026
7152aa5
Support arch-specific packages
pcercuei Jun 27, 2026
e7cdbcf
Update .gitignore
pcercuei Jun 27, 2026
2594ac7
Drop unused variables from config.mk
pcercuei Jun 27, 2026
6278044
Add clean-<pkg> and rebuild-<pkg> rules
pcercuei Jun 27, 2026
91677bb
Add error message when KOS_BASE/KOS_SYSROOT aren't defined
pcercuei Jun 27, 2026
0c8f55f
libGL: Switch to simulant repo
pcercuei Jun 27, 2026
8c17a24
Move scripts/lib.mk to top folder
pcercuei Jun 28, 2026
530d927
Use <pkg>_DOWNLOAD_URL instead of having SITE + FILE
pcercuei Jul 3, 2026
47d103f
Add git repo URLs to recipe files
pcercuei Jul 4, 2026
8fe419d
Add 'update' and 'update-<pkg>' rules
pcercuei Jul 3, 2026
6c7861b
Auto-update packages in default build rule
pcercuei Jul 7, 2026
86bf4af
Remove config.*.cache in distclean rule
pcercuei Jul 8, 2026
c1eee46
Drop override of CMAKE_INSTALL_LIBDIR, set BUILD_SHARED_LIBS=OFF
pcercuei Jul 8, 2026
7aa09c8
modplug: Fix headers install and add pkg-config .pc file
pcercuei Jul 8, 2026
ed97184
miniaudio: Build from the correct branch
pcercuei Jul 8, 2026
7c0ec8c
lftpd: Convert to recipe file
pcercuei Jul 15, 2026
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
5 changes: 5 additions & 0 deletions .github/list-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

cd `dirname $0`/..

ls -1 */recipe.mk |awk -F'/' '{gsub(/\.mk$/, "", $2); print "{\"package\":\""$1"\"}"}' | jq -R -s -c 'split("\n")[:-1]'
64 changes: 64 additions & 0 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Linux build

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
matrix:
if: github.repository == 'KallistiOS/kos-ports'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup-matrix.outputs.matrix }}

steps:
- uses: actions/checkout@v7

- name: Setup matrix
id: setup-matrix
run: |
echo "matrix=$($GITHUB_WORKSPACE/.github/list-packages.sh)" >> $GITHUB_OUTPUT

build:
needs: matrix
if: github.repository == 'KallistiOS/kos-ports'
runs-on: ubuntu-latest
container:
image: docker://pcercuei/dreamcast-toolchain:stable
strategy:
fail-fast: false
matrix:
package: ${{ fromJSON(needs.matrix.outputs.matrix) }}
env:
package: ${{ fromJSON(matrix.package).package }}

steps:
- uses: actions/checkout@v7

- uses: actions/checkout@v7
with:
repository: pcercuei/KallistiOS
ref: kos-ports-ng
path: KallistiOS

- name: add-dependencies
run: |
apk --update add cmake ruby-rake

- name: build-kallistios
run: |
ln -s $GITHUB_WORKSPACE/KallistiOS /opt/toolchains/dc/kos
ln -s $GITHUB_WORKSPACE /opt/toolchains/dc/kos-ports
. $GITHUB_WORKSPACE/KallistiOS/doc/environ.sh.sample
make -C $GITHUB_WORKSPACE/KallistiOS

- name: build-port
run: |
ln -s $GITHUB_WORKSPACE/KallistiOS /opt/toolchains/dc/kos
ln -s $GITHUB_WORKSPACE /opt/toolchains/dc/kos-ports
. $GITHUB_WORKSPACE/KallistiOS/doc/environ.sh.sample
make $package
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
.*.swp
*~
*.tmp
build-stamp
build/
dist/
include/*
lib/*
examples/*
inst
build-*
.DS_Store
./config.*
config.*.cache
171 changes: 171 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# KallistiOS ##version##
#
# KOS-ports Makefile
# Copyright (C) 2026 Paul Cercueil

$(if ${KOS_BASE},,$(error KallistiOS environment not found. Did you source environ.sh?))
$(if ${KOS_SYSROOT},,$(error KallistiOS sysroot not found. Make sure you are using v2.2.3 or newer.))

# Include the defaults
include ${KOS_PORTS}/config.mk

# Get a list of the sub-directories that contain a recipe.mk file
SUBDIRS := $(foreach each,$(wildcard ${KOS_PORTS}/*),$(if $(wildcard ${each}/recipe.mk),${each},) )
PACKAGES := $(foreach p,${SUBDIRS},$(notdir $p))

.PHONY: all stable all_nested failed clean distclean update

all: update stable

.NOTPARALLEL: all

stable:
-$(MAKE) -k -C ${KOS_PORTS} all_nested
-@$(MAKE) --no-print-directory -C ${KOS_PORTS} failed

PKG_CONFIG_ENV := PKG_CONFIG_LIBDIR=${KOS_SYSROOT}/lib/pkgconfig:${KOS_SYSROOT}/share/pkgconfig PKG_CONFIG_SYSROOT_DIR=${KOS_SYSROOT}
BUILD_ENV := CC=kos-cc RANLIB=kos-ranlib AR=kos-ar

# Include the recipes
include $(KOS_PORTS)/*/recipe.mk

$(if $(wildcard ${KOS_PORTS}/version_override.mk),$(eval include ${KOS_PORTS}/version_override.mk))

define BUILD_RULE

# Default values
${2}_MAKE_TARGET ?= install
${2}_PORT_BUILD ?= manual
${2}_REQUIRES_ABI ?= any
${2}_KOS_MAKEFILE ?= KOSMakefile.mk
${2}_FETCH_CMD ?= ${FETCH_CMD}
${2}_UNPACK_CMD ?= ${UNPACK_CMD}

${2}_DEP_STAMPS = $$(foreach dep,$${${2}_DEPENDENCIES},$(abspath ${KOS_PORTS}/$${dep}/build-${KOS_ARCH}/$${$${dep}_PORTVERSION}/.stamp_installed))
${2}_BUILD_DEPS = $${${2}_DEP_STAMPS} ${1}/.stamp_fetched ${1}/.stamp_abi_checked

${2}_DISTFILE_DIR = ${1}/${2}-$${${2}_PORTVERSION}

${2}_ARCH_SUPPORTED = $$(if $${${2}_ARCHS},$$(if $$(findstring ${KOS_ARCH},$${${2}_ARCHS}),${2}),${2})

${2}_DOWNLOAD_FILE := $(notdir ${${2}_DOWNLOAD_URL})

${1}/.stamp_abi_checked:
ifeq ($${${2}_REQUIRES_ABI},any)
@echo "${2} is compatible with any floating-point ABI."
else
@case " $${${2}_REQUIRES_ABI} " in *" $(KOS_SH4_PRECISION) "*) \
echo "${2} is compatible with the ${KOS_SH4_PRECISION} floating-point ABI."; \
;; \
*) \
echo "${2} is not compatible with the ${KOS_SH4_PRECISION} floating-point ABI!"; \
echo "Change the KOS_SH4_PRECISION setting in your environ.sh to one of the following: $${${2}_REQUIRES_ABI}"; \
echo "Then rebuild KOS and try again."; \
exit 1; \
;; \
esac
endif
touch $$@

${1}/.stamp_downloaded: ${1}/$${${2}_DOWNLOAD_FILE}
@if [ -n "$${${2}_DOWNLOAD_SHA256}" -a "$${${2}_DOWNLOAD_SHA256}" != "$$(firstword $$(shell sha256sum $$<))" ] ; then \
echo "Downloaded file $${${2}_DOWNLOAD_FILE} does not match our SHA256. Got $$(shell sha256sum $$<)" ; \
exit 1 ; \
fi ; \
touch $$@

${1}/.stamp_nodownload:
mkdir -p $${${2}_DISTFILE_DIR}
touch $$@

${1}/$${${2}_DOWNLOAD_FILE}:
mkdir -p ${1}
@echo "Fetching $${${2}_DOWNLOAD_URL} ..." ; \
(cd ${1} ; $${${2}_FETCH_CMD} "$${${2}_DOWNLOAD_URL}")

${1}/.stamp_extracted: ${1}/$${${2}_DOWNLOAD_FILE} ${1}/.stamp_downloaded
mkdir -p $${${2}_DISTFILE_DIR}
(cd $${${2}_DISTFILE_DIR} ; $${${2}_UNPACK_CMD} $$< && touch $$@)

${1}/.stamp_fetched: ${1}/.stamp_$$(if $${${2}_DOWNLOAD_URL},extracted,nodownload)
if [ -d ${KOS_PORTS}/${2}/files ] ; then \
cp ${KOS_PORTS}/${2}/files/* $${${2}_DISTFILE_DIR}/ ; \
fi
cd $${${2}_DISTFILE_DIR} ; \
for _patch in $(wildcard ${KOS_PORTS}/${2}/patches/*) ; do \
patch -p1 < $$$${_patch} ; \
done
touch $$@

${1}/.stamp_installed_autotools: $${${2}_BUILD_DEPS}
cd $${${2}_DISTFILE_DIR} ; \
${BUILD_ENV} ${PKG_CONFIG_ENV} ./configure $$(if $${${2}_CONFIGURE_NO_CACHE_FILE},,--cache-file=${KOS_PORTS}/config.${KOS_GCCVER}.cache) --prefix="" --host=${KOS_CC_PREFIX} $${${2}_CONFIGURE_ARGS} && \
DESTDIR=${KOS_SYSROOT} ${MAKE} $${${2}_MAKE_TARGET} && \
touch $$@

${1}/.stamp_installed_cmake: $${${2}_BUILD_DEPS}
mkdir -p $${${2}_DISTFILE_DIR}/build
cd $${${2}_DISTFILE_DIR}/build ; \
${BUILD_ENV} kos-cmake -DCMAKE_INSTALL_PREFIX="" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF $${${2}_CMAKE_ARGS} .. && \
DESTDIR=${KOS_SYSROOT} cmake --build . -t $${${2}_MAKE_TARGET} && \
touch $$@

${1}/.stamp_installed_manual: $${${2}_BUILD_DEPS}
${MAKE} -C $${${2}_DISTFILE_DIR} -f $${${2}_KOS_MAKEFILE} $${${2}_MAKE_TARGET} ${BUILD_ENV} $${${2}_BUILD_ENV}
mkdir -p ${KOS_SYSROOT}/lib ${KOS_SYSROOT}/include/$${${2}_HDR_INSTDIR}
for each in $${${2}_TARGET} ; do \
install -m 644 $${${2}_DISTFILE_DIR}/$$$${each} ${KOS_SYSROOT}/lib ; \
done ; \
if [ "$${${2}_HDR_DIRECTORY}" ] ; then \
cp -r $${${2}_DISTFILE_DIR}/$${${2}_HDR_DIRECTORY}/* ${KOS_SYSROOT}/include/$${${2}_HDR_INSTDIR}/ ; \
fi ; \
for each in $${${2}_INSTALLED_HDRS} ; do \
install -m 644 $${${2}_DISTFILE_DIR}/$$$${each} ${KOS_SYSROOT}/include/$${${2}_HDR_INSTDIR} ; \
done ; \
touch $$@

${1}/.stamp_installed: ${1}/.stamp_installed_$${${2}_PORT_BUILD}
touch $$@

.PHONY: ${2} clean-${2} rebuild-${2} update-${2}

${2}: $$(if $${${2}_ARCH_SUPPORTED},${1}/.stamp_installed)
$$(if $${${2}_ARCH_SUPPORTED},,@echo "${2} is not supported for this platform - skipping.")

clean-${2}:
-rm -rf ${KOS_PORTS}/${2}/build-${KOS_ARCH}

rebuild-${2}: clean-${2} ${2}

.NOTPARALLEL: rebuild-${2}

update-${2}:
$$(if ${${2}_GIT_REPO},,$$(error ${2} package is not updatable.))
$$(eval LATEST:=$$(firstword $$(shell git ls-remote ${${2}_GIT_REPO}.git $$(or ${${2}_GIT_BRANCH},HEAD))))
@echo ${2} $$(if $$(findstring ${${2}_GIT_HASH},$${LATEST}),is up to date.,updated to $${LATEST})
@if [ "${${2}_GIT_HASH}" != "$${LATEST}" ] ; then \
echo "${2}_GIT_HASH = $${LATEST}" >> ${KOS_PORTS}/version_override.mk ; \
fi

endef

$(foreach p,${PACKAGES},$(eval $(call BUILD_RULE,$(abspath ${KOS_PORTS}/${p}/build-${KOS_ARCH}/${${p}_PORTVERSION}),${p})))

# Get a list of the packages that are valid for our arch
ARCH_PACKAGES := $(foreach p,${PACKAGES},${${p}_ARCH_SUPPORTED})

# Get a list of the sub-directories that failed to build
FAILED_PACKAGES = $(sort $(foreach p,${ARCH_PACKAGES},$(if $(wildcard ${KOS_PORTS}/${p}/build-${KOS_ARCH}/${${p}_PORTVERSION}/.stamp_installed),,${p})))

all_nested: ${ARCH_PACKAGES}

failed:
@echo "Failed packages: ${FAILED_PACKAGES}"

clean: $(foreach p,${ARCH_PACKAGES},clean-${p})

distclean: clean
-rm -f ${KOS_PORTS}/version_override.mk
-rm -f ${KOS_PORTS}/config.*.cache

update: $(foreach p,${PACKAGES},$(if ${${p}_GIT_REPO},update-${p}))
20 changes: 0 additions & 20 deletions SDL/Makefile

This file was deleted.

6 changes: 6 additions & 0 deletions SDL/files/KOSMakefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.PHONY: install

install:
$(MAKE) -f Makefile.dc install
mkdir -p ${SDL_PC_PATH}
sed "s/@SDL_VERSION@/${SDL_VERSION}/" sdl.pc.in > ${SDL_PC_PATH}/sdl.pc
11 changes: 11 additions & 0 deletions SDL/files/sdl.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: SDL
Description: The SDL library
Version: @SDL_VERSION@
Libs: -L${libdir} -lSDL -lGL
Cflags: -I${includedir}/SDL
20 changes: 20 additions & 0 deletions SDL/recipe.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Port Metadata
SDL_PORTVERSION = 1.2.15

SDL_MAINTAINER = Nobody
SDL_LICENSE = LGPLv2.1
SDL_SHORT_DESC = Simple Directmedia Library

# Required for OpenGL hardware acceleration
SDL_DEPENDENCIES = libGL

# What files we need to download, and where from.
SDL_GIT_REPO = https://github.com/libsdl-org/SDL-1.2
SDL_GIT_HASH = 6648216ef09099d722623a155693fabee972380f
SDL_DOWNLOAD_URL = ${SDL_GIT_REPO}/archive/${SDL_GIT_HASH}.tar.gz

SDL_TARGET = libSDL.a
SDL_HDR_DIRECTORY = include
SDL_HDR_INSTDIR = SDL

SDL_BUILD_ENV = SDL_VERSION=${SDL_PORTVERSION} SDL_PC_PATH=${KOS_SYSROOT}/lib/pkgconfig/
31 changes: 0 additions & 31 deletions SDL_ttf/Makefile

This file was deleted.

10 changes: 0 additions & 10 deletions SDL_ttf/files/KOSMakefile.mk

This file was deleted.

13 changes: 13 additions & 0 deletions SDL_ttf/patches/without-opengl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/configure b/configure
index 009db79..6fd6526 100755
--- a/configure
+++ b/configure
@@ -13808,7 +13808,7 @@ rm -f core conftest.err conftest.$ac_objext \
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_opengl" >&5
$as_echo "$have_opengl" >&6; }
LIBS="$save_LIBS"
-if test x$have_opengl = xyes; then
+if test x$have_opengl = xopengl_is_disabled; then
CFLAGS="$CFLAGS -DHAVE_OPENGL"
GL_LIBS="$SYS_GL_LIBS"
else
16 changes: 16 additions & 0 deletions SDL_ttf/recipe.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Port Metadata
SDL_ttf_PORTVERSION = 1.2

SDL_ttf_MAINTAINER = Donald Haase
SDL_ttf_LICENSE = zlib License - http://opensource.org/licenses/Zlib
SDL_ttf_SHORT_DESC = SDL TrueType font library

SDL_ttf_DEPENDENCIES = SDL libbz2 zlib libpng freetype

SDL_ttf_PORT_BUILD = autotools

# What files we need to download, and where from.
SDL_ttf_GIT_REPO = https://github.com/libsdl-org/SDL_ttf
SDL_ttf_GIT_BRANCH = SDL-1.2
SDL_ttf_GIT_HASH = 3c4233732b94ce08d5f6a868e597af39e13f8b23
SDL_ttf_DOWNLOAD_URL = ${SDL_ttf_GIT_REPO}/archive/${SDL_ttf_GIT_HASH}.tar.gz
Loading