Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions batocera-Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
- Groovy MAME to 0.285
- Hatari to v2.6.1
- Hurrican to Jul 26, 2025 build
- Ikemen to 5th of February 2026 build
- Jazz2 to 3.5.0
- Libretro Atari800 to 4th of December 2025 build
- Libretro BlueMSX to 4th of November 2025 build
Expand Down
25 changes: 25 additions & 0 deletions package/batocera/emulators/ikemen/001-fix-gomod-beep-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Fix broken gopxl/beep/v2 pseudo-version in go.mod

Upstream references commit defe79638e99 which no longer exists in the
gopxl/beep repository. Use the actual release tag v2.1.1 instead and
remove the unnecessary replace directive.

--- a/go.mod
+++ b/go.mod
@@ -2,7 +2,6 @@

go 1.20

-replace github.com/gopxl/beep/v2 => github.com/gopxl/beep/v2 v2.1.1-0.20240921133731-defe79638e99

require (
github.com/assemblaj/ggpo v0.0.0-20241121212120-467f3782a9cf
@@ -10,7 +9,7 @@
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a
github.com/go-gl/mathgl v1.0.0
- github.com/gopxl/beep/v2 v2.1.1-0.20240921133731-defe79638e99
+ github.com/gopxl/beep/v2 v2.1.1
github.com/ikemen-engine/reisen v0.1.10-0.20250928163542-0bb3c3392852
github.com/lukegb/dds v0.0.0-20190402175749-8b7170e64003
github.com/qmuntal/gltf v0.24.2
3 changes: 2 additions & 1 deletion package/batocera/emulators/ikemen/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ config BR2_PACKAGE_IKEMEN
select BR2_PACKAGE_HOST_GO
select BR2_PACKAGE_MESA3D
select BR2_PACKAGE_LIBGTK3
select BR2_PACKAGE_OPENAL
select BR2_PACKAGE_LIBGLFW
select BR2_PACKAGE_FFMPEG
select BR2_PACKAGE_SDL2
help
A MUGEN emulator written in GoLang

Expand Down
50 changes: 35 additions & 15 deletions package/batocera/emulators/ikemen/ikemen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,49 @@
# ikemen
#
################################################################################
# Version: Commits on Aug 1, 2024
IKEMEN_VERSION = 02a078d6bf189ff56bbcbbbc8dbfd81753692c56
# Version: Commits on Feb 5, 2026
IKEMEN_VERSION = ad12c170ed79b5644fe533d3d8eb9784cd58c3e5
IKEMEN_SITE = https://github.com/ikemen-engine/Ikemen-GO
IKEMEN_LICENSE = MIT
IKEMEN_DEPENDENCIES = libgtk3 mesa3d openal libglfw
IKEMEN_DEPENDENCIES = host-go libgtk3 mesa3d libglfw ffmpeg sdl2
IKEMEN_EMULATOR_INFO = ikemen.emulator.yml

IKEMEN_SITE_METHOD = git
IKEMEN_GIT_SUBMODULES = YES

HOST_GO_COMMON_ENV = GOFLAGS=-mod=mod \
GO111MODULE=on \
GOROOT="$(HOST_GO_ROOT)" \
GOPATH="$(HOST_GO_GOPATH)" \
GOCACHE="$(HOST_GO_TARGET_CACHE)" \
GOMODCACHE="$(@D)" \
GOFLAGS="-modcacherw" \
PATH=$(BR_PATH) \
GOBIN= \
CGO_ENABLED=$(HOST_GO_CGO_ENABLED)
# kind of dirty workaround for golang-package. Upstream go.mod references
# a deleted pseudo-version (see patch 001). With generic-package, patches
# apply before configure, so fix is possible.

GO_BIN = $(HOST_DIR)/bin/go

IKEMEN_GO_MOD_ENV = \
$(HOST_GO_COMMON_ENV) \
GOFLAGS="-modcacherw" \
GOPROXY="https://proxy.golang.org,direct" \
GONOSUMCHECK="*" \
GONOSUMDB="*"

define IKEMEN_CONFIGURE_CMDS
rm -f $(@D)/go.sum
cd $(@D) && $(IKEMEN_GO_MOD_ENV) $(GO_BIN) mod tidy
cd $(@D) && $(IKEMEN_GO_MOD_ENV) $(GO_BIN) mod vendor -v
endef

define IKEMEN_BUILD_CMDS
$(HOST_GO_TARGET_ENV) $(MAKE) -C $(@D) -f Makefile Ikemen_GO_Linux
cd $(@D) && \
$(HOST_GO_TARGET_ENV) \
GOEXPERIMENT=arenas \
CGO_CFLAGS="$(TARGET_CFLAGS) \
$$($(HOST_DIR)/bin/pkg-config --cflags libavformat libavcodec libavutil libswscale libswresample libavfilter sdl2)" \
CGO_LDFLAGS="$(TARGET_LDFLAGS) \
$$($(HOST_DIR)/bin/pkg-config --libs libavformat libavcodec libavutil libswscale libswresample libavfilter sdl2) \
-lpthread -lm -ldl -lz" \
GOFLAGS="-mod=vendor -modcacherw" \
$(GO_BIN) build -trimpath -v \
-ldflags "-s -w" \
-o $(@D)/bin/Ikemen_GO_Linux \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also cater for Ikemen_GO_LinuxArm too

Copy link
Collaborator Author

@Tovarichtch Tovarichtch Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -o flag controls the output filename (not tied to the target architecture). Cross-compilation is handled by HOST_GO_TARGET_ENV which sets GOARCH. My understanding is a bit basic, but the binary is then renamed to ikemen in INSTALL_TARGET_CMDS regardless of platform. Name doesn't matter here, I could change it to anything else... iirc

I just bypass the build.sh with -o. Issue is upstream

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't build here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see the branch is development since this is work in progress it may be better to wait...

./src
endef

define IKEMEN_INSTALL_TARGET_CMDS
Expand All @@ -37,5 +57,5 @@ define IKEMEN_INSTALL_TARGET_CMDS
$(TARGET_DIR)/usr/share/evmapy
endef

$(eval $(golang-package))
$(eval $(generic-package))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why doesn't the golang package option work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream go.mod has a broken pseudo-version (deleted commit). With golang-package, Buildroot runs go mod vendor automatically during the download phase, before any patch can be applied and fails. There's no hook to fix go.mod before that. generic-package lets us patch go.mod first, then vendor manually in configure. In short, golang-package runs the go mod vendor too early

$(eval $(emulator-info-package))