diff --git a/Dockerfile b/Dockerfile index d874271d5..0d696da17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG VERSION=master # base build stage FROM ubuntu:lunar AS build0 -ARG GO=1.20.7 +ARG GO=1.20.8 ARG GO_DIST=go${GO}.linux-amd64.tar.gz ADD https://go.dev/dl/$GO_DIST ./ @@ -47,11 +47,12 @@ WORKDIR ${BUILD_PATH} # install deps RUN apt-get -q update && apt-get -q install --no-install-recommends -y \ - gcc \ + build-essential \ libopus-dev \ libsdl2-dev \ libvpx-dev \ libyuv-dev \ + libjpeg-turbo8-dev \ libx264-dev \ pkg-config \ && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index d1d837ad7..db4e23cfb 100644 --- a/README.md +++ b/README.md @@ -61,13 +61,13 @@ a better sense of performance. ``` # Ubuntu / Windows (WSL2) -apt-get install -y make gcc pkg-config libvpx-dev libx264-dev libopus-dev libsdl2-dev libyuv-dev +apt-get install -y make gcc pkg-config libvpx-dev libx264-dev libopus-dev libsdl2-dev libyuv-dev libjpeg-turbo8-dev # MacOS brew install pkg-config libvpx x264 opus sdl2 jpeg-turbo # Windows (MSYS2) -pacman -Sy --noconfirm --needed git make mingw-w64-x86_64-{gcc,pkgconf,dlfcn,libvpx,opus,x264-git,SDL2,libyuv} +pacman -Sy --noconfirm --needed git make mingw-w64-x86_64-{gcc,pkgconf,dlfcn,libvpx,opus,x264-git,SDL2,libyuv,libjpeg-turbo} ``` Because the coordinator and workers need to run simultaneously. Workers connect to the coordinator. diff --git a/pkg/config/config.yaml b/pkg/config/config.yaml index 30737b082..59a123bfa 100644 --- a/pkg/config/config.yaml +++ b/pkg/config/config.yaml @@ -1,5 +1,20 @@ # The main config file +# Note. +# Be aware that when this configuration is being overwritten +# by another configuration, any empty nested part +# in the further configurations will reset (empty out) all the values. +# For example: +# the main config second config result +# ... ... ... +# list: list: list: +# gba: gba: gba: +# lib: mgba_libretro lib: "" +# roms: [ "gba", "gbc" ] roms: [] +# ... ... +# +# So do not leave empty nested keys. + # for the compatibility purposes version: 3 diff --git a/pkg/config/emulator.go b/pkg/config/emulator.go index dda7b4865..f7d71fc36 100644 --- a/pkg/config/emulator.go +++ b/pkg/config/emulator.go @@ -60,6 +60,7 @@ type LibretroCoreConfig struct { } type CoreInfo struct { + Id string Name string AltRepo bool } @@ -101,8 +102,8 @@ func (e Emulator) GetSupportedExtensions() []string { } func (l *LibretroConfig) GetCores() (cores []CoreInfo) { - for _, core := range l.Cores.List { - cores = append(cores, CoreInfo{Name: core.Lib, AltRepo: core.AltRepo}) + for k, core := range l.Cores.List { + cores = append(cores, CoreInfo{Id: k, Name: core.Lib, AltRepo: core.AltRepo}) } return } diff --git a/pkg/encoder/yuv/libyuv/libyuv.go b/pkg/encoder/yuv/libyuv/libyuv.go index 8bde0ad89..8eba7a31b 100644 --- a/pkg/encoder/yuv/libyuv/libyuv.go +++ b/pkg/encoder/yuv/libyuv/libyuv.go @@ -3,7 +3,8 @@ package libyuv /* -#cgo !darwin LDFLAGS: -lyuv +#cgo !darwin,!st LDFLAGS: -lyuv +#cgo !darwin,st LDFLAGS: -l:libyuv.a -l:libjpeg.a -lstdc++ #cgo darwin CFLAGS: -DINCLUDE_LIBYUV_VERSION_H_ #cgo darwin LDFLAGS: -L${SRCDIR} -lstdc++ diff --git a/pkg/worker/caged/libretro/manager/http.go b/pkg/worker/caged/libretro/manager/http.go index 1f2dbc881..728261812 100644 --- a/pkg/worker/caged/libretro/manager/http.go +++ b/pkg/worker/caged/libretro/manager/http.go @@ -116,14 +116,24 @@ func (m *Manager) download(cores []config.CoreInfo) (failed []string) { if len(cores) == 0 || m.repo == nil { return } - var prime, second []string + var prime, second, fail []string for _, n := range cores { + if n.Name == "" { + fail = append(fail, n.Id) + continue + } if !n.AltRepo { prime = append(prime, n.Name) } else { second = append(second, n.Name) } } + + if len(prime) == 0 && len(second) == 0 { + m.log.Warn().Msgf("[core-dl] couldn't find info for %v cores, check the config", fail) + return + } + m.log.Info().Msgf("[core-dl] <<< download | main: %v | alt: %v", prime, second) primeFails := m.down(prime, m.repo) if len(primeFails) > 0 && m.altRepo != nil {