Skip to content

Commit 039faf0

Browse files
authored
Wayland builds (#505)
* Wayland builds * Install wayland dependency * Install libwayland-dev * Install libxkbcommon-dev * Also build x11 in the CI * Typo * Update Makefile to package x11 and wayland builds * Update CD to build for wayland * Try to run arm builds on 22.04 * Try to fix binutils installation * Generalize the fix * Fix * Attempt to fix OSX build * Revert "Attempt to fix OSX build" This reverts commit 9cdd48b. * Try to adapt the .deb * Fix arm x11 build * Remove golint here too * tag properly * Workaround for the fullscreen toggle bug on wayland
1 parent 7f6a3f5 commit 039faf0

File tree

6 files changed

+134
-20
lines changed

6 files changed

+134
-20
lines changed

.github/workflows/cd.yml

+71-10
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,67 @@ defaults:
99
shell: bash
1010

1111
jobs:
12-
build_linux:
12+
build_linux_wayland_x86_64:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
submodules: true
18+
- uses: actions/setup-go@v3
19+
with:
20+
go-version: '1.19.5'
21+
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
22+
- run: sudo apt-get update -q
23+
- run: sudo apt-get install libopenal-dev xorg-dev libgl1-mesa-dev libwayland-dev libxkbcommon-dev -y --allow-unauthenticated
24+
- run: go build -tags wayland -v
25+
- run: OS=Linux ARCH=x86_64 DISPDRIVER=wayland VERSION=$VERSION make tar
26+
- run: OS=Linux ARCH=x86_64 DISPDRIVER=wayland VERSION=$VERSION make deb
27+
- run: sha256sum Ludo-Linux-wayland-x86_64-${VERSION}.tar.gz > Ludo-Linux-wayland-x86_64-${VERSION}.tar.gz.sha256
28+
29+
- name: Upload Release Asset
30+
uses: alexellis/[email protected]
31+
env:
32+
GITHUB_TOKEN: ${{ github.token }}
33+
with:
34+
asset_paths: '["./Ludo-*.tar.gz*", "./*.deb"]'
35+
36+
build_linux_wayland_arm:
37+
runs-on: ubuntu-22.04
38+
steps:
39+
- uses: actions/checkout@v2
40+
with:
41+
submodules: true
42+
- uses: actions/setup-go@v3
43+
with:
44+
go-version: '1.19.5'
45+
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
46+
- run: sudo apt update -q
47+
- run: sudo apt install binutils-multiarch
48+
- run: sudo dpkg --add-architecture armhf
49+
- run: echo "" | sudo tee /etc/apt/sources.list
50+
- run: echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
51+
- run: echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
52+
- run: echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
53+
- run: echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
54+
- run: echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
55+
- run: echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
56+
- run: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6B05F25D762E3157
57+
- run: sudo apt update -q
58+
- run: sudo apt install -f libgl1-mesa-dev:amd64 libc6-dev:armhf gcc-arm-linux-gnueabihf libopenal-dev:armhf libgl1-mesa-dev:armhf libxcursor-dev:armhf libxrandr-dev:armhf libxinerama-dev:armhf libxi-dev:armhf libwayland-dev:armhf libxkbcommon-dev:armhf -y --allow-unauthenticated
59+
- run: export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
60+
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -tags wayland -v
61+
- run: OS=Linux ARCH=arm DISPDRIVER=wayland VERSION=$VERSION make tar
62+
- run: OS=Linux ARCH=arm DISPDRIVER=wayland VERSION=$VERSION make deb
63+
- run: sha256sum Ludo-Linux-wayland-arm-${VERSION}.tar.gz > Ludo-Linux-wayland-arm-${VERSION}.tar.gz.sha256
64+
65+
- name: Upload Release Asset
66+
uses: alexellis/[email protected]
67+
env:
68+
GITHUB_TOKEN: ${{ github.token }}
69+
with:
70+
asset_paths: '["./Ludo-*.tar.gz*", "./*.deb"]'
71+
72+
build_linux_x11_x86_64:
1373
runs-on: ubuntu-latest
1474
steps:
1575
- uses: actions/checkout@v2
@@ -21,9 +81,10 @@ jobs:
2181
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
2282
- run: sudo apt-get update -q
2383
- run: sudo apt-get install libopenal-dev xorg-dev libgl1-mesa-dev -y --allow-unauthenticated
24-
- run: OS=Linux ARCH=x86_64 VERSION=$VERSION make tar
25-
- run: OS=Linux ARCH=x86_64 VERSION=$VERSION make deb
26-
- run: sha256sum Ludo-Linux-x86_64-${VERSION}.tar.gz > Ludo-Linux-x86_64-${VERSION}.tar.gz.sha256
84+
- run: go build -tags x11 -v
85+
- run: OS=Linux ARCH=x86_64 DISPDRIVER=x11 VERSION=$VERSION make tar
86+
- run: OS=Linux ARCH=x86_64 DISPDRIVER=x11 VERSION=$VERSION make deb
87+
- run: sha256sum Ludo-Linux-x11-x86_64-${VERSION}.tar.gz > Ludo-Linux-x11-x86_64-${VERSION}.tar.gz.sha256
2788

2889
- name: Upload Release Asset
2990
uses: alexellis/[email protected]
@@ -32,7 +93,7 @@ jobs:
3293
with:
3394
asset_paths: '["./Ludo-*.tar.gz*", "./*.deb"]'
3495

35-
build_linux_arm:
96+
build_linux_x11_arm:
3697
runs-on: ubuntu-20.04
3798
steps:
3899
- uses: actions/checkout@v2
@@ -42,6 +103,7 @@ jobs:
42103
with:
43104
go-version: '1.19.5'
44105
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
106+
- run: sudo apt update -q
45107
- run: sudo apt install binutils-multiarch
46108
- run: sudo dpkg --add-architecture armhf
47109
- run: echo "" | sudo tee /etc/apt/sources.list
@@ -55,10 +117,10 @@ jobs:
55117
- run: sudo apt update -q
56118
- run: sudo apt install -f libgl1-mesa-dev:amd64 libxxf86vm-dev:armhf libc6-dev:armhf gcc-arm-linux-gnueabihf libopenal-dev:armhf libgl1-mesa-dev:armhf libxcursor-dev:armhf libxrandr-dev:armhf libxinerama-dev:armhf libxi-dev:armhf -y --allow-unauthenticated
57119
- run: export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
58-
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -v
59-
- run: OS=Linux ARCH=arm VERSION=$VERSION make tar
60-
- run: OS=Linux ARCH=arm VERSION=$VERSION make deb
61-
- run: sha256sum Ludo-Linux-arm-${VERSION}.tar.gz > Ludo-Linux-arm-${VERSION}.tar.gz.sha256
120+
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -tags x11 -v
121+
- run: OS=Linux ARCH=arm DISPDRIVER=x11 VERSION=$VERSION make tar
122+
- run: OS=Linux ARCH=arm DISPDRIVER=x11 VERSION=$VERSION make deb
123+
- run: sha256sum Ludo-Linux-x11-arm-${VERSION}.tar.gz > Ludo-Linux-x11-arm-${VERSION}.tar.gz.sha256
62124

63125
- name: Upload Release Asset
64126
uses: alexellis/[email protected]
@@ -78,7 +140,6 @@ jobs:
78140
go-version: '1.19.5'
79141
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
80142
- run: echo "/Users/runner/go/bin" >> $GITHUB_PATH
81-
- run: go install golang.org/x/lint/golint@latest
82143
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
83144
- run: brew install openal-soft
84145
- run: echo ${{ secrets.OSXCERT }} | base64 --decode > dev.p12

.github/workflows/ci.yml

+50-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defaults:
1111
shell: bash
1212

1313
jobs:
14-
build_linux:
14+
build_linux_wayland_x86_64:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v2
@@ -23,14 +23,14 @@ jobs:
2323
- run: echo "/home/runner/go/bin" >> $GITHUB_PATH
2424
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
2525
- run: sudo apt-get update -q
26-
- run: sudo apt-get install libopenal-dev xorg-dev libgl1-mesa-dev -y --allow-unauthenticated
26+
- run: sudo apt-get install libopenal-dev xorg-dev libgl1-mesa-dev libwayland-dev libxkbcommon-dev -y --allow-unauthenticated
2727
- run: go get .
2828
- run: xvfb-run -a go test -v -race ./...
2929
- run: go vet ./...
3030
- run: staticcheck ./...
31-
- run: go build -v
31+
- run: go build -tags wayland -v
3232

33-
build_linux_arm:
33+
build_linux_wayland_arm:
3434
runs-on: ubuntu-20.04
3535
steps:
3636
- uses: actions/checkout@v2
@@ -39,6 +39,51 @@ jobs:
3939
- uses: actions/setup-go@v3
4040
with:
4141
go-version: '1.19.5'
42+
- run: sudo apt update -q
43+
- run: sudo apt install binutils-multiarch
44+
- run: sudo dpkg --add-architecture armhf
45+
- run: echo "" | sudo tee /etc/apt/sources.list
46+
- run: echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
47+
- run: echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
48+
- run: echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
49+
- run: echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
50+
- run: echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
51+
- run: echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
52+
- run: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6B05F25D762E3157
53+
- run: sudo apt update -q
54+
- run: sudo apt install -f libgl1-mesa-dev:amd64 libc6-dev:armhf gcc-arm-linux-gnueabihf libopenal-dev:armhf libgl1-mesa-dev:armhf libxcursor-dev:armhf libxrandr-dev:armhf libxinerama-dev:armhf libxi-dev:armhf libwayland-dev:armhf libxkbcommon-dev:armhf -y --allow-unauthenticated
55+
- run: export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
56+
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -tags wayland -v
57+
58+
build_linux_x11_x86_64:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v2
62+
with:
63+
submodules: true
64+
- uses: actions/setup-go@v3
65+
with:
66+
go-version: '1.19.5'
67+
- run: echo "/home/runner/go/bin" >> $GITHUB_PATH
68+
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
69+
- run: sudo apt-get update -q
70+
- run: sudo apt-get install libopenal-dev xorg-dev libgl1-mesa-dev libxkbcommon-dev -y --allow-unauthenticated
71+
- run: go get .
72+
- run: xvfb-run -a go test -v -race ./...
73+
- run: go vet ./...
74+
- run: staticcheck ./...
75+
- run: go build -tags x11 -v
76+
77+
build_linux_x11_arm:
78+
runs-on: ubuntu-22.04
79+
steps:
80+
- uses: actions/checkout@v2
81+
with:
82+
submodules: true
83+
- uses: actions/setup-go@v3
84+
with:
85+
go-version: '1.19.5'
86+
- run: sudo apt update -q
4287
- run: sudo apt-get install binutils-multiarch
4388
- run: sudo dpkg --add-architecture armhf
4489
- run: echo "" | sudo tee /etc/apt/sources.list
@@ -52,7 +97,7 @@ jobs:
5297
- run: sudo apt update -q
5398
- run: sudo apt install -f libgl1-mesa-dev:amd64 libxxf86vm-dev:armhf libc6-dev:armhf gcc-arm-linux-gnueabihf libopenal-dev:armhf libgl1-mesa-dev:armhf libxcursor-dev:armhf libxrandr-dev:armhf libxinerama-dev:armhf libxi-dev:armhf -y --allow-unauthenticated
5499
- run: export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
55-
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -v
100+
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -tags x11 -v
56101

57102
build_osx:
58103
runs-on: macos-latest

Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ APP ?= Ludo
22
ARCH ?= x86_64
33
VERSION ?= dev
44
BUNDLENAME = $(APP)-$(OS)-$(ARCH)-$(VERSION)
5+
DISPDRIVER ?= x11
6+
7+
ifeq ($(OS), Linux)
8+
TAGS = -tags=$(DISPDRIVER)
9+
BUNDLENAME = $(APP)-$(OS)-$(DISPDRIVER)-$(ARCH)-$(VERSION)
10+
endif
511

612
CORES = atari800 bluemsx swanstation fbneo fceumm gambatte gearsystem genesis_plus_gx handy lutro mednafen_ngp mednafen_pce mednafen_pce_fast mednafen_pcfx mednafen_psx mednafen_saturn mednafen_supergrafx mednafen_vb mednafen_wswan mgba melonds np2kai o2em pcsx_rearmed picodrive pokemini prosystem snes9x stella2014 vecx virtualjaguar
713

@@ -42,7 +48,7 @@ ifeq ($(OS), Windows)
4248
endif
4349

4450
ludo:
45-
go build
51+
go build $(TAGS)
4652

4753
ludo.exe:
4854
go build -ldflags '-H=windowsgui'
@@ -127,7 +133,7 @@ DEB_ARCH = amd64
127133
ifeq ($(ARCH), arm)
128134
DEB_ARCH = armhf
129135
endif
130-
DEB_ROOT = ludo_$(VERSION)-1_$(DEB_ARCH)
136+
DEB_ROOT = ludo-$(DISPDRIVER)_$(VERSION)-1_$(DEB_ARCH)
131137

132138
deb: ludo $(SOBJS)
133139
mkdir -p $(DEB_ROOT)/DEBIAN

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/disintegration/imaging v1.6.2
99
github.com/fatih/structs v1.1.0
1010
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6
11-
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad
11+
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b
1212
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
1313
github.com/golang/snappy v0.0.4 // indirect
1414
github.com/klauspost/compress v1.13.6 // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 h1:zDw5v7qm4yH7N8C8uWd+8I
2121
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw=
2222
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad h1:kX51IjbsJPCvzV9jUoVQG9GEUqIq5hjfYzXTqQ52Rh8=
2323
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
24+
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b h1:GgabKamyOYguHqHjSkDACcgoPIz3w0Dis/zJ1wyHHHU=
25+
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
2426
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
2527
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
2628
github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=

menu/input.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ func (m *Menu) ProcessHotkeys() {
193193
}
194194
}
195195

196-
// Toggle fullscreen if ActionFullscreenToggle is pressed
197-
if input.Pressed[0][input.ActionFullscreenToggle] == 1 {
196+
// Toggle fullscreen if ActionFullscreenToggle is released
197+
if input.Released[0][input.ActionFullscreenToggle] == 1 {
198198
settings.Current.VideoFullscreen = !settings.Current.VideoFullscreen
199199
m.Reconfigure(settings.Current.VideoFullscreen)
200200
m.ContextReset()

0 commit comments

Comments
 (0)