Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #423

Merged
merged 3 commits into from
Oct 17, 2023
Merged

Fixes #423

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
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./
Expand Down Expand Up @@ -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/*
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 15 additions & 0 deletions pkg/config/config.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 3 additions & 2 deletions pkg/config/emulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type LibretroCoreConfig struct {
}

type CoreInfo struct {
Id string
Name string
AltRepo bool
}
Expand Down Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/encoder/yuv/libyuv/libyuv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
12 changes: 11 additions & 1 deletion pkg/worker/caged/libretro/manager/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down